[Mesa-dev] [PATCH 4/9] panfrost: Bail out early when new and current FB states are equal

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


R-b

On Fri, Aug 02, 2019 at 12:12:52PM +0200, Boris Brezillon wrote:
> If the current FB matches the new one there's nothing to be done in
> panfrost_set_framebuffer_state(). By bailing out early in that case we
> avoid emitting new FB descriptors (the old ones are still valid).
> 
> Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
> ---
>  src/gallium/drivers/panfrost/pan_context.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
> index b63023a16cda..d442ae1f2433 100644
> --- a/src/gallium/drivers/panfrost/pan_context.c
> +++ b/src/gallium/drivers/panfrost/pan_context.c
> @@ -2365,6 +2365,10 @@ panfrost_set_framebuffer_state(struct pipe_context *pctx,
>          bool is_scanout = panfrost_is_scanout(ctx);
>          bool has_draws = job->last_job.gpu;
>  
> +        /* Bail out early when the current and new states are the same. */
> +        if (util_framebuffer_state_equal(&ctx->pipe_framebuffer, fb))
> +                return;
> +
>          if (!ctx->wallpaper_batch && (!is_scanout || has_draws)) {
>                  panfrost_flush(pctx, NULL, PIPE_FLUSH_END_OF_FRAME);
>          }
> -- 
> 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/e0761868/attachment.sig>


More information about the mesa-dev mailing list