msm: kgsl: Add a new property to IOCTL_KGSL_DEVICE_GETPROPERTY

Return the reset status of the GPU unit when
IOCTL_KGSL_DEVICE_GETPROPERTY is called with
type KGSL_PROP_GPU_RESET_STAT

(cherry picked from commit 2dfe5dd0c53c8f9abc83bc6a9671d499c8135f68)

Change-Id: I6109b2d161e1c5a82363b582e2c1f106e2753742
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
msm: kgsl: Make sure that gpu clock goes to turbo after wake

Change-Id: I11348ac36a81ca2bdaf708d2340f2589b88a7d45
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>

msm: kgsl: Stop the device during sleep

For 7x27, 7x27A and 7x25A, stop the kgsl device during sleep.This
improved PDT stability results and 72hrs stability on customer devices.

CRs-Fixed: 339805
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
Signed-off-by: Sudhakara Rao Tentu <srtentu@codeaurora.org>
(cherry picked from commit fe4bede74b7c767412467f53c827528e3ad6bea4)

Conflicts:

	arch/arm/mach-msm/devices-msm7x27a.c
	drivers/gpu/msm/kgsl_pwrctrl.c

Change-Id: I7953947e8b9c8b5109e52b8af49857b7c9e941c0
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
msm: kgsl: Store process mem entries in a rbtree

The list of memory objects attached to a process gets searched quite
a lot during normal operation of the driver.  For processes with a
lot of memory allocations, the linear search through the list is O(N)
and uses a lot more CPU during critical loops than it should. Change
the mem entry list to a rbtree for faster search speeds.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>

(cherry picked from commit c9559e461e3df1b828218421430a38c9d7a38ca4)

(cherry picked from commit 33bceb148eaadf18ea91378dd9b9ac5861b36a09)

Change-Id: Ic769e0d2bb52cb4d14955942ce6bd8744d8a5995
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
msm: kgsl: rework ib checking

Separate ib parse checking from cffdump as it is useful
in other situations. This is controlled by a new debugfs
file, ib_check. All ib checking is off (0) by default,
because parsing and mem_entry lookup can have a performance
impact on some benchmarks. Level 1 checking verifies the
IB1's. Level 2 checking also verifies the IB2.

Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>

CRs-Fixed: 351811
(cherry-picked from commit d0ab6adeeae7dd039069fd93e6649777aff23668)

(cherry picked from commit f6924037a5d56f2934ef7d2b2cafb5ab3e49c94e)

Change-Id: Iebf462c29021cf0b7a830a8ff2d4cebcc3a39d43
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
msm: kgsl: Use kzalloc to allocate scatterlists of 1 page or less

The majority of the scatterlist allocations used in KGSL are under 1
page (1 page of struct scatterlist is approximately 1024 entries
equalling 4MB of allocated buffer).  In these cases using vmalloc
for the sglist is undesirable and slow.  Add functions to check the
size of the allocation and favor kzalloc for 1 page allocations and
vmalloc for larger lists.

CRs-Fixed: 351811
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
(cherry-picked from commit a652a07b0d719c4925ca45c018432888dd2388a4)

(cherry picked from commit 157ce2805727972f48881b37ba1ffe192b1801c6)

Change-Id: I54ff7011cfcbe8128e93063d2b43bc0688902a8f
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
msm: kgsl: fix 2d IB processing

The 2d hardware handles ringbuffer and IB commands as
a series of gotos. At the end of each IB, there must
be a goto command back to the ringbuffer, which must
be "monkey patched" into the IB by the driver.
Fix this code to use a proper kernel mapping.

CRs-Fixed: 351811
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
(cherry-picked from commit d27b09f388bab25f7e15ed9c5ca5eb1203c85492)

(cherry picked from commit 7c284e2286cc70d5be0403c09074b381844d3057)

Change-Id: I3c04dcff27ecf326b40aad0dc74f46fc0f4b8c95
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>