summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_batch.c
Commit message (Collapse)AuthorAgeFilesLines
* freedreno: defer flush_queue allocationRob Clark2016-07-301-0/+4
| | | | | | | Some apps, like warsow, create a bazillion contexts but don't render on most of them. Signed-off-by: Rob Clark <robdclark@gmail.com>
* freedreno: some lockingRob Clark2016-07-301-6/+24
| | | | Signed-off-by: Rob Clark <robdclark@gmail.com>
* freedreno: move needs_wfi into batchRob Clark2016-07-301-0/+2
| | | | | | | This is also used in gmem code, which executes from the "bottom half" (ie. from the flush_queue worker thread), so it cannot be in fd_context. Signed-off-by: Rob Clark <robdclark@gmail.com>
* freedreno: threaded batch flushRob Clark2016-07-301-7/+57
| | | | | | | | | | | | | | | With the state accessed from GMEM+submit factored out of fd_context and into fd_batch, now it is possible to punt this off to a helper thread. And more importantly, since there are cases where one context might force the batch-cache to flush another context's batches (ie. when there are too many in-flight batches), using a per-context helper thread keeps various different flushes for a given context serialized. TODO as with batch-cache, there are a few places where we'll need a mutex to protect critical sections, which is completely missing at the moment. Signed-off-by: Rob Clark <robdclark@gmail.com>
* freedreno: re-order support for hw queriesRob Clark2016-07-301-0/+13
| | | | | | | | | | | Push query state down to batch, and use the resource tracking to figure out which batch(es) need to be flushed to get the query result. This means we actually need to allocate the prsc up front, before we know the size. So we have to add a special way to allocate an un- backed resource, and then later allocate the backing storage. Signed-off-by: Rob Clark <robdclark@gmail.com>
* freedreno: add batch-cache and batch reorderingRob Clark2016-07-301-39/+204
| | | | | | | | | | | | Note that I originally also had a entry-point that would construct a key and do lookup from a pipe_surface. I ended up not needing that (yet?) but it is easy-enough to re-introduce later if we need it for the blit path. For now, not enabled by default, but can be enabled (on a3xx/a4xx) with FD_MESA_DEBUG=reorder. Signed-off-by: Rob Clark <robdclark@gmail.com>
* freedreno: move more batch related tracking to fd_batchRob Clark2016-07-301-1/+21
| | | | | | | | | | | | | | | | To flush batches out of order, the gmem code needs to not depend on state from fd_context (since that may apply to a more recent batch). So this all moves into batch. The one exception is the gmem/pipe/tile state itself. But this is only used from gmem code (and batches are flushed serially). The alternative would be having to re-calculate GMEM layout on every batch, even if the dimensions of the render targets are the same. Note: This opens up the possibility of pushing gmem/submit into a helper thread. Signed-off-by: Rob Clark <robdclark@gmail.com>
* freedreno: dynamically sized/growable cmd buffersRob Clark2016-07-301-10/+15
| | | | Signed-off-by: Rob Clark <robdclark@gmail.com>
* freedreno: push resource tracking down into batchRob Clark2016-07-301-0/+35
| | | | Signed-off-by: Rob Clark <robdclark@gmail.com>
* freedreno: introduce fd_batchRob Clark2016-07-301-0/+93
Introduce the batch object, to track a batch/submit's worth of ringbuffers and other bookkeeping. In this first step, just move the ringbuffers into batch, since that is mostly uninteresting churn. For now there is just a single batch at a time. Note that one outcome of this change is that rb's are allocated/freed on each use. But the expectation is that the bo pool in libdrm_freedreno will save us the GEM bo alloc/free which was the initial reason to implement a rb pool in gallium. The purpose of the batch is to eventually facilitate out-of-order rendering, with batches associated to framebuffer state, and tracking the dependencies on other batches. Signed-off-by: Rob Clark <robdclark@gmail.com>