Commit Graph

4942 Commits

Author SHA1 Message Date
Linux Build Service Account
13605e484b Merge "gpu: ion: Check for release/request functions before calling" into msm-3.0 2011-12-08 14:54:13 -08:00
Linux Build Service Account
d34b4ccee0 Merge "gpu: ion: Fix debugfs handling of multiple kernel clients" into msm-3.0 2011-12-08 14:54:13 -08:00
Laura Abbott
eed86035d5 gpu: ion: Fix debugfs handling of multiple kernel clients
Currently, Ion registers all debugfs entries for clients
via pid. If there are multiple kernel clients, this means
the debugfs entry only gets created for the first one. Fix
this by creating debugfs entries by name always. When
creating user clients, specify the name via the pid.

Change-Id: I00cbb284d1c53b3362bb7be9c0275620a9fac167
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-12-08 08:39:38 -07:00
Jeremy Gebben
faabed7322 msm: kgsl: let postmortem dump find context switch IBs
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>
2011-12-08 08:37:37 -07:00
Jeremy Gebben
16e80faf3f msm: kgsl: improve postmortem and cff bounds checking
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>
2011-12-08 08:37:37 -07:00
Linux Build Service Account
f44dd6fb34 Merge changes I8e571677,I6d17c0f5 into msm-3.0
* changes:
  gpu: ion: Add call back for unmapping user mappings
  gpu: ion: Incrememnt user refcount during vma_open/vma_close
2011-12-08 05:58:55 -08:00
Linux Build Service Account
25d136a92f Merge changes Ie8cfb6bc,If4070e60 into msm-3.0
* changes:
  msm: kgsl: remove ib_dump debugfs file
  msm: kgsl: make cffdump work with the MMU enabled
2011-12-08 00:42:29 -08:00
Laura Abbott
a683509211 gpu: ion: Add call back for unmapping user mappings
When mmap is called to remove a mapping, the mmap code
takes care of removing all the entries so it isn't
necessary to call unmap versions. However, there may be
cases where heaps need to do other buffer clean up when
a userspace buffer is unmapped. Add an unmap_user function
to the ion heap ops. This callback needs to happen in
vma_close, so move the decrementing of the overall user map
call back as well.

Change-Id: I8e5716774dd973828f76e03ec43e8e8ecf8c7936
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-12-07 15:07:01 -08:00
Laura Abbott
7716850941 gpu: ion: Incrememnt user refcount during vma_open/vma_close
Ion allows multiple mmaps of the same buffers. This means that
incrementing the usermap count in mmap and decrementing it in
release is not sufficient as release will only ever be called
once. Fix this by only doing the reference count change in the
vma_open and close which are called whenever mmap is called.

Change-Id: I6d17c0f563d0b90481d8e092c1e206f2b33c8e00
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-12-07 15:07:00 -08:00
Laura Abbott
b866d75946 gpu: ion: Check for release/request functions before calling
Not all heaps will implement the release/request callbacks. Check those
function pointers are valid before calling.

Change-Id: I848e31495e45c7eaa4497b82be590d291d77980a
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-12-07 10:48:17 -08:00
Shubhraprakash Das
e530ef377c msm: kgsl: No need to set the graphics mmu type twice
Remove a second redundant call to kgsl_mmu_set_mmutype

Change-Id: I9d98a242952ac5738c260df84896c2b0f76b12d3
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
2011-12-06 10:46:05 -07:00
Jeremy Gebben
8db5da8a23 msm: kgsl: remove ib_dump debugfs file
This has not been found to be useful for hang debugging.

Change-Id: Ie8cfb6bcbb8f81d8da903d5062bc75fcc4c3bee4
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-12-06 09:26:52 -07:00
Jeremy Gebben
a3d07a4bee msm: kgsl: make cffdump work with the MMU enabled
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>
2011-12-06 09:26:52 -07:00
Linux Build Service Account
1ad4d9022a Merge "msm: kgsl: _timestamp ioctl should be locked." into msm-3.0 2011-12-06 06:33:33 -08:00
Lucille Sylvester
9329cf053e msm: kgsl: _timestamp ioctl should be locked.
The call touches too many general resourses to remain unlocked.

