Commit Graph

4799 Commits

Author SHA1 Message Date
Lucille Sylvester
2c704c926f msm: kgsl: Add a periodic check to turn the TZ algorithm on
In use cases with very high graphics for some time followed by
low constant usage, the power level is never dropped.  Periodically
allow the TZ algorithm to run to see if any change in the external
conditions has occured.

CRs-fixed: 309131
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-04 17:14:10 -07:00
Jordan Crouse
4283e1715b msm: kgsl: Properly handle double mmapped memory
In some situations, the same block of memory is
mapped multiple times.  Properly refcount that mapping
otherwise we could get into a situation where the mem
entry is completely dereferenced before its time.

CRs-fixed: 306942
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-04 09:52:01 -07:00
Tarun Karra
96a12670fe msm: kgsl: for 8960 turn of clk gating for SX_clk_0
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
2011-10-03 16:21:30 -07:00
Lucille Sylvester
02e4629720 msm: kgsl: Don't count io busy at the lowest power level
If the GPU is running as slowly as possible, it is adding
lots of io busy to the CPU.  This causes the CPU ondemand
algorithm to unneccessarily increase CPU frequency.

Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-03 16:21:03 -07:00
Lynus Vaz
5a641cc260 msm: kgsl: Add AXI rate request on wakeup
Actually vote for AXI rate. If gpuclk sysfs file is changed
during device sleep, the previous AXI rate was retained instead
of the new AXI rate.

Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
2011-10-03 16:20:57 -07:00
Lucille Sylvester
20ec38a9ae msm: idle_stats: Make idle_stats_device.h userspace accessable
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-03 16:20:28 -07:00
Matt Wagantall
9dc0163652 msm: kgsl: Use device names to distinguish between graphics clocks
Distinguish between similar clocks on different cores using the
device struct passed to clk_get(). This allows for a common
clock naming convention that spans across targets.

Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2011-10-03 16:20:23 -07:00
Lucille Sylvester
958dc94f21 msm: kgsl: Call pwrscale busy only when the GPU is definitely busy.
Original call placement could happen without actually starting
the GPU's workload.

Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-03 16:20:12 -07:00
Jeremy Gebben
99105cb536 msm: kgsl: add new adreno225 registers to context switching
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-03 16:19:59 -07:00
Lucille Sylvester
d40c340622 msm: kgsl: Make TZ usage depend on general SCM availability
SECURE_IO was an 8660 dependency, not a multi-platform feature.

Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-03 16:19:51 -07:00
Jeremy Gebben
eebc461898 msm: kgsl: clean up adreno220 registers
There's not enough of these to justify a separate header.

Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-03 16:19:39 -07:00
Jordan Crouse
fd97843e7e msm: kgsl: Fix an over greedy CONFIG_ANDROID_PMEM ifdef
kgsl_get_phys_file is used for both PMEM and the framebuffer,
so adjust the #ifdef CONFIG_ANDROID_PMEM to only omit the
PMEM specific parts.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-03 16:19:07 -07:00
Jordan Crouse
976cf0e965 msm: kgsl: Avoid a possible variable dereference in kgsl_mmap
There was a possiblity that a variable would be dereferenced
in a loop, so use a temporary holder to avoid any corner
case problems.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-03 16:19:06 -07:00
Lucille Sylvester
cd42c82b23 msm: kgsl: Clocks should be set to the active level during NAP
Fix a bug in the interaction between NAP and GPU DCVS.  Without
this change the clock freq recommended by DCVS might or might
not have been used.  Power levels should be stabilized for test
cases now.

Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-03 16:18:37 -07:00
Ranjhith Kalisamy
22d15a73ac msm: kgsl: Use ringbuffer WPTR drop prevention workaround only for a20x GPU
The workaround added to prevent the writes to ringbuffer WPTR from being
dropped does not work on a22x GPU. So, restrict this workaround only for
a20x GPU.

Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
2011-10-03 16:18:25 -07:00
Lucille Sylvester
578091cf38 msm: kgsl: Enable TZ GPU DCVS for 8960
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-03 16:18:25 -07:00
Jeremy Gebben
aafef44e41 msm: kgsl: force 8960 v1 & v2 to use adreno220
Currently v2 works better if we pretend it is
adreno220 instead of adreno225.

Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-03 16:18:17 -07:00
Lucille Sylvester
1e99fcb8cd msm: kgsl: fix gpu_busy variable
Fix for pwrscale policies without both a busy & idle func.

Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-03 16:18:10 -07:00
Ranjhith Kalisamy
8b636956ba msm: kgsl: Add proper device lock/unlock for early suspend driver
Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
2011-10-03 16:18:03 -07:00
Ranjhith Kalisamy
3fcdb3301f msm: kgsl: Prevent writes to ringbuffer WPTR from being dropped
Sometimes, the writes to ringbuffer WPTR register are dropped. This will
make the GPU to go to idle before completing all the commands that it is
submitted with. This workaround prevents the writes from being dropped.

