Commit Graph

4824 Commits

Author SHA1 Message Date
Jordan Crouse
d17e9aa8d5 msm: kgsl: Create scatter gather lists for memory objects
Create and use scatter-gather lists for memory objects, which
avoids dynamically figuring the physical addresses of pages for
MMU mapping and cache operations.

Change-Id: Ic0dedbad9b973ecce4ae773b6bd682ba01010e5b
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-21 10:32:26 -06:00
Linux Build Service Account
79b6b4ff20 Merge "msm: kgsl: Calculate the CPU busy during each GPU idle period" into msm-3.0 2011-10-20 15:27:45 -07:00
Dominic Binks
417877fdd3 Revert "msm: kgsl: suspend device when the display does off"
This reverts commit 3b7ad9c576.

Change-Id: Ie54ad7e14fc297a1275e50957023bf6c614b1e5e
Signed-off-by: Dominic Binks <dbinks@codeaurora.org>
2011-10-20 13:04:34 -07:00
Linux Build Service Account
456ddadcb1 Merge "msm: kgsl: suspend device when the display does off" into msm-3.0 2011-10-20 01:47:14 -07:00
Shubhraprakash Das
d9c90fa863 msm: kgsl: Force rb, and ib dumps
Force the dump of IB1, and IB2 in postmortem even if their sizes
in the registers are 0. Also, make sure that the ringbuffer size
is correct and print 100 dwords of ringbuffer history instead
of 64

Change-Id: Icbbef62cafc59338c979a34d1590362f7c1d5de0
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
2011-10-19 15:41:24 -06:00
Lucille Sylvester
3f2661fbb1 msm: kgsl: Calculate the CPU busy during each GPU idle period
Gather more stats data for the analyzing daemons.

Change-Id: I9ffcfc76c0bd5f27ebf50d3f97e169662697fd12
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-18 10:24:57 -06:00
Suman Tatiraju
3b7ad9c576 msm: kgsl: suspend device when the display does off
This change saves leakage current when the display is
off. In scenerios where a user is listening to an mp3
this feature stops the GPU as soon as the display goes
off. The GPU is started again when the display comes
back. The feature also avoids the GPU resuming when a
email sync happens while the device is suspended.

Change-Id: I6f42aefec72848fc49cf4c71433d95a01fa3094d
Signed-off-by: Suman Tatiraju <sumant@codeaurora.org>
2011-10-17 10:36:11 -07:00
Linux Build Service Account
0b38f4c377 Merge "gpu: ion: Actually return aligned memory" into msm-3.0 2011-10-15 12:53:35 -07:00
Laura Abbott
5ee3921e4c gpu: ion: Actually return aligned memory
Currently, the ion allocation API takes an alignment
argument. This alignment argument is currently ignored
everywhere. The system heaps cannot support the alignment
argument, but carveout heaps can. Add support for carveout
heaps to give back aligned memory.

Change-Id: Ic4cff37a7de51e1c85e273c2589958f7f13c33c9
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-15 11:59:11 -07:00
Jeremy Gebben
b46f4157ba msm: kgsl: fix 2d kgsl_pwrctrl_irq() call
The call to turn on the 2d irq from z180_start() would have
no effect because it was using the wrong flag. The offending flags,
which should only be used from within kgsl_pwrctrl.c for setting bits
in struct kgsl_pwrctrl.power_flags are also moved to the .c file
to avoid problems like this in the future.