Change-Id: Ie5b36757d611750dda82f67b5579c85b1226b767
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-12-05 21:59:43 -07:00
Laura Abbott
8c0173668e gpu: ion: Add support for iommus
Add infrastructure to support mapping allocations
into iommus.

Change-Id: Ia5eafebee408e297013bf55284abf67d9eb8d78b
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-12-05 10:36:11 -08:00
Jeremy Gebben
72aadf4eaa msm: kgsl: don not hardcode SQ_INST_STORE_MANAGMENT
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>
2011-12-04 20:44:58 -07:00
Norman Gee
d7402ff985 msm: kgsl: add tracepoints
Add tracepoint instrumentation to a2xx irqs, z180 irqs, command
buffer issues, timestamp checks, and timestamp waits.

Change-Id: Ib8763a4ff408c448b5b984d80f66b0c77268d9cf
Signed-off-by: Norman Gee <jgee@codeaurora.org>
2011-12-03 20:51:37 -07:00
Linux Build Service Account
c2cda4abbb Merge "gpu: ion: Map only the vma size given" into msm-3.0 2011-12-03 18:19:43 -08:00
Laura Abbott
ceee3d25d5 gpu: ion: Map only the vma size given
When mapping carveout buffers into userspace, only map
the size of the vma given, not the full size of the buffer
since clients may map less than the buffer size.

Change-Id: Idf1d1ee5850c0f7045c0f78bfd5841a76db90a34
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-12-03 05:44:33 -07:00
Linux Build Service Account
4b4af6f121 Merge "msm: kgsl: create singlethread wq instead of per-cpu wq" into msm-3.0 2011-12-03 04:41:18 -08:00
Linux Build Service Account
455673b820 Merge "msm: kgsl: Enable adreno225 firmware for 8960v3" into msm-3.0 2011-12-03 04:41:18 -08:00
Alex Bird
8a3ede3801 gpu: ion: Add callbacks to enable SMI voting in ION.
This change is part of the move from PMEM to ION. ION needs an SMI
voting interface smiliar to PMEM's.

Change-Id: I18888f46198848694fb7e1e0d2671074bf51d7c9
Signed-off-by: Alex Bird <alexbird@codeaurora.org>
2011-12-01 17:45:22 -08:00
Carter Cooper
f27ec727d2 msm: kgsl: Enable adreno225 firmware for 8960v3
There is a hardware fix between 8960v2 and 8960v3 that affects which
version of adreno225 firmware is used.  There is no difference in
the chipid in adreno225 so do a runtime check to determine the
firmware to load.

Change-Id: Id4b8025c04c154550c4dc52df0011aa4e8ffa799
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
2011-12-01 11:09:59 -07:00
Jeremy Gebben
e139a04f64 msm: kgsl: fix adreno225 register ranges
There is a gap between GRAS_UCP5W and GRAS_UCP_ENABLED.
Trying to save and restore these registers with shadow writes off
results in rbbm read errors.

Change-Id: I4c99d9e23cae81315418f33aa656117303f990f2
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-11-30 13:23:05 -07:00
Jeremy Gebben
3d25b0915c msm: kgsl: fix error handling in adreno_waittimestamp()
This function was incorrectly reporting hangs when an
error such as ERESTARTSYS was returned by
__wait_event_interruptible_timeout().

Change-Id: I9139b03c4b417d135663729c763343382328da77
CRs-Fixed: 321490
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-11-30 13:23:05 -07:00
Linux Build Service Account
72e79e4235 Merge "gpu: ion: Add support for flushing via fd" into msm-3.0 2011-11-29 16:58:29 -08:00
Linux Build Service Account
a90f3352e9 Merge "msm: kgsl: Use the new clock naming conventions effectively" into msm-3.0 2011-11-29 16:58:29 -08:00
Steve Muckle
3e042dff0f msm: kgsl: create singlethread wq instead of per-cpu wq
There doesn't seem to be a need for a per-CPU workqueue - kgsl can
make do with a singlethread workqueue which consumes less resources
and does not pin work to specific CPUs.

