From e44a4bae52f8d835bd7d4b740cb688f59d03cced Mon Sep 17 00:00:00 2001 From: Vasily Khoruzhick Date: Tue, 7 May 2019 19:03:34 -0700 Subject: [PATCH] lima: fix tile buffer reloading Buffer needs to be reloaded every time unless explicit clear() was called. Fixes rendering issues with wayland compositors. Reviewed-by: Qiang Yu Signed-off-by: Vasily Khoruzhick --- src/gallium/drivers/lima/lima_draw.c | 4 ++-- src/gallium/drivers/lima/lima_resource.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/lima/lima_draw.c b/src/gallium/drivers/lima/lima_draw.c index e0a1e18..99b2675 100644 --- a/src/gallium/drivers/lima/lima_draw.c +++ b/src/gallium/drivers/lima/lima_draw.c @@ -1675,9 +1675,9 @@ _lima_flush(struct lima_context *ctx, bool end_of_frame) ctx->plb_index = (ctx->plb_index + 1) % lima_ctx_num_plb; if (ctx->framebuffer.base.nr_cbufs) { - /* this surface may need reload when next draw if not end of frame */ + /* Set reload flag for next draw. It'll be unset if buffer is cleared */ struct lima_surface *surf = lima_surface(ctx->framebuffer.base.cbufs[0]); - surf->reload = !end_of_frame; + surf->reload = true; } } diff --git a/src/gallium/drivers/lima/lima_resource.c b/src/gallium/drivers/lima/lima_resource.c index 4e215e9..0aefb2c 100644 --- a/src/gallium/drivers/lima/lima_resource.c +++ b/src/gallium/drivers/lima/lima_resource.c @@ -382,6 +382,8 @@ lima_surface_create(struct pipe_context *pctx, surf->tiled_w = align(psurf->width, 16) >> 4; surf->tiled_h = align(psurf->height, 16) >> 4; + surf->reload = true; + struct lima_context *ctx = lima_context(pctx); if (ctx->plb_pp_stream) { struct lima_ctx_plb_pp_stream_key key = { -- 2.7.4