CRs-Fixed: 302173
Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
2011-10-03 16:17:54 -07:00
Ranjhith Kalisamy
bd5297fc43 msm: kgsl: Fix bug in postmortem dump register decode
Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
2011-10-03 16:17:50 -07:00
Laura Abbott
894fd58ea8 gpu: ion: Add support for cached and uncached mappings
Add explicit support for cached and uncached mappings. Functions
now describe whether mappings will be cached or uncached.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-03 16:17:38 -07:00
Lucille Sylvester
591ea03860 msm: kgsl: Add idle_stats based pwrscale policy
Add a pwrscale policy to transmit idle statistics
to userspace via the MSM idle_stats_device core.

Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-03 16:17:25 -07:00
Laura Abbott
a2e9363f06 gpu: ion: Add support for carveout heaps on msm targets
Add infrastructure for supporting ion carveout heaps.
The memory type should be specified in the board file using
mach/ion.h. The ion platform driver will be responsible for
allocating the correct memory.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-03 16:17:21 -07:00
Laura Abbott
302911d5ba gpu: ion: Add platform driver for msm ion
Add platform driver for msm specific ion devices

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-03 16:17:20 -07:00
Lucille Sylvester
844b1c8713 msm: kgsl: IRQ must be off after _stop is called
ringbuffer_stop & mmu_stop will turn on the IRQ handler.
Turn it off after they are called.

Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-03 16:17:17 -07:00
Sushmita Susheelendra
f389606af7 msm: kgsl: Record missing memory writes to the cff dump
The buffers memstore and dummyspace were being memset
before memory for them was allocated and mapped.
kgsl_cff_parse_ibs should record the write instead
of returning upon encoutering a hostaddr with no
physical addr.
Writes to GMEM were not being recorded. Adding
the mem syncs for that

Signed-off-by: Sushmita Susheelendra <ssusheel@codeaurora.org>
2011-10-03 16:17:07 -07:00
Sushmita Susheelendra
41f8fa3306 msm: kgsl: Add CFF user event ioctl to write data to cff dumps
Add the ioctl IOCTL_KGSL_CFF_USER_EVENT to write data to cff dump.
Define a new CFF packet cff_op_user_event for this generic user
event.
Write the surface parameter data packet and verify mem file
packet to cff dumps

Signed-off-by: Sushmita Susheelendra <ssusheel@codeaurora.org>
2011-10-03 16:17:02 -07:00
Jeremy Gebben
2f789d14b8 msm: kgsl: stop forcing hw patchid to 0 for 8x60 and 8960
This field of the chip_id was forced to 0 because userspace
got confused when it was a different value. Userspace has
been corrected to deal with the correct patch ids.

Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-03 16:16:54 -07:00
Sushmita Susheelendra
fbb46aabd3 msm: kgsl: Fix ringbuffer command names
The prefix PM4_ was changed to CP_.

Signed-off-by: Sushmita Susheelendra <ssusheel@codeaurora.org>
2011-10-03 16:16:53 -07:00
Jeremy Gebben
6061bc76ed msm: kgsl: add MEMORY_BASE and HANG packets
These are changes to the cffdump output format.
MEMORY_BASE reports the address range we're using at the start
of the dump, which helps the postprocessors validate memory
writes.

