Mesa (master): panfrost: Use ctx->wallpaper_batch in panfrost_blit_wallpaper()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Sep 13 15:51:37 UTC 2019


Module: Mesa
Branch: master
Commit: bc0f6c0b152a70a0092cd79dde1de3e5f93aa924
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bc0f6c0b152a70a0092cd79dde1de3e5f93aa924

Author: Boris Brezillon <boris.brezillon at collabora.com>
Date:   Thu Sep  5 18:52:21 2019 +0200

panfrost: Use ctx->wallpaper_batch in panfrost_blit_wallpaper()

We'll soon be able to flush a batch that's not currently bound to the
context, which means ctx->pipe_framebuffer will not necessarily be the
FBO targeted by the wallpaper draw. Let's prepare for this case and
use ctx->wallpaper_batch in panfrost_blit_wallpaper().

Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>

---

 src/gallium/drivers/panfrost/pan_blit.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_blit.c b/src/gallium/drivers/panfrost/pan_blit.c
index 4be8c044ee2..2d44f06227b 100644
--- a/src/gallium/drivers/panfrost/pan_blit.c
+++ b/src/gallium/drivers/panfrost/pan_blit.c
@@ -105,16 +105,17 @@ panfrost_blit(struct pipe_context *pipe,
 void
 panfrost_blit_wallpaper(struct panfrost_context *ctx, struct pipe_box *box)
 {
+        struct panfrost_batch *batch = ctx->wallpaper_batch;
         struct pipe_blit_info binfo = { };
 
         panfrost_blitter_save(ctx, ctx->blitter_wallpaper);
 
-        struct pipe_surface *surf = ctx->pipe_framebuffer.cbufs[0];
+        struct pipe_surface *surf = batch->key.cbufs[0];
         unsigned level = surf->u.tex.level;
         unsigned layer = surf->u.tex.first_layer;
         assert(surf->u.tex.last_layer == layer);
 
-        binfo.src.resource = binfo.dst.resource = ctx->pipe_framebuffer.cbufs[0]->texture;
+        binfo.src.resource = binfo.dst.resource = batch->key.cbufs[0]->texture;
         binfo.src.level = binfo.dst.level = level;
         binfo.src.box.x = binfo.dst.box.x = box->x;
         binfo.src.box.y = binfo.dst.box.y = box->y;
@@ -123,9 +124,9 @@ panfrost_blit_wallpaper(struct panfrost_context *ctx, struct pipe_box *box)
         binfo.src.box.height = binfo.dst.box.height = box->height;
         binfo.src.box.depth = binfo.dst.box.depth = 1;
 
-        binfo.src.format = binfo.dst.format = ctx->pipe_framebuffer.cbufs[0]->format;
+        binfo.src.format = binfo.dst.format = batch->key.cbufs[0]->format;
 
-        assert(ctx->pipe_framebuffer.nr_cbufs == 1);
+        assert(batch->key.nr_cbufs == 1);
         binfo.mask = PIPE_MASK_RGBA;
         binfo.filter = PIPE_TEX_FILTER_LINEAR;
         binfo.scissor_enable = FALSE;




More information about the mesa-commit mailing list