mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-21 01:10:44 +02:00
freedreno: add fd_context_batch() accessor
For cases in which (after the following commit) ctx->batch may be null. Prep work for following commit. Signed-off-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:
parent
a45e1802db
commit
a122118c14
8 changed files with 21 additions and 10 deletions
|
|
@ -117,7 +117,8 @@ time_elapsed_enable(struct fd_context *ctx, struct fd_ringbuffer *ring)
|
|||
* just hard coded. If we start exposing more countables than we
|
||||
* have counters, we will need to be more clever.
|
||||
*/
|
||||
fd_wfi(ctx->batch, ring);
|
||||
struct fd_batch *batch = fd_context_batch(ctx);
|
||||
fd_wfi(batch, ring);
|
||||
OUT_PKT0(ring, REG_A4XX_CP_PERFCTR_CP_SEL_0, 1);
|
||||
OUT_RING(ring, CP_ALWAYS_COUNT);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,10 +144,11 @@ bc_flush(struct fd_batch_cache *cache, struct fd_context *ctx, bool deferred)
|
|||
}
|
||||
|
||||
if (deferred) {
|
||||
struct fd_batch *current_batch = ctx->batch;
|
||||
struct fd_batch *current_batch = fd_context_batch(ctx);
|
||||
|
||||
for (unsigned i = 0; i < n; i++) {
|
||||
if (batches[i] != current_batch) {
|
||||
if (batches[i] && (batches[i]->ctx == ctx) &&
|
||||
(batches[i] != current_batch)) {
|
||||
fd_batch_add_dep(current_batch, batches[i]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,9 @@ fd_context_flush(struct pipe_context *pctx, struct pipe_fence_handle **fencep,
|
|||
|
||||
DBG("%p: flush: flags=%x\n", ctx->batch, flags);
|
||||
|
||||
if (!ctx->batch)
|
||||
return;
|
||||
|
||||
/* Take a ref to the batch's fence (batch can be unref'd when flushed: */
|
||||
fd_fence_ref(pctx->screen, &fence, ctx->batch->fence);
|
||||
|
||||
|
|
|
|||
|
|
@ -428,6 +428,12 @@ fd_supported_prim(struct fd_context *ctx, unsigned prim)
|
|||
return (1 << prim) & ctx->primtype_mask;
|
||||
}
|
||||
|
||||
static inline struct fd_batch *
|
||||
fd_context_batch(struct fd_context *ctx)
|
||||
{
|
||||
return ctx->batch;
|
||||
}
|
||||
|
||||
static inline void
|
||||
fd_batch_set_stage(struct fd_batch *batch, enum fd_render_stage stage)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ static void
|
|||
fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
|
||||
{
|
||||
struct fd_context *ctx = fd_context(pctx);
|
||||
struct fd_batch *batch = ctx->batch;
|
||||
struct fd_batch *batch = fd_context_batch(ctx);
|
||||
struct pipe_framebuffer_state *pfb = &batch->framebuffer;
|
||||
struct pipe_scissor_state *scissor = fd_context_get_scissor(ctx);
|
||||
unsigned i, prims, buffers = 0, restore_buffers = 0;
|
||||
|
|
@ -346,7 +346,7 @@ fd_clear(struct pipe_context *pctx, unsigned buffers,
|
|||
const union pipe_color_union *color, double depth, unsigned stencil)
|
||||
{
|
||||
struct fd_context *ctx = fd_context(pctx);
|
||||
struct fd_batch *batch = ctx->batch;
|
||||
struct fd_batch *batch = fd_context_batch(ctx);
|
||||
struct pipe_framebuffer_state *pfb = &batch->framebuffer;
|
||||
struct pipe_scissor_state *scissor = fd_context_get_scissor(ctx);
|
||||
unsigned cleared_buffers;
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ void fd_fence_server_sync(struct pipe_context *pctx,
|
|||
struct pipe_fence_handle *fence)
|
||||
{
|
||||
struct fd_context *ctx = fd_context(pctx);
|
||||
struct fd_batch *batch = ctx->batch;
|
||||
struct fd_batch *batch = fd_context_batch(ctx);
|
||||
|
||||
fence_flush(fence);
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ realloc_query_bo(struct fd_context *ctx, struct fd_acc_query *aq)
|
|||
static boolean
|
||||
fd_acc_begin_query(struct fd_context *ctx, struct fd_query *q)
|
||||
{
|
||||
struct fd_batch *batch = ctx->batch;
|
||||
struct fd_batch *batch = fd_context_batch(ctx);
|
||||
struct fd_acc_query *aq = fd_acc_query(q);
|
||||
const struct fd_acc_sample_provider *p = aq->provider;
|
||||
|
||||
|
|
@ -100,7 +100,7 @@ fd_acc_begin_query(struct fd_context *ctx, struct fd_query *q)
|
|||
static void
|
||||
fd_acc_end_query(struct fd_context *ctx, struct fd_query *q)
|
||||
{
|
||||
struct fd_batch *batch = ctx->batch;
|
||||
struct fd_batch *batch = fd_context_batch(ctx);
|
||||
struct fd_acc_query *aq = fd_acc_query(q);
|
||||
const struct fd_acc_sample_provider *p = aq->provider;
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ fd_hw_destroy_query(struct fd_context *ctx, struct fd_query *q)
|
|||
static boolean
|
||||
fd_hw_begin_query(struct fd_context *ctx, struct fd_query *q)
|
||||
{
|
||||
struct fd_batch *batch = ctx->batch;
|
||||
struct fd_batch *batch = fd_context_batch(ctx);
|
||||
struct fd_hw_query *hq = fd_hw_query(q);
|
||||
|
||||
DBG("%p: active=%d", q, q->active);
|
||||
|
|
@ -158,7 +158,7 @@ fd_hw_begin_query(struct fd_context *ctx, struct fd_query *q)
|
|||
static void
|
||||
fd_hw_end_query(struct fd_context *ctx, struct fd_query *q)
|
||||
{
|
||||
struct fd_batch *batch = ctx->batch;
|
||||
struct fd_batch *batch = fd_context_batch(ctx);
|
||||
struct fd_hw_query *hq = fd_hw_query(q);
|
||||
|
||||
DBG("%p: active=%d", q, q->active);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue