From 3c4ff27250710a2f4880d0e527b86a4b39adeb1b Mon Sep 17 00:00:00 2001 From: Qiang Yu Date: Fri, 7 Feb 2020 11:12:09 +0800 Subject: [PATCH] lima: use util_copy_framebuffer_state Use this helper to replace self written code. Reviewed-by: Vasily Khoruzhick Signed-off-by: Qiang Yu Part-of: --- src/gallium/drivers/lima/lima_state.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/gallium/drivers/lima/lima_state.c b/src/gallium/drivers/lima/lima_state.c index 2e759654612..2c080028815 100644 --- a/src/gallium/drivers/lima/lima_state.c +++ b/src/gallium/drivers/lima/lima_state.c @@ -27,6 +27,7 @@ #include "util/u_inlines.h" #include "util/u_helpers.h" #include "util/u_debug.h" +#include "util/u_framebuffer.h" #include "pipe/p_state.h" @@ -45,15 +46,7 @@ lima_set_framebuffer_state(struct pipe_context *pctx, struct lima_context_framebuffer *fb = &ctx->framebuffer; - fb->base.samples = framebuffer->samples; - - fb->base.nr_cbufs = framebuffer->nr_cbufs; - pipe_surface_reference(&fb->base.cbufs[0], framebuffer->cbufs[0]); - pipe_surface_reference(&fb->base.zsbuf, framebuffer->zsbuf); - - /* need align here? */ - fb->base.width = framebuffer->width; - fb->base.height = framebuffer->height; + util_copy_framebuffer_state(&fb->base, framebuffer); int width = align(framebuffer->width, 16) >> 4; int height = align(framebuffer->height, 16) >> 4; -- 2.30.2