From 331f963b7e34e292300fb17f86310c76be07d644 Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Mon, 15 Feb 2016 08:54:30 +1100 Subject: nv50,nvc0: Remove duplicate logic from nvc0_set_framebuffer_state() We already have this logic in the gallium/util functions so lets reduce some entropy while here. V.2: Apply change to nv50 also as suggested by Samuel Pitoiset. Signed-off-by: Edward O'Callaghan Reviewed-by: Ilia Mirkin Reviewed-by: Samuel Pitoiset --- src/gallium/drivers/nouveau/nv50/nv50_state.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/gallium/drivers/nouveau/nv50/nv50_state.c') diff --git a/src/gallium/drivers/nouveau/nv50/nv50_state.c b/src/gallium/drivers/nouveau/nv50/nv50_state.c index cb040439139..438f41385f0 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_state.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_state.c @@ -21,6 +21,7 @@ */ #include "pipe/p_defines.h" +#include "util/u_framebuffer.h" #include "util/u_helpers.h" #include "util/u_inlines.h" #include "util/u_transfer.h" @@ -936,21 +937,10 @@ nv50_set_framebuffer_state(struct pipe_context *pipe, const struct pipe_framebuffer_state *fb) { struct nv50_context *nv50 = nv50_context(pipe); - unsigned i; nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_FB); - for (i = 0; i < fb->nr_cbufs; ++i) - pipe_surface_reference(&nv50->framebuffer.cbufs[i], fb->cbufs[i]); - for (; i < nv50->framebuffer.nr_cbufs; ++i) - pipe_surface_reference(&nv50->framebuffer.cbufs[i], NULL); - - nv50->framebuffer.nr_cbufs = fb->nr_cbufs; - - nv50->framebuffer.width = fb->width; - nv50->framebuffer.height = fb->height; - - pipe_surface_reference(&nv50->framebuffer.zsbuf, fb->zsbuf); + util_copy_framebuffer_state(&nv50->framebuffer, fb); nv50->dirty |= NV50_NEW_FRAMEBUFFER; } -- cgit v1.2.3