summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/etnaviv/etnaviv_buffer.c
Commit message (Collapse)AuthorAgeFilesLines
* drm/etnaviv: add 'sync point' supportChristian Gmeiner2017-10-101-0/+36
| | | | | | | | | | | | | | | | | | In order to support performance counters in a sane way we need to provide a method to sync the GPU with the CPU. The GPU can process multpile command buffers/events per irq. With the help of a 'sync point' we can trigger an event and stop the GPU/FE immediately. When the CPU is done with is processing it simply needs to restart the FE and the GPU will process the command stream. Changes from v1 -> v2: - process sync point with a work item to keep irq as fast as possible Changes from v4 -> v5: - renamed pmrs_* to sync_point_* - call event_free(..) in sync_point_worker(..) Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* drm/etnaviv: wire up iova handling in new cmdbuf abstractionLucas Stach2017-02-021-6/+7
| | | | | | | Don't call the IOMMU directly, but go through the new cmdbuf abstraction. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
* drm/etnaviv: move cmdbuf de-/allocation into own fileLucas Stach2017-02-021-0/+1
| | | | | | | | This will get more complex with the following changes, so move it into its own place. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
* drm/etnaviv: ensure write caches are flushed at end of user cmdstreamLucas Stach2016-10-101-5/+19
| | | | | | | | | | | | If the GPU is done with one user command stream the buffers referenced by this command stream may go away and get unmapped from the MMU. If the write caches are still dirty at this point later evictions will run into MMU faults, killing the GPU. Make sure the write caches are flushed before signaling completion of the user command stream. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* drm/etnaviv: add flushing logic for MMUv2Lucas Stach2016-09-151-8/+23
| | | | | | | | | Flushing works differently on MMUv2, in that it's only necessary to set a single bit in the control register to flush all translation units. A semaphore stall then makes sure that the flush has propagated properly. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* drm/etnaviv: add function to construct MMUv2 init bufferLucas Stach2016-09-151-0/+34
| | | | | | | | | | | | Both the safe/scratch address and the master TLB address are per pipe with the CPU mapped registers not properly propagating to the different translation units. The only way to correctly configure all translation units is to have a command stream snipped executed by the FE, before any other execution can start. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* drm/etnaviv: move gpu_va() to etnaviv mmuLucas Stach2016-09-151-10/+6Star
| | | | | | | | The GPU virtual address for the command buffers differs depending on the IOMMU version. Move the calculation of the iova into etnaviv mmu, to enable proper dispatch. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* drm: etnaviv: improve readability of command insertion to ring bufferRussell King2016-03-071-46/+49
| | | | | | | | | | | | | | | Improve the readibility of the function which inserts command buffers and other maintanence commands into the GPUs ring buffer. We do this by splitting the ring buffer reservation in two: one chunk for any commands that need to be issued prior to the command buffer, and a separate chunk for commands issued after the buffer. The result is a much more obvious code flow in this function, and localisation of the conditional maintanence commands prior to the command buffer. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* drm: etnaviv: clean up GPU command submissionRussell King2016-03-071-8/+9
| | | | | | | | Clean up the GPU command submission path to prepare for the next change. This makes the next change easier to read and understand. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* drm: etnaviv: use previous GPU pipe state when pipe switchingRussell King2016-03-071-6/+7
| | | | | | | | | | Use the previous GPU pipe state when deciding which GPU caches should be flushed prior to switching the current pipe. This avoids infering what the previously selected pipe was, and potentially flushing the wrong caches. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* drm: etnaviv: flush all GPU caches when stopping GPURussell King2016-03-071-5/+36
| | | | | | | | Flush the GPU caches to ensure that any dirty data is pushed out before stopping the front end. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* drm: etnaviv: track current execution stateRussell King2016-03-071-0/+1
| | | | | | | Add tracking of the current execution state (iow, active GPU pipe). Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* drm: etnaviv: extract arming of semaphoreRussell King2016-03-071-6/+8
| | | | | | | Extract out the arming of a semaphore from the pipe select code. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* drm: etnaviv: extract replacement of WAIT commandRussell King2016-03-071-9/+23
| | | | | | | Extract out the replacement of the WAIT command with some other command. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* drm: etnaviv: extract command ring reservationRussell King2016-03-071-8/+14
| | | | | | | | | Provide a helper etnaviv_buffer_reserve() to ensure that we can fit a set of commands into the ring buffer without wrapping by moving code out of etnaviv_buffer_queue(). Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* drm/etnaviv: add initial etnaviv DRM driverThe etnaviv authors2015-12-151-0/+268
This adds the etnaviv DRM driver and hooks it up in Makefiles and Kconfig. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>