lima: use util_copy_framebuffer_state
authorQiang Yu <yuq825@gmail.com>
Fri, 7 Feb 2020 03:12:09 +0000 (11:12 +0800)
committerMarge Bot <eric+marge@anholt.net>
Mon, 17 Feb 2020 02:54:15 +0000 (02:54 +0000)
Use this helper to replace self written code.

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3755>

src/gallium/drivers/lima/lima_state.c

index 2e759654612c160bcafc1e5d30f992fd255eb694..2c0800288158e4c010884acf7cfb4e06fc01df18 100644 (file)
@@ -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;