These idles were necessary when the context switch code
preserved PM_OVERRIDE registers. That was removed some time
ago so now the idles are not needed.
CRs-Fixed: 331325
Change-Id: I90d4e1685f213a5720bf6da4e6d4a187d1eb0689
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Use a #define constant instead of a bare constant for the flags
parameter of adreno_ringbuffer_issuecmds.
Change-Id: Ic0dedbadecabe396a51201859a444e68ba64c53d
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Add support for snapshotting the state of the GPU in a binary format. The
snapshot can be pulled from sysfs and parsed off-target. The advantage is
that far more information can be encapsulated in a snapshot then can be
printed on the console during a hang. Snapshots are automatically created
during a hang, or can be manually triggered by writing 'trigger'
in /sys/class/kgsl/kgsl-<n>/snapshot where n is either the 2D or 3D device.
Snapshot data can be pulled from 'dump' in the same directory.
Change-Id: Ic0dedbad1c8473b3b109582b95a8771b0d341f05
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
This reverts a87d51a96c
Patch causes increase in power consumption while playing a video.
CRs-fixed: 331854
Change-Id: Ic21f109ac730167539a78647d51a8051d5c9948f
Signed-off-by: Anoop Kumar Yerukala <ayeruk@codeaurora.org>
kmalloc allocates physically contiguous memory and
may fail for larger allocations due to fragmentation.
The large allocations are caused by the fact that the
scatterlist structure is 24 bytes and the array size
is proportional to the number of pages being mapped.
CRs-fixed: 327066
Change-Id: Ic7d15ca0399aa5c1fa01b7892cff736b3d1e4236
Signed-off-by: Jeff Boody <jboody@codeaurora.org>
The stop_work function releases the device mutex to flush
the workqueue. The requested state may change while the
mutex is held by a different thread. So set the requested
state after stop_work.
Change-Id: I3454e773fd670722ea5776d2c8d960190da24006
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
Use the restore_slumber variable at as low a level as possible
to remove confusion from the state machine. Also do not let
restore_slumber impact the function of NAP state.
Change-Id: I1e01dc35c19b3568bad1e6ae4b2399d309147cbd
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
If the core is in SUSPEND or INIT hw access should not be allowed.
Change-Id: I635a68044dc66be643eb73844b0a5a8b43f31b6c
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
MSM_SLEEP_STATS_DEVICE option is used to compile idle stats device
framework which is needed for GPU DCVS feature.
Change-Id: I9550c90054587aa4fcec40131761eeaf54da8a03
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
* changes:
msm: kgsl: only poke once during adreno_idle
msm: kgsl: Modify only the pending idle timer in ISR.
msm: kgsl: flush device workqueue before stop
The RBBM_STATUS loop is extremely tight and calling
adreno_poke() each time through this loop appears
to cause watchdog bites on 8960.
CRs-Fixed: 324507
Change-Id: I65145ca96f63280179d76abd5320fd201beeeaa7
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
mod_timer reactivates the timer even when timer is deleted using
del_timer_sync. In the ISR we should be modifying only the pending
timer. We deleted the timer using del_timer_sync, if the interrupts
are still enabled, we could be re-enabling the timer in the ISR.
There is a code path in kgsl_suspend device where we delete the timer
but disable IRQ later.This code path seems to be fixed with another
commit.
Change-Id: I1253dd3c774427e725d302d9ba13d87fad10c463
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Make sure the irq is off, the idle timer is
stopped and the workqueue is flushed before
stopping the device for early suspend, suspend,
last release or hang recovery. There is one case
where the workqueue cannot be flushed, which is from
kgsl_pwrctrl_sleep() when going into SLUMBER
state. This codepath can be called from the
workqueue itself so flushing would deadlock.
Change-Id: I19bcd192845401ac0d94aa60a9252970b634c1ea
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
The msm_idle_stats_update_event() function is now a public function.
In case of IDLE_TIMER expiry, kgsl calls this function to immediately
wake up waiting processes.
Change-Id: Ia259d10e08deea71db047d8091cc97066fba3c1c
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
If the device is not in active state, collecting a sample is not
necessary and will cause frequent wake-ups, resulting in higher power
consumption.
Change-Id: Icb4f82b1300cab3b4cc4ed17117a92725a5a11d4
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
If another state has been requested, there is no reason
to queue work.
Change-Id: Ifa8d57e523a047bd2021c00732c2fe6a67bd6790
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
These functions write registers and so if they are called
from kgsl_pwrctrl_irq() there is a chance that they
might be called when clocks are disabled.
Change-Id: I259d840d9996d424aba3e3481201d49f602637e8
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Since 7x25A supports two power levels, do not allow it to register
with the power scale policy.
Change-Id: I1a77f0aa8e7affa126d7c18cb2d73e8617602dcf
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
Scenarios which check for idle and inadvertently turn
on the core when it was off happen fairly frequently.
Fixing this at the root rather than continuing to work
around each one.
Change-Id: Ibddd40bf69352733c8d4779272aa08757981d494
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
Move the GPU register lists to a common location so they can be used
by multiple sub-systems. To avoid confusion, convert the lists from
byte offsets to dword offsets to match how we do register offsets
throughout the entire driver and in user space.
Change-Id: Ic0dedbad0f320242b77231a444939f9c6d852976
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Clean up kgsl_pwrctrl_sleep() and kgsl_pwrctrl_wake() to make
state transistions clearer. Add kgsl_pwrctrl_request_state()
and kgsl_pwrctrl_set_state() to make it easier to debug the
state machine.
CRs-Fixed: 315833
Change-Id: I656ce8bd19feabd4186ef91dc031f8a6c6a7d09a
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2d dcvs will also need changes in TrustZone. However
by adding this code first the TrustZone update can be
made later without breaking any functionality. This
feature is disabled by default and should not be
enabled without the necessary TrustZone changes in
place.
Change-Id: Ifdd511a3f18ba90faee189393ffc231fbbc6e2cd
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
Even if a core is ACTIVE during an early_suspend call make
sure it switches off eventually with lack of use.
Change-Id: I476e8a14a0d7e90a8ed8b8c05d0cf5ed88632cad
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
If the ringbuffer isn't idle, the GPU is probably in
SLUMBER or SUSPEND which are very idle states. This
function probably still shouldn't be called, so WARN
instead.
Change-Id: Ia49a819d935d6dce9cae2c193aff8e9de87d8af6
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
If postmortem dump tried to parse a context switch
buffer for any context except the current context
this function would never return.
Change-Id: I19f2fe7afda5796180cdf5f81c17fad960e84f05
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Leave the attributes initialized so that removing and
restoring policies doesn't result in a kernel panic.
Change-Id: I9724ebf94e3845b6cbaea18abf49d1813043eb52
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
ADRENO_ISTORE_START is valuable information for
a number of functions, so move it from within
adreno_debugfs.c to adreno.h.
Change-Id: Ic0dedbad41445fad2130b7cb28d706283f59b4c2
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Establish a standard generic format for a GPU ID in the KGSL core:
[0:15] - GPU specific identifier
[16:31] - 0x0002 for 2D or 0x0003 for 3D
Add a KGSL core function to get the GPU ID from the devices and
GPU specific functions to return them. For Z180, the ID will be
0x0002000B4 (0xB4 = 180). For 3D, the ID will be 0x00030000 ORed
with the GPU identifier (anywhere from 205 to 225).
Change-Id: Ic0dedbadddb3f587121913b9c226e2bda466f84e
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Some compilers struggle to find local includes that are referenced from
external headers. Add the driver path to ccflags-y.
Change-Id: Ic0dedbad2744e7350b19b97dc0b84cd49c070b95
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Primarily intended to allow Adreno Profiler to turn off the features
that confuse some of its metrics.
Change-Id: I22e0bd68147ef1631e3bd3f579e777866fb894c4
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
Because the IBs used for context switching are not allocated
by userspace, a separate search is needed to find them
in adreno_find_region.
Change-Id: I4c2a180333ae54ecbf257fd8c90ec2e3f748ad95
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Some hangs are fooling the postmortem dump code into
running off the end of a buffer. Fix this by making
its bounds check logic work better by reusing the
logic from kgsl_find_region().
CRs-Fixed: 319312
Change-Id: If6cc01369f4b0634d7e19494b8d021643abb8a39
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Remove a second redundant call to kgsl_mmu_set_mmutype
Change-Id: I9d98a242952ac5738c260df84896c2b0f76b12d3
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
This has not been found to be useful for hang debugging.
Change-Id: Ie8cfb6bcbb8f81d8da903d5062bc75fcc4c3bee4
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
The tools that process cff dumps expect a linear
memory region, but the start address of that region can
be configured. As long as there is only a single
pagetable (so that there aren't duplicate virtual
addresses in the dump), dumps captured with the
mmu on are easier to deal with than reconfiguring
to turn the mmu off.
Change-Id: If4070e60de50387dd12454b98e982b6713eeac42
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
The call touches too many general resourses to remain unlocked.
Change-Id: Ie5b36757d611750dda82f67b5579c85b1226b767
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
This value is different on adreno225, so rather than
hardcoding it use pix_shader_start instead.
Change-Id: I805647f440a7385cf10ba8bec2cb7ce0b517ad1f
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>