Commit Graph

5163 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
Lucille Sylvester
67138c98a9 msm: kgsl: Allow userspace processes to turn off/on power features.
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>
2011-12-08 12:04:05 -07: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
Jesse Barnes
49b3e19e80 drm/i915: always set FDI composite sync bit
commit c4f9c4c2b3f1831e932e04db992cf6fe92c2a95a upstream.

It's needed for 3 pipe support as well as just regular functionality
(e.g. DisplayPort).

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-by: Adam Jackson <ajax@redhat.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Robert Hooker <robert.hooker@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 09:10:07 -08:00
Jesse Barnes
e01b0328fa drm/i915: fix IVB cursor support
commit 65a21cd65316145f9302594be8e69074369e1050 upstream.

The cursor regs have moved around, add the offsets and new macros for
getting at them.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Robert Hooker <robert.hooker@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 09:10:07 -08:00
Adam Jackson
6e99164ee3 drm/i915/pch: Save/restore PCH_PORT_HOTPLUG across suspend
commit cda2bb78c24de7674eafa3210314dc75bed344a6 upstream.

At least on a Lenovo X220 the HPD bits of this are enabled at boot but
cleared after resume, which means plug interrupts stop working.

This also happens to fix DP displays re-lighting on resume.  I'm quite
certain that's an accident: the first DP link train inevitably fails on
that machine, and it's only serendipity that we're getting multiple plug
interrupts and the second train works.  But I shall take my victories
where I get them.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Tested-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Cc: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 09:09:53 -08: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
Jesse Barnes
987ccebc15 drm/i915: enable ring freq scaling, RC6 and graphics turbo on Ivy Bridge v3
commit 1c70c0cebd1295a42fec75045b8a6b4419cedef3 upstream.

They use the same register interfaces, so we can simply enable the
existing code on IVB.

v2:
  - resolve conflict with ring freq scaling, we can enable it too
v3:
  - resolve conflict again, this time on drm-intel-next

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Robert Hooker <robert.hooker@canonical.com>
Acked-by: Leann Ogasawara <leann.ogasawara@canonical.com>
Acked-by: Herton Krzesinski <herton.krzesinski@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-21 14:31:20 -08:00
Alex Deucher
f73870d6d3 drm/radeon/kms: make an aux failure debug only
commit 091264f0bc12419560ac64fcef4567809d611658 upstream.

Can happen when there is no DP panel attached, confusing
users.  Make it debug only.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-21 14:31:16 -08:00
Marcin Slusarz
53b6b123d4 drm/nouveau: initialize chan->fence.lock before use
commit 5e60ee780e792efe6dce97eceb110b1d30bab850 upstream.

Fence lock needs to be initialized before any call to nouveau_channel_put
because it calls nouveau_channel_idle->nouveau_fence_update which uses
fence lock.

BUG: spinlock bad magic on CPU#0, test/24134
 lock: ffff88019f90dba8, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
Pid: 24134, comm: test Not tainted 3.0.0-nv+ #800
Call Trace:
 spin_bug+0x9c/0xa3
 do_raw_spin_lock+0x29/0x13c
 _raw_spin_lock+0x1e/0x22
 nouveau_fence_update+0x2d/0xf1
 nouveau_channel_idle+0x22/0xa0
 nouveau_channel_put_unlocked+0x84/0x1bd
 nouveau_channel_put+0x20/0x24
 nouveau_channel_alloc+0x4ec/0x585
 nouveau_ioctl_fifo_alloc+0x50/0x130
 drm_ioctl+0x289/0x361
 do_vfs_ioctl+0x4dd/0x52c
 sys_ioctl+0x42/0x65
 system_call_fastpath+0x16/0x1b

It's easily triggerable from userspace.

Additionally remove double initialization of chan->fence.pending.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-21 14:31:16 -08:00
Eric Anholt
1db61fd340 drm/i915: Fix object refcount leak on mmappable size limit error path.
commit 14660ccd599dc7bd6ecef17408bd76dc853f9b77 upstream.

I've been seeing memory leaks on my system in the form of large
(300-400MB) GEM objects created by now-dead processes laying around
clogging up memory.  I usually notice when it gets to about 1.2GB of
them.  Hopefully this clears up the issue, but I just found this bug
by inspection.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-21 14:31:15 -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