msm: kgsl: Don't call through pwrscale functions when entering SLUMBER

No additional calls to pwrscale idle or busy should be allowed when
transitioning to SLUMBER state.

Change-Id: I9488569758d263752c9778b8603f8e80bbc41ea1
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>
msm: kgsl: flush outer cache for alloc_page() pages

The outer cache needs to be flushed for these pages
after they are allocated so that the GPU and CPU
have a consistent view of them.

Change-Id: I4d6b688fc4a9f04d4bf8e3215d51bac32bf8e9fd
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>
msm: kgsl: Resolve conflicts in state changes

Only check requested state once, and fully transition to that
specific state.  This will resolve any conflicts arising from
changes to the requested_state as the state transition occurs.

Change-Id: I0836877d7d93d469158f7bfba5556fc082ebfe2a
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>
msm: kgsl: Write the retired timestamp on resume

Write the retired timestamp into the expected location. This fixes
userspace crashes after resume when the retired timestamp is read
as 0 instead of the expected last timestamp.

CRs-Fixed: 350556
Change-Id: Iaa487ba8be427c29b9f7e9b30b251cf26fcff95a
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>
msm: kgsl: Add functions for enabling / disabling a powerscale policy

Sometimes you want to enable or disable a policy for a bit without
actually swapping out the policy.  These functions allow the kernel
to control the policy functionality.

Change-Id: Ic0dedbad4406e5fffe1ebd8e8ba4e6bf84d82203
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>
msm: kgsl: Search setstate memory descriptor

When searching for a memory descriptor for a given gpuaddr search
for the setstate memory descriptor as well.

Change-Id: Ib5cbc797bbfddd35b89fbba64196c226c0995fa1
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>
msm: kgsl: Remove duplicate soptimestamp memory write call

This soptimestamp write is not needed twice after hang recovery.

Change-Id: I117ecdc8651bf8b9410a245e0582c1f672d3ca6d
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>

Conflicts:

	drivers/gpu/msm/adreno.c
msm: kgsl: Use default hardcoded value for CP's ROQ queue size

The command processor FIFO depth is different for A330 and A2xx GPUs.
It is best to let each GPU use the default value which is hardcoded in
the respective GPU.

Change-Id: I5db6a1c0671d0ad4253dcad7f386429d78a4bd62
Signed-off-by: Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org>
Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>
msm: kgsl: Improve the notification timing of idle events

Use the ringbuffer read and write pointers to determine if the
GPU is almost done processing a command sequence.

Change-Id: I0d131a7df71aca02d644a5b95b99749ced2f0b0e
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>

Conflicts:

	drivers/gpu/msm/kgsl_pwrscale_msm.c
msm: kgsl: Properly assign the physical address

Correctly assign the physical address to be used as gpu address
when no MMU is used.

Change-Id: Ie824cadc7c8c85203f81c9c5961b6f8a5d1cd449
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>
msm: kgsl: Fix powerscale idle logic

Logic error was causing powerscale to get into a slightly funky state.

Change-Id: I2ff9e15180babfb07c63ab556e22f7db53f95a78
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>