[Mesa-dev] [PATCH 3/9] panfrost: Delay FB descriptor allocation

Alyssa Rosenzweig alyssa.rosenzweig at collabora.com
Fri Aug 2 15:01:24 UTC 2019


R-b, thank you :)

On Fri, Aug 02, 2019 at 12:12:51PM +0200, Boris Brezillon wrote:
> 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 <boris.brezillon at collabora.com>
> ---
>  src/gallium/drivers/panfrost/pan_context.c | 21 ++++++---------------
>  src/gallium/drivers/panfrost/pan_context.h |  3 ---
>  2 files changed, 6 insertions(+), 18 deletions(-)
> 
> diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
> index 014f8f6a9d07..b63023a16cda 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;
>  
> @@ -2378,12 +2375,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);
>  }
>  
> diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h
> index a90dbb04e833..ac4b21678e65 100644
> --- a/src/gallium/drivers/panfrost/pan_context.h
> +++ b/src/gallium/drivers/panfrost/pan_context.h
> @@ -137,9 +137,6 @@ struct panfrost_context {
>  
>          union mali_attr attributes[PIPE_MAX_ATTRIBS];
>  
> -        struct mali_single_framebuffer vt_framebuffer_sfbd;
> -        struct bifrost_framebuffer vt_framebuffer_mfbd;
> -
>          /* TODO: Multiple uniform buffers (index =/= 0), finer updates? */
>  
>          struct panfrost_constant_buffer constant_buffer[PIPE_SHADER_TYPES];
> -- 
> 2.21.0
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190802/20151984/attachment.sig>


More information about the mesa-dev mailing list