Change-Id: I6f9bd368434797a05497be88c24a5b1645d2f221
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
2011-11-29 08:53:41 -08:00
Linux Build Service Account
700c9ccf06 Merge "msm: kgsl: Add CP_DRAW_INDX commands after a context save" into msm-3.0 2011-11-28 13:06:52 -08:00
Lucille Sylvester
dce84cdc3f msm: kgsl: Use the new clock naming conventions effectively
Still allow the clocks a per-platform map for clock error checking,
but use a const array of their identical names.

Change-Id: If83654b4cf68b34f0cbde68021c267aceb423db8
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-11-28 11:34:53 -07:00
Shubhraprakash Das
3598b2eec7 msm: kgsl: Add CP_DRAW_INDX commands after a context save
Issue an empty draw call to avoid possible hangs due to
repeated idles without intervening draw calls.
On adreno 225 the PC block has a cache that is only
flushed on draw calls and repeated idles can make it
overflow if there are not intervening draw calls.
The gmem save path contains draw calls so this workaround
isn't needed there.

CRs-Fixed: 316084
CRs-Fixed: 317712
Change-Id: I280468b61fd3a6b6ffb30a1cdf118399f115f0dd
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
2011-11-23 10:33:19 -07:00
Jordan Crouse
d4bc9d2e0c msm: kgsl: Add timestamp events
Add support for triggering asynchronous events when a timestamp
expires.  The infrastructure is generic enough to support different
sorts of events and callbacks.  The first user of the event
infrastructure is a way to release a genlock locks on behalf of a
user space process.

Change-Id: Ic0dedbadfe67d98a5678453cbe0ac6996ba5c68f
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-11-22 17:51:51 -07:00
Jordan Crouse
e6239dd865 msm: kgsl: Reimplement the timestamp comparison function
Make timestamp_cmp return -1, 0 or 1 depending if
the first operand is less than, equal or greater
than the second operand.

Change-Id: Ic0dedbad0ea2d918e0eeef9428859f0b54a6e7ad
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-11-22 16:51:55 -07:00
Linux Build Service Account
2d97e7ade6 Merge "msm: kgsl: Make sure WPTR reg is updated properly" into msm-3.0 2011-11-22 14:17:44 -08:00
Laura Abbott
e80ea017f1 gpu: ion: Add support for flushing via fd
Userspace clients pass fds around, not handles. Support flushing
via fd.

Change-Id: Ic22d9327e9fa72cb604c3010a2a6f798be8dfdb1
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-11-21 12:27:52 -08:00
Lucille Sylvester
ef44e7338f msm: kgsl: Remove wakelock and pm_qos requirements
System wake latencies have improved to the point that we can allow
power collapse during graphics processing.

Change-Id: I41dd04c82894347518450b0c8e6ee5fae01f859c
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-11-21 09:40:45 -07:00
Linux Build Service Account
90c7c16bd4 Merge "msm: kgsl: Do not allow SLUMBER from INIT" into msm-3.0 2011-11-21 05:26:28 -08:00
Linux Build Service Account
2f0ec1450b Merge "Merge remote-tracking branch 'common/android-3.0' into msm-3.0" into msm-3.0 2011-11-18 21:35:29 -08:00
Lynus Vaz
06a9a90081 msm: kgsl: Make sure WPTR reg is updated properly
Sometimes writes to WPTR register do not take effect, causing a
3D core hang. Make sure the WPTR is updated properly when waiting.

Change-Id: I86559198c65a1f5ae8542a479daef054847e5158
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
2011-11-18 11:00:45 +05:30
Linux Build Service Account
3cb46e6213 Merge "msm: kgsl: Set default value of wait_timeout in the adreno_dev struct" into msm-3.0 2011-11-17 02:15:40 -08:00
Lucille Sylvester
bfecf1db1c msm: kgsl: Do not allow SLUMBER from INIT
In INIT state the device has not been started yet and crashes
if an attempt is made to use its uninitialized resources.

