Don't call the IOMMU directly, but go through the new cmdbuf abstraction.
Signed-off-by: Lucas Stach <[email protected]>
Reviewed-by: Christian Gmeiner <[email protected]>
This will get more complex with the following changes, so move it
into its own place.
Signed-off-by: Lucas Stach <[email protected]>
Reviewed-by: Christian Gmeiner <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Lucas Stach <[email protected]>
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 <[email protected]>
Signed-off-by: Lucas Stach <[email protected]>
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 <[email protected]>
Signed-off-by: Lucas Stach <[email protected]>
Flush the GPU caches to ensure that any dirty data is pushed out before
stopping the front end.
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Lucas Stach <[email protected]>
Add tracking of the current execution state (iow, active GPU pipe).
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Lucas Stach <[email protected]>
Extract out the arming of a semaphore from the pipe select code.
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Lucas Stach <[email protected]>
Extract out the replacement of the WAIT command with some other command.
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Lucas Stach <[email protected]>
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 <[email protected]>
Signed-off-by: Lucas Stach <[email protected]>