Change-Id: Ied48c5f3b4860d55b2c0b7019ba50ed22d7f6bc1
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-15 00:19:20 -06:00
Linux Build Service Account
2ea4f046c5 Merge "msm: kgsl: Add idlestats sleep event notification" into msm-3.0 2011-10-14 23:04:38 -07:00
Lucille Sylvester
3b46d001e2 msm: kgsl: Add idlestats sleep event notification
Change-Id: Ie632d3f44661575ad8c7b41f064eff5f3b068f62
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-13 15:57:20 -06:00
Lucille Sylvester
2cbd1ffea5 msm: kgsl: Make sure we are idle before calling pwrscale_idle
Change-Id: Id56d94a1be345c72fa11b1029411d9cb73279729
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-13 14:57:50 -06:00
Jordan Crouse
1bf80aa867 msm: kgsl: Add a work item for processing expired timestamps
Add a work item to be triggered following a RB complete interrupt
signifying that a timestamp has been processed and retired on
the GPU. To kick things off, this work item is the the new home
for flushing expired memory objects allowing us to get rid of
kgsl_memqueue_drain and its various offspring.

Change-Id: Ic0dedbad853291ae5d05247241f449a7b523e318
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-12 17:09:20 -06:00
Laura Abbott
abcb6f740e gpu: ion: Add cache flushing APIs
Add ioctl to support flushing the caches of ion
buffers from userspace.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-11 09:59:30 -07:00
Laura Abbott
354120303a gpu: ion: Add IS_CACHED macro
Add a proper IS_CACHED macro for detecting whether or not
flags indicated a cached mapping.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-11 09:59:25 -07:00
Ranjhith Kalisamy
823c14810e msm: kgsl: Debugfs knob to configure wait timeout of adreno device
There are times when the adreno device is heavily loaded. Here, a
predetermined wait timeout value will not be useful. The configurability
introduced with this change will help in understanding the behaviour and
to tune the value. Will also be helpful in quickly identifying problems
that arise when the irqs don't fire.

Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
2011-10-11 09:59:23 -07:00
Jeremy Gebben
671e5941f5 Revert "msm: kgsl: force 8960 v1 & v2 to use adreno220"
This reverts commit 8ad6fed70fbd18f4a061be2b3d749d3692dd7f86.

This is no longer needed now that workaround firmware for
8960v2 is available.

Change-Id: I212b7a7e4ef086b25d01d546df63a64505d8d374
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-06 09:26:24 -07:00
Jeremy Gebben
e2e61d4667 msm: kgsl: load workaround firmware for 8960v2
Change-Id: I3729b4d6f981e9b6202183a1e4614d57a5148062
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-06 09:26:20 -07:00
Ranjhith Kalisamy
f81dcd0e75 msm: kgsl: Remove WPTR drop prevention workaround
The WPTR drop prevention workaround added earlier is seen to cause
vague GPU hangs while running 3DMM06 app. So removing it.

CRs-Fixed: 309787
Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
2011-10-05 10:37:26 -07:00
Jordan Crouse
d8f1c6b7fa msm: kgsl: Cleanup virtual files on module exit
Make sure that all sysfs and debugfs entries
are cleaned up when the driver exits.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-05 10:27:42 -07:00
Shubhraprakash Das
767fdda6e1 msm: kgsl: Introduce Iommu Code
kgsl now supports the use of 2 types of MMU. One is
the GPU's internal MMU and the other is IOMMU. Both
MMU cannot be active at the same time. The MMU type
can be selected at compile time via config option.
A boot command line parameter can be used to override
the type of MMU selected at compile time.

Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
2011-10-04 17:14:34 -07:00
Laura Abbott
f4c973de77 gpu: ion: Move initialization earlier
Ion needs to be initialized before most other subsystems.
Move the call to be earlier to ensure drivers that need to
allocate memory at bootup can.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-04 17:14:31 -07:00
Laura Abbott
4b5d048a1e gpu: ion: Add O_DSYNC flag to generated file
Ion uses the O_DSYNC flag of a file to indicate an uncached mapping.
When generating a file for mmaping, the new file needs to have the
same O_DSYNC flag as the parent (the file of the ioctl open call)
to indicate if the mapping should be cached or uncached.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-04 17:14:25 -07:00
Laura Abbott
e8f280253c gpu: ion: Fix cached and uncached mapping in carveout heap
When the cached flag is set, ioremap_cached should be called.
When the cache flag is not set, ioremap should be called.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-04 17:14:24 -07:00
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