Change-Id: Iaf0bbef02829d400631a4e711ee618225f0ac6c8
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-11-16 15:18:32 -07:00
Bryan Huntsman
d074fa2796 Merge remote-tracking branch 'common/android-3.0' into msm-3.0
* common/android-3.0: (570 commits)
  misc: remove kernel debugger core
  ARM: common: fiq_debugger: dump sysrq directly to console if enabled
  ARM: common: fiq_debugger: add irq context debug functions
  net: wireless: bcmdhd: Call init_ioctl() only if was started properly for WEXT
  net: wireless: bcmdhd: Call init_ioctl() only if was started properly
  net: wireless: bcmdhd: Fix possible memory leak in escan/iscan
  cpufreq: interactive governor: default 20ms timer
  cpufreq: interactive governor: go to intermediate hi speed before max
  cpufreq: interactive governor: scale to max only if at min speed
  cpufreq: interactive governor: apply intermediate load on current speed
  ARM: idle: update idle ticks before call idle end notifier
  input: gpio_input: don't print debounce message unless flag is set
  net: wireless: bcm4329: Skip dhd_bus_stop() if bus is already down
  net: wireless: bcmdhd: Skip dhd_bus_stop() if bus is already down
  net: wireless: bcmdhd: Improve suspend/resume processing
  net: wireless: bcmdhd: Check if FW is Ok for internal FW call
  tcp: Don't nuke connections for the wrong protocol
  ARM: common: fiq_debugger: make uart irq be no_suspend
  net: wireless: Skip connect warning for CONFIG_CFG80211_ALLOW_RECONNECT
  mm: avoid livelock on !__GFP_FS allocations
  ...

Conflicts:
	arch/arm/mm/cache-l2x0.c
	arch/arm/vfp/vfpmodule.c
	drivers/mmc/core/host.c
	kernel/power/wakelock.c
	net/bluetooth/hci_event.c

Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
2011-11-16 13:52:50 -08:00
Laura Abbott
e1b9ce5c22 gpu: ion: Return negative value from ioctl on allocation failure
If the ion allocation fails, return a negative value to the
ioctl. This is easier for userspace to deal with than
checking if the handle is valid.

Change-Id: I1c785b1b1e71d2bd45c6f7be78ea15e4a08cd6e5
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-11-16 07:22:40 -08:00
Laura Abbott
9fa29e8889 gpu: ion: Prevent deadlock with cache flushing
Cache flushing takes the mmap semaphore to validate the
address range. This can cause a deadlock in the following
scenario with two threads in the same client:

Thread 1			Thread 2
(cache operation)		(mmap)
-----------------------------------------
lock(client_lock)
				down_write(mmap_semaphore)
down_read(mmap_semaphore)
				lock(client_lock)

Fix this by doing the check for the address range before
taking the client lock. This is independent of Ion so there
is no need to have this lock locked.

Change-Id: Ibe372cf232fbad7e031ab2d38cf3a34823f43bf9
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-11-16 07:22:40 -08:00
Jordan Crouse
95b3327fb9 msm: kgsl: Set default value of wait_timeout in the adreno_dev struct
Set the initalization value of wait_timeout at compile time in the
declaration of the adreno_device struct instead of at runtime in
adreno_probe.

Change-Id: Ic0dedbad4161f3a0df8609999f03f8811ec08fde
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-11-15 09:26:47 -08:00
Stepan Moskovchenko
6ee3be86b4 msm: iommu: Support the IOMMU_CACHE attribute
Instead of specifying a shareability attribute and a cache
policy, add support for the IOMMU_CACHE attribute to allow
cacheable mappings using the default memory cache policy.

Change-Id: I78442770e4e64fd72d9314d343223757593d3529
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
2011-11-14 18:06:01 -08:00
Lucille Sylvester
dc8f757cac msm: kgsl: No need to expose internal functions.
Change-Id: I8cb98c96ad000d511915ac5c7ac5a57fe59f7556
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-11-10 21:06:00 -07:00
Lucille Sylvester
596d4c2954 msm: kgsl: Count a percentage of _io time
Count different percentages based upon GPU frequency.

Change-Id: Ia579f6705ff9858263f507bd4f3ba0f84b772554
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-11-09 14:13:15 -07:00
Suman Tatiraju
2456902682 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.

The change also disables NAP when the display is off.
It wakes 3d core to process user space requests when in
slumber

Change-Id: I65d17e937079a27b14d08be0a975d7ecf80b18ab
CRs-fixed: 316579
Signed-off-by: Suman Tatiraju <sumant@codeaurora.org>
2011-11-08 21:05:09 -07:00