HANG is emitted at the start of kgsl_postmortem_dump(), and can
be used by the postprocessors to stop when the hang occurs.

Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-03 16:16:26 -07:00
Jeremy Gebben
a7423e433e msm: kgsl: cffdump syncmem ioctl
This ioctl is needed to track memory writes done from userspace
so that this data is correctly captured in the dump.

Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-03 16:16:26 -07:00
Suman Tatiraju
7fe62a3d10 msm: kgsl: add gpu busy stats to sysfs
Signed-off-by: Suman Tatiraju <sumant@codeaurora.org>
2011-10-03 16:15:57 -07:00
Tarun Karra
9b92ccd290 msm: kgsl: Changed variable type from unsigned int to long
Changed variable "result" type from unsigned int to long
to accurately reflect the result of macro wait_event_interruptible_timeout

Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
2011-10-03 16:15:40 -07:00
Tarun Karra
44cbeb74ac msm: kgsl: changed strncat to strlcat
Changed strncat to strlcat to pervent buffer overflow.

Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
2011-10-03 16:15:32 -07:00
Lucille Sylvester
28e99c8edb msm: kgsl: Use the first command to initiate busy
There may be multiple command submissions per-frame.  Start your
busy count only on the first one.

Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-03 16:15:32 -07:00
Lucille Sylvester
622927ad37 msm: kgsl: Update pwrlevel_change
Previously only supported fabric votes, now supporting AXI as well.

Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-03 16:14:29 -07:00
Sushmita Susheelendra
22d87177a2 msm: kgsl: Fix build errors when CONFIG_MSM_KGSL_CFF_DUMP is on
Signed-off-by: Sushmita Susheelendra <ssusheel@codeaurora.org>
2011-10-03 16:14:28 -07:00
Laura Abbott
b1b7b43a64 gpu: ion: check return value from gen_pool_add
Check the return value from gen_pool_add and handle
any error gracefully.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-03 16:14:18 -07:00
Jeremy Gebben
79acee6f01 msm: kgsl: fix possible memory leak in firmware loading
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-03 16:14:14 -07:00
Jeremy Gebben
3c127f589a msm: kgsl: fix parameter checking in adreno_ringbuffer_issueibcmds
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-03 16:14:14 -07:00
Jeremy Gebben
690f9d172f msm: kgsl: fix error handling in kgsl_ioct_sharedmem_flush_cache
For some error conditions it was possible to exit this function
without unlocking the spinlock.

Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-03 16:14:13 -07:00
Jordan Crouse
6c2992ac90 msm: kgsl: Check for NULL from kgsl_get_device_from_dev
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-03 16:14:12 -07:00
Jordan Crouse
2db0af97c8 msm: kgsl: Don't lookup the device with inodep if we don't have to
kgsl_open does a fine job of setting the private members of
struct file so use that in the other fops functions rather then
looking up the device via the inode minor every time.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-03 16:14:12 -07:00
Jeremy Gebben
a87bb86117 msm: kgsl: switch sprintf calls to snprintf
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-03 16:14:11 -07:00
Jordan Crouse
b58e61b2fa msm: kgsl: Avoid a deadlock in the IRQ handler
If a major GPU fault occurs, interrupts should be turned off to
avoid a storm.  Calling disable_irq from within the IRQ handler,
however has deadlock problems.  Call disable_irq_nosync in an
interrupt context instead.

CRs-fixed: 299686
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-03 10:28:57 -07:00
Jordan Crouse
505df9cb23 msm: kgsl: Consolidate all GPU information in one spot
We are starting to accumulate a lot GPU specific information,
and it is handy to keep it all in one place where new core IDs,
firmware and device functions can be easily added.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-03 10:28:36 -07:00
Jordan Crouse
084427d2c2 msm: kgsl: Rename PM4 to CP to better align with A3XX code
The A3XX code likes to use CP_ as a prefix for ringbuffer
commands rather then the legacy PM4 prefix.  Since it is more
correct, switch the A2XX code over now to make it easier to
integrate A3XX into the mix.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-03 10:28:35 -07:00
Jordan Crouse
2c542b697e msm: kgsl: Don't make assumptions about VMA regions
We cannot assume that a VMA region created as a result of an mmap
belongs exclusively to us.  Allow the user to pass the size of
the vmalloc region through the 'gpuaddr' member of the ioctl
struct and do strict checking on the returned vma to make sure
it is valid.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-03 10:28:34 -07:00
Jordan Crouse
0e0486f251 msm: kgsl: Rearrange some drawctxt functions
Move some of the drawctxt functions that are common
to A2XX and A3XX back to the generic drawctxt code
and headers.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-03 10:28:29 -07:00