freedreno: drop unused fd_fence_ref param
authorRob Clark <robdclark@chromium.org>
Tue, 30 Jul 2019 15:12:46 +0000 (08:12 -0700)
committerRob Clark <robdclark@chromium.org>
Fri, 2 Aug 2019 17:24:14 +0000 (10:24 -0700)
The pscreen param was just there to satisfy pipe_screen::fence_reference

But some of the internal uses passed NULL for screen.  Which is a bit
ugly.  Instead drop the param and add a shim function to plug into the
screen.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/gallium/drivers/freedreno/a6xx/fd6_blitter.c
src/gallium/drivers/freedreno/freedreno_batch.c
src/gallium/drivers/freedreno/freedreno_blitter.c
src/gallium/drivers/freedreno/freedreno_context.c
src/gallium/drivers/freedreno/freedreno_draw.c
src/gallium/drivers/freedreno/freedreno_fence.c
src/gallium/drivers/freedreno/freedreno_fence.h
src/gallium/drivers/freedreno/freedreno_screen.c

index f8fdc33ec724396f5f7397913d2158ee84d4e8f0..51725c4aa75a780a189ce713bcacc13b43011685 100644 (file)
@@ -663,7 +663,7 @@ handle_rgba_blit(struct fd_context *ctx, const struct pipe_blit_info *info)
        if (!can_do_blit(info))
                return false;
 
-       fd_fence_ref(ctx->base.screen, &ctx->last_fence, NULL);
+       fd_fence_ref(&ctx->last_fence, NULL);
 
        batch = fd_bc_alloc_batch(&ctx->screen->batch_cache, ctx, true);
 
index 61b5496efa5c6f0354094783cd1be6f86f2c2d77..35a88dfe1e243a6e49752a8522aba0740828bb21 100644 (file)
@@ -139,7 +139,7 @@ batch_fini(struct fd_batch *batch)
        /* in case batch wasn't flushed but fence was created: */
        fd_fence_populate(batch->fence, 0, -1);
 
