diff options
author | Boris Brezillon <[email protected]> | 2019-08-02 19:18:42 +0200 |
---|---|---|
committer | Boris Brezillon <[email protected]> | 2019-08-02 21:54:58 +0200 |
commit | 17d6ee2bd14fa81c33b4024e0a18fb8cf1f0ce25 (patch) | |
tree | aa35a1d68c8d02427f8a7a0f55b5c125863ac55c /src/gallium/drivers/panfrost/pan_context.c | |
parent | b5ca1e545843375560378cea19be8e50eb152de8 (diff) |
panfrost: Delay FB descriptor allocation
No need to emit SFBD/MFBD at frame invalidation. They can be emitted
when the framebuffer is attached, which saves us a potential FB desc
re-allocation if a new FB is bound after the swap.
Signed-off-by: Boris Brezillon <[email protected]>
Reviewed-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost/pan_context.c')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_context.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index ba2df2ce66a..a88e6a4607d 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -189,13 +189,17 @@ panfrost_clear( static mali_ptr panfrost_attach_vt_mfbd(struct panfrost_context *ctx) { - return panfrost_upload_transient(ctx, &ctx->vt_framebuffer_mfbd, sizeof(ctx->vt_framebuffer_mfbd)) | MALI_MFBD; + struct bifrost_framebuffer mfbd = panfrost_emit_mfbd(ctx, ~0); + + return panfrost_upload_transient(ctx, &mfbd, sizeof(mfbd)) | MALI_MFBD; } static mali_ptr panfrost_attach_vt_sfbd(struct panfrost_context *ctx) { - return panfrost_upload_transient(ctx, &ctx->vt_framebuffer_sfbd, sizeof(ctx->vt_framebuffer_sfbd)) | MALI_SFBD; + struct mali_single_framebuffer sfbd = panfrost_emit_sfbd(ctx, ~0); + + return panfrost_upload_transient(ctx, &sfbd, sizeof(sfbd)) | MALI_SFBD; } static void @@ -223,13 +227,6 @@ panfrost_attach_vt_framebuffer(struct panfrost_context *ctx, bool skippable) static void panfrost_invalidate_frame(struct panfrost_context *ctx) { - struct panfrost_screen *screen = pan_screen(ctx->base.screen); - - if (screen->require_sfbd) - ctx->vt_framebuffer_sfbd = panfrost_emit_sfbd(ctx, ~0); - else - ctx->vt_framebuffer_mfbd = panfrost_emit_mfbd(ctx, ~0); - for (unsigned i = 0; i < PIPE_SHADER_TYPES; ++i) ctx->payloads[i].postfix.framebuffer = 0; @@ -2383,12 +2380,6 @@ panfrost_set_framebuffer_state(struct pipe_context *pctx, struct panfrost_screen *screen = pan_screen(ctx->base.screen); panfrost_hint_afbc(screen, &ctx->pipe_framebuffer); - - if (screen->require_sfbd) - ctx->vt_framebuffer_sfbd = panfrost_emit_sfbd(ctx, ~0); - else - ctx->vt_framebuffer_mfbd = panfrost_emit_mfbd(ctx, ~0); - panfrost_attach_vt_framebuffer(ctx, false); } |