Don't enable the profiling IBs if a valid context isn't passed
to adreno_ringbuffer_addcmds.
CRs-fixed: 522827
Change-Id: Ic0dedbad504e3dee05de0a0a2f19d47c1b7f8b2a
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
When device start fails, device is in INIT state and FT is triggered.
In FT we trigger snapshot which waits on ft_gate when active count is
0 and device is not in active state. This causes a deadlock. This
change does not wait for FT gate in FT state and thereby prevents
the deadlock.
CRs-Fixed: 526206
Change-Id: Id9e0a7c3f3f9367d0b3cc17e45fbba4b42bebf64
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Currently long IB is detected per GPU command, this mainly
detects infinate shaders, this policy is changed to trigger
long IB per submission. If any submission to GPU takes more
than 2 seconds of GPU time, trigger a long IB and mark the
context bad.
Change-Id: Ic6e9a677bd1e42444d38d2a859a58721345958f5
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Currenlty FT log level is init in debugfs init, debugfs
could be removed from commercial software and we might
miss FT logs, initializing FT log level in device init
prevents this.
Change-Id: If6ea02735dd250ecb7579cc0b485145dddb1b6d6
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Device log levels should be initialized during device initialization,
removing this from debugfs init because customer could disable
debugfs.
Change-Id: Ie1222be1d421405e0d7481c799045cb9876c2a91
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
On some targets (A330v2) the hardware is in a wonky state following
a power collapse. Send a special command buffer before the first
submission to put everything back in place.
Change-Id: Ic0dedbadb8e676677b9db95defd53f7bd3fba338
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
When zeroing buffers, we need to make sure the zeroed data actually
gets written back to RAM. Otherwise, it may be possible for a buffer
to be reallocated with data still needing to be written back to RAM.
This may lead to corruption from userspace allocators expecting zero'd
buffers and a potential leak of kernel data to user space. Considering
the mapping is short lived and we need to write back the data, use a
writecombine mapping to write the data directly to ram and avoid the
cost of flushing the cache. If the mapping is cached, invalidate the
kernel side mappings as well.
Change-Id: I26a49908bde411469f3b8f143a1581fb4e2c3b56
CRs-Fixed: 520044
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Any call of kgsl_ioctl_timestamp_event wakes up gpu. In some cases
(like retired timestamp) it's not necessary. Wake up gpu only if it's
necessary.
Signed-off-by: Vladimir Razgulin <vrazguli@codeaurora.org>
Change-Id: I845faf6e9c6e4c9882a68489b64223919be3d21c
Run soft reset on all targets that define a soft_reset function hook.
If the target defines jump table offsets then we can run through a
faster reset sequence, otherwise default to the slower full reset
path. In any event, both these options are much faster than the
hard reset path that toggles the regulators.
Change-Id: Ic0dedbad4cbfdc083f16b026e133159814481886
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Check for idle in the fault detection timer. Don't report a fault
if the GPU is idle.
Change-Id: Ic0dedbad0a912b2d4b3cda9f545a9301290904d6
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Instead of playing silly tricks to try to avoid going into an
infinite loop while processing pending contexts do the smart
thing and copy off the entire pending queue into a temporary
list. That leaves the master list free to accept new and
requeued contexts and we can do evil things to our temporary
list.
Change-Id: Ic0dedbad365206031854fc95b5353184cabd40a1
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
It is useful to track context switches since they are expensive
and we would like to have as few as possible.
Change-Id: Ic0dedbad6befc84193b17851a9db4ff87e656cc7
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Print the callback function symbol name in GPU event register
and fire trace events. This makes it easier to debug which event
is being registered/fired.
Change-Id: Ic0dedbad4be4e4179c820af6119786c57d12e13f
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
For server side sync the KGSL kernel module needs to perform
an asynchronous wait for a fence object prior to issuing
subsequent commands.
Change-Id: I1ee614aa3af84afc4813f1e47007f741beb3bc92
Signed-off-by: Jeff Boody <jboody@codeaurora.org>
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Add an new ioctl entry point for submitting commands to the GPU
called IOCTL_KGSL_SUBMIT_COMMANDS.
As with IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS the user passes a list of
indirect buffers, flags and optionally a user specified timestamp. The
old way of passing a list of indirect buffers is no longer supported.
IOCTL_KGSL_SUBMIT_COMMANDS also allows the user to define a
list of sync points for the command. Sync points are dependencies
on events that need to be satisfied before the command will be issued
to the hardware. Events are designed to be flexible. To start with
the only events that are supported are GPU events for a given context/
timestamp pair.
Pending events are stored in a list in the command batch. As each event is
expired it is deleted from the list. The adreno dispatcher won't send the
command until the list is empty. Sync points are not supported for Z180.
CRs-Fixed: 468770
Change-Id: Ic0dedbad5a5935f486acaeb033ae9a6010f82346
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Keep track of the global timestamp every time the event code runs.
If the timestamp hasn't changed then we are caught up and we can
politely bow out. This avoids the situation where multiple
interrupts queue the work queue multiple times:
IRQ
-> process events
IRQ
IRQ
-> process events
The actual retired timestamp in the first work item might be well
ahead of the delivered interrupts. The event loop will end up
processing every event that has been retired by the hardware
at that point. If the work item gets re-queued by a subesquent
interrupt then we might have already addressed all the pending
timestamps.
Change-Id: Ic0dedbad79722654cb17e82b7149e93d3c3f86a0
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Implement the KGSL fault tolerance policy for faults in the dispatcher.
Replay (or skip) the inflight command batches as dictated by the policy,
iterating progressively through the various behaviors.
Change-Id: Ic0dedbade98cc3aa35b26813caf4265c74ccab56
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Implements a centralized dispatcher for sending user commands
to the ringbuffer. Incoming commands are queued by context and
sent to the hardware on a round robin basis ensuring each context
a small burst of commands at a time. Each command is tracked
throughout the pipeline giving the dispatcher better knowledge
of how the hardware is being used. This will be the basis for
future per-context and cross context enhancements as priority
queuing and server-side syncronization.
Change-Id: Ic0dedbad49a43e8e6096d1362829c800266c2de3
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>