-       fd_fence_ref(NULL, &batch->fence, NULL);
+       fd_fence_ref(&batch->fence, NULL);
 
        fd_ringbuffer_del(batch->draw);
        if (!batch->nondraw) {
index 5938a88ae061bb02b154f6a7bacc0c7c17f54edf..86bfda42310e2f659c594d09c0222b5349c679d2 100644 (file)
@@ -80,7 +80,7 @@ static void
 fd_blitter_pipe_begin(struct fd_context *ctx, bool render_cond, bool discard,
                enum fd_render_stage stage)
 {
-       fd_fence_ref(ctx->base.screen, &ctx->last_fence, NULL);
+       fd_fence_ref(&ctx->last_fence, NULL);
 
        util_blitter_save_fragment_constant_buffer_slot(ctx->blitter,
                        ctx->constbuf[PIPE_SHADER_FRAGMENT].cb);
index ad03ac30fb849ed0dfae5d550df3745a2b747ab3..b2ac396d9d110547d001a6fecc4f0fd22d6f22e1 100644 (file)
@@ -53,7 +53,7 @@ fd_context_flush(struct pipe_context *pctx, struct pipe_fence_handle **fencep,
         * a fence, re-use the last one:
         */
        if (ctx->last_fence) {
-               fd_fence_ref(pctx->screen, &fence, ctx->last_fence);
+               fd_fence_ref(&fence, ctx->last_fence);
                goto out;
        }
 
@@ -61,7 +61,7 @@ fd_context_flush(struct pipe_context *pctx, struct pipe_fence_handle **fencep,
                return;
 
        /* Take a ref to the batch's fence (batch can be unref'd when flushed: */
-       fd_fence_ref(pctx->screen, &fence, batch->fence);
+       fd_fence_ref(&fence, batch->fence);
 
        /* TODO is it worth trying to figure out if app is using fence-fd's, to
         * avoid requesting one every batch?
@@ -78,11 +78,11 @@ fd_context_flush(struct pipe_context *pctx, struct pipe_fence_handle **fencep,
 
 out:
        if (fencep)
-               fd_fence_ref(pctx->screen, fencep, fence);
+               fd_fence_ref(fencep, fence);
 
-       fd_fence_ref(pctx->screen, &ctx->last_fence, fence);
+       fd_fence_ref(&ctx->last_fence, fence);
 
-       fd_fence_ref(pctx->screen, &fence, NULL);
+       fd_fence_ref(&fence, NULL);
 }
 
 static void
@@ -162,7 +162,7 @@ fd_context_destroy(struct pipe_context *pctx)
 
        DBG("");
 
-       fd_fence_ref(pctx->screen, &ctx->last_fence, NULL);
+       fd_fence_ref(&ctx->last_fence, NULL);
 
        if (ctx->screen->reorder && util_queue_is_initialized(&ctx->flush_queue))
                util_queue_destroy(&ctx->flush_queue);
index 2bb19d37d4e21a8bcdc6e759618c6eacd64e0fbe..059de2ec8c612dcf9f1165bd4adc834f3b5a73a7 100644 (file)
@@ -93,7 +93,7 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
                return;
        }
 
-       fd_fence_ref(pctx->screen, &ctx->last_fence, NULL);
+       fd_fence_ref(&ctx->last_fence, NULL);
 
        /* Upload a user index buffer. */
        struct pipe_resource *indexbuf = NULL;
@@ -311,7 +311,7 @@ fd_clear(struct pipe_context *pctx, unsigned buffers,
        if (!fd_render_condition_check(pctx))
                return;
 
-       fd_fence_ref(pctx->screen, &ctx->last_fence, NULL);
+       fd_fence_ref(&ctx->last_fence, NULL);
 
        if (ctx->in_blit) {
                fd_batch_reset(batch);
index be104dc8978d9c146601dfc59abe3493d2bc0eea..9d49f10ed94e444d4a27e2bbe2277396a140e0ab 100644 (file)
@@ -70,8 +70,7 @@ static void fd_fence_destroy(struct pipe_fence_handle *fence)
        FREE(fence);
 }
 
-void fd_fence_ref(struct pipe_screen *pscreen,
-               struct pipe_fence_handle **ptr,
+void fd_fence_ref(struct pipe_fence_handle **ptr,
                struct pipe_fence_handle *pfence)
 {
        if (pipe_reference(&(*ptr)->reference, &pfence->reference))
index 425c19067603c9b181e6901279f14219d2782351..f0bc21bc890bc47556410c2c12ce329851ae597d 100644 (file)
 
 void fd_fence_populate(struct pipe_fence_handle *fence,
                uint32_t timestamp, int fence_fd);
-void fd_fence_ref(struct pipe_screen *pscreen,
-               struct pipe_fence_handle **ptr,
+void fd_fence_ref(struct pipe_fence_handle **ptr,
                struct pipe_fence_handle *pfence);
-bool fd_fence_finish(struct pipe_screen *screen,
+bool fd_fence_finish(struct pipe_screen *pscreen,
                struct pipe_context *ctx,
                struct pipe_fence_handle *pfence,
                uint64_t timeout);
index e9cd34aa3844efae9d52cbd8adee059e7fb1212c..b1c53707501f532587bc90594dbed77953b92ab2 100644 (file)
@@ -750,6 +750,13 @@ fd_screen_bo_from_handle(struct pipe_screen *pscreen,
        return bo;
 }
 
+static void _fd_fence_ref(struct pipe_screen *pscreen,
+               struct pipe_fence_handle **ptr,
+               struct pipe_fence_handle *pfence)
+{
+       fd_fence_ref(ptr, pfence);
+}
+
 struct pipe_screen *
 fd_screen_create(struct fd_device *dev, struct renderonly *ro)
 {
@@ -936,7 +943,7 @@ fd_screen_create(struct fd_device *dev, struct renderonly *ro)
 
        pscreen->get_timestamp = fd_screen_get_timestamp;
 
-       pscreen->fence_reference = fd_fence_ref;
+       pscreen->fence_reference = _fd_fence_ref;
        pscreen->fence_finish = fd_fence_finish;
        pscreen->fence_get_fd = fd_fence_get_fd;