summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/lima/lima_state.c
diff options
context:
space:
mode:
authorIcenowy Zheng <[email protected]>2019-04-11 15:24:59 +0800
committerQiang Yu <[email protected]>2019-04-11 13:45:51 +0000
commit318ccbe7b2616eae9e59c525868d5105be2db179 (patch)
treebfb9d0aa63a8c219c73f59256b2e72edfde274da /src/gallium/drivers/lima/lima_state.c
parent8d27bc351f6f043d628138891dfa7855d055c007 (diff)
lima: make lima_context_framebuffer subtype of pipe_framebuffer_state
Currently the lima driver saves the framebuffer state in its from-scratch struct lima_context_framebuffer. However, util_blitter requires to save framebuffer with standard struct pipe_framebuffer_state. Make the lima_context_framebuffer a subtype of the standard pipe_framebuffer_state, thus the standard part can be used for util_blitter framebuffer state saving. Signed-off-by: Icenowy Zheng <[email protected]> Reviewed-by: Qiang Yu <[email protected]>
Diffstat (limited to 'src/gallium/drivers/lima/lima_state.c')
-rw-r--r--src/gallium/drivers/lima/lima_state.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/gallium/drivers/lima/lima_state.c b/src/gallium/drivers/lima/lima_state.c
index b5598017acf..7985dacd407 100644
--- a/src/gallium/drivers/lima/lima_state.c
+++ b/src/gallium/drivers/lima/lima_state.c
@@ -45,14 +45,15 @@ lima_set_framebuffer_state(struct pipe_context *pctx,
struct lima_context_framebuffer *fb = &ctx->framebuffer;
- fb->samples = framebuffer->samples;
+ fb->base.samples = framebuffer->samples;
- pipe_surface_reference(&fb->cbuf, framebuffer->cbufs[0]);
- pipe_surface_reference(&fb->zsbuf, framebuffer->zsbuf);
+ fb->base.nr_cbufs = 1;
+ pipe_surface_reference(&fb->base.cbufs[0], framebuffer->cbufs[0]);
+ pipe_surface_reference(&fb->base.zsbuf, framebuffer->zsbuf);
/* need align here? */
- fb->width = framebuffer->width;
- fb->height = framebuffer->height;
+ fb->base.width = framebuffer->width;
+ fb->base.height = framebuffer->height;
int width = align(framebuffer->width, 16) >> 4;
int height = align(framebuffer->height, 16) >> 4;
@@ -509,6 +510,6 @@ lima_state_fini(struct lima_context *ctx)
util_set_vertex_buffers_mask(so->vb, &so->enabled_mask, NULL,
0, ARRAY_SIZE(so->vb));
- pipe_surface_reference(&ctx->framebuffer.cbuf, NULL);
- pipe_surface_reference(&ctx->framebuffer.zsbuf, NULL);
+ pipe_surface_reference(&ctx->framebuffer.base.cbufs[0], NULL);
+ pipe_surface_reference(&ctx->framebuffer.base.zsbuf, NULL);
}