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>
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>
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>
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>
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>
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>
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>
Add infrastructure to support mapping allocations
into iommus.
Change-Id: Ia5eafebee408e297013bf55284abf67d9eb8d78b
Signed-off-by: Laura Abbott <lauraa@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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Userspace clients pass fds around, not handles. Support flushing
via fd.
Change-Id: Ic22d9327e9fa72cb604c3010a2a6f798be8dfdb1
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
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>
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>
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>