diff --git a/src/gallium/drivers/etnaviv/etnaviv_blend.c b/src/gallium/drivers/etnaviv/etnaviv_blend.c index b10e929ef1b..5b14e9c4dec 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_blend.c +++ b/src/gallium/drivers/etnaviv/etnaviv_blend.c @@ -115,7 +115,7 @@ etna_blend_state_create(struct pipe_context *pctx, bool etna_update_blend(struct etna_context *ctx) { - struct pipe_framebuffer_state *pfb = &ctx->framebuffer_s; + struct pipe_framebuffer_state *pfb = &ctx->framebuffer_s.base; struct pipe_blend_state *pblend = ctx->blend; struct etna_blend_state *blend = etna_blend_state(pblend); unsigned current_rt = 0; diff --git a/src/gallium/drivers/etnaviv/etnaviv_blt.c b/src/gallium/drivers/etnaviv/etnaviv_blt.c index e06fbb40907..87f9c4c5184 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_blt.c +++ b/src/gallium/drivers/etnaviv/etnaviv_blt.c @@ -397,7 +397,7 @@ etna_blit_clear_color_blt(struct pipe_context *pctx, unsigned idx, unsigned clear_mask) { struct etna_context *ctx = etna_context(pctx); - struct pipe_surface *dst = &ctx->framebuffer_s.cbufs[idx]; + struct pipe_surface *dst = &ctx->framebuffer_s.base.cbufs[idx]; struct etna_resource *dst_res = etna_resource_get_render_compatible(pctx, dst->texture); struct etna_resource_level *dst_level = &dst_res->levels[dst->level]; uint64_t new_clear_value = etna_clear_blit_pack_rgba(dst->format, color); @@ -605,8 +605,8 @@ etna_clear_blt(struct pipe_context *pctx, unsigned buffers, etna_set_state(ctx->stream, VIVS_TS_FLUSH_CACHE, VIVS_TS_FLUSH_CACHE_FLUSH); if (buffers & PIPE_CLEAR_COLOR) { - for (int idx = 0; idx < ctx->framebuffer_s.nr_cbufs; ++idx) { - struct pipe_surface *psurf = &ctx->framebuffer_s.cbufs[idx]; + for (int idx = 0; idx < ctx->framebuffer_s.base.nr_cbufs; ++idx) { + struct pipe_surface *psurf = &ctx->framebuffer_s.base.cbufs[idx]; if (!psurf->texture) continue; @@ -622,8 +622,8 @@ etna_clear_blt(struct pipe_context *pctx, unsigned buffers, } } - if ((buffers & PIPE_CLEAR_DEPTHSTENCIL) && ctx->framebuffer_s.zsbuf.texture != NULL) - etna_blit_clear_zs_blt(pctx, &ctx->framebuffer_s.zsbuf, buffers, depth, stencil, scissor_state, stencil_clear_mask); + if ((buffers & PIPE_CLEAR_DEPTHSTENCIL) && ctx->framebuffer_s.base.zsbuf.texture != NULL) + etna_blit_clear_zs_blt(pctx, &ctx->framebuffer_s.base.zsbuf, buffers, depth, stencil, scissor_state, stencil_clear_mask); etna_stall(ctx->stream, SYNC_RECIPIENT_RA, SYNC_RECIPIENT_BLT); diff --git a/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c b/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c index 7fb17e53c14..1019059dab9 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c +++ b/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c @@ -64,7 +64,7 @@ etna_blit_save_state(struct etna_context *ctx, bool render_cond) util_blitter_save_depth_stencil_alpha(ctx->blitter, ctx->zsa); util_blitter_save_stencil_ref(ctx->blitter, &ctx->stencil_ref_s); util_blitter_save_sample_mask(ctx->blitter, ctx->sample_mask, 0); - util_blitter_save_framebuffer(ctx->blitter, &ctx->framebuffer_s); + util_blitter_save_framebuffer(ctx->blitter, &ctx->framebuffer_s.base); util_blitter_save_fragment_sampler_states(ctx->blitter, ctx->num_fragment_samplers, (void **)ctx->sampler); util_blitter_save_fragment_sampler_views(ctx->blitter, diff --git a/src/gallium/drivers/etnaviv/etnaviv_context.c b/src/gallium/drivers/etnaviv/etnaviv_context.c index a96ea998516..195220c9e35 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_context.c +++ b/src/gallium/drivers/etnaviv/etnaviv_context.c @@ -117,7 +117,7 @@ etna_context_destroy(struct pipe_context *pctx) if (ctx->flush_resources) _mesa_set_destroy(ctx->flush_resources, NULL); - util_copy_framebuffer_state(&ctx->framebuffer_s, NULL); + util_copy_framebuffer_state(&ctx->framebuffer_s.base, NULL); if (ctx->blitter) util_blitter_destroy(ctx->blitter); @@ -344,7 +344,7 @@ etna_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info, struct etna_context *ctx = etna_context(pctx); struct etna_screen *screen = ctx->screen; - struct pipe_framebuffer_state *pfb = &ctx->framebuffer_s; + struct pipe_framebuffer_state *pfb = &ctx->framebuffer_s.base; uint32_t draw_mode; unsigned i; diff --git a/src/gallium/drivers/etnaviv/etnaviv_context.h b/src/gallium/drivers/etnaviv/etnaviv_context.h index 0fe64896daa..ea6b5cb0e69 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_context.h +++ b/src/gallium/drivers/etnaviv/etnaviv_context.h @@ -137,6 +137,10 @@ struct etna_shader_uniform_info { uint32_t count; }; +struct etna_framebuffer_state { + struct pipe_framebuffer_state base; +}; + struct etna_context { struct pipe_context base; @@ -212,7 +216,7 @@ struct etna_context { struct etna_shader_state shader; /* saved parameter-like state. these are mainly kept around for the blitter */ - struct pipe_framebuffer_state framebuffer_s; + struct etna_framebuffer_state framebuffer_s; struct pipe_stencil_ref stencil_ref_s; struct pipe_viewport_state viewport_s; struct pipe_scissor_state scissor; diff --git a/src/gallium/drivers/etnaviv/etnaviv_rs.c b/src/gallium/drivers/etnaviv/etnaviv_rs.c index e5f0d6e5a99..11dd03b918a 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_rs.c +++ b/src/gallium/drivers/etnaviv/etnaviv_rs.c @@ -363,7 +363,7 @@ etna_blit_clear_color_rs(struct pipe_context *pctx, unsigned idx, const union pipe_color_union *color, bool use_ts) { struct etna_context *ctx = etna_context(pctx); - struct pipe_surface *dst = &ctx->framebuffer_s.cbufs[idx]; + struct pipe_surface *dst = &ctx->framebuffer_s.base.cbufs[idx]; struct etna_resource *dst_res = etna_resource_get_render_compatible(pctx, dst->texture); struct etna_resource_level *dst_level = &dst_res->levels[dst->level]; uint64_t new_clear_value = etna_clear_blit_pack_rgba(dst->format, color); @@ -502,8 +502,8 @@ etna_clear_rs(struct pipe_context *pctx, unsigned buffers, * color and depth, otherwise it can result in crashes */ bool need_ts_flush = false; if (buffers & PIPE_CLEAR_COLOR) { - for (int idx = 0; idx < ctx->framebuffer_s.nr_cbufs; ++idx) { - struct pipe_surface *psurf = &ctx->framebuffer_s.cbufs[idx]; + for (int idx = 0; idx < ctx->framebuffer_s.base.nr_cbufs; ++idx) { + struct pipe_surface *psurf = &ctx->framebuffer_s.base.cbufs[idx]; if (!psurf->texture) continue; @@ -515,8 +515,8 @@ etna_clear_rs(struct pipe_context *pctx, unsigned buffers, need_ts_flush = true; } } - if ((buffers & PIPE_CLEAR_DEPTHSTENCIL) && ctx->framebuffer_s.zsbuf.texture != NULL) { - struct pipe_surface *psurf = &ctx->framebuffer_s.zsbuf; + if ((buffers & PIPE_CLEAR_DEPTHSTENCIL) && ctx->framebuffer_s.base.zsbuf.texture != NULL) { + struct pipe_surface *psurf = &ctx->framebuffer_s.base.zsbuf; if (etna_resource_get_render_compatible(pctx, psurf->texture)->levels[psurf->level].ts_size) need_ts_flush = true; @@ -529,10 +529,10 @@ etna_clear_rs(struct pipe_context *pctx, unsigned buffers, * resolve and copy) do not require the TS state. */ if (buffers & PIPE_CLEAR_COLOR) { - const bool use_ts = etna_use_ts_for_mrt(ctx->screen, &ctx->framebuffer_s); + const bool use_ts = etna_use_ts_for_mrt(ctx->screen, &ctx->framebuffer_s.base); - for (int idx = 0; idx < ctx->framebuffer_s.nr_cbufs; ++idx) { - struct pipe_surface *psurf = &ctx->framebuffer_s.cbufs[idx]; + for (int idx = 0; idx < ctx->framebuffer_s.base.nr_cbufs; ++idx) { + struct pipe_surface *psurf = &ctx->framebuffer_s.base.cbufs[idx]; if (!psurf->texture) continue; @@ -554,8 +554,8 @@ etna_clear_rs(struct pipe_context *pctx, unsigned buffers, VIVS_GL_FLUSH_CACHE_COLOR | VIVS_GL_FLUSH_CACHE_DEPTH); if ((buffers & PIPE_CLEAR_DEPTHSTENCIL) && - ctx->framebuffer_s.zsbuf.texture != NULL) - etna_blit_clear_zs_rs(pctx, &ctx->framebuffer_s.zsbuf, buffers, depth, stencil); + ctx->framebuffer_s.base.zsbuf.texture != NULL) + etna_blit_clear_zs_rs(pctx, &ctx->framebuffer_s.base.zsbuf, buffers, depth, stencil); etna_stall(ctx->stream, SYNC_RECIPIENT_RA, SYNC_RECIPIENT_PE); } diff --git a/src/gallium/drivers/etnaviv/etnaviv_state.c b/src/gallium/drivers/etnaviv/etnaviv_state.c index 0f6e376cc4a..ac2e8b71610 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_state.c +++ b/src/gallium/drivers/etnaviv/etnaviv_state.c @@ -457,7 +457,7 @@ etna_set_framebuffer_state(struct pipe_context *pctx, cs->PE_LOGIC_OP = pe_logic_op; /* keep copy of original structure */ - util_copy_framebuffer_state(&ctx->framebuffer_s, fb); + util_copy_framebuffer_state(&ctx->framebuffer_s.base, fb); ctx->dirty |= ETNA_DIRTY_FRAMEBUFFER | ETNA_DIRTY_DERIVE_TS; } @@ -795,7 +795,7 @@ etna_set_stream_output_targets(struct pipe_context *pctx, static bool etna_update_ts_config(struct etna_context *ctx) { - const struct pipe_framebuffer_state *fb = &ctx->framebuffer_s; + const struct pipe_framebuffer_state *fb = &ctx->framebuffer_s.base; bool dirty = ctx->dirty & ETNA_DIRTY_FRAMEBUFFER; unsigned rt = 0; @@ -846,7 +846,7 @@ etna_update_ts_config(struct etna_context *ctx) } /* Update the ts config for depth fast clear. */ - if (ctx->framebuffer_s.zsbuf.texture) { + if (ctx->framebuffer_s.base.zsbuf.texture) { struct etna_resource *res = etna_resource_get_render_compatible(&ctx->base, fb->zsbuf.texture); struct etna_resource_level *level = &res->levels[fb->zsbuf.level]; uint32_t ts_config = ctx->framebuffer.TS_MEM_CONFIG; @@ -874,7 +874,7 @@ static bool etna_update_clipping(struct etna_context *ctx) { const struct etna_rasterizer_state *rasterizer = etna_rasterizer_state(ctx->rasterizer); - const struct pipe_framebuffer_state *fb = &ctx->framebuffer_s; + const struct pipe_framebuffer_state *fb = &ctx->framebuffer_s.base; if (!VIV_FEATURE(ctx->screen, ETNA_FEATURE_HWTFB) && ctx->rasterizer->rasterizer_discard) { @@ -911,7 +911,7 @@ etna_update_clipping(struct etna_context *ctx) static bool etna_update_zsa(struct etna_context *ctx) { - struct pipe_framebuffer_state *fb = &ctx->framebuffer_s; + struct pipe_framebuffer_state *fb = &ctx->framebuffer_s.base; struct compiled_shader_state *shader_state = &ctx->shader_state; struct pipe_depth_stencil_alpha_state *zsa_state = ctx->zsa; struct etna_zsa_state *zsa = etna_zsa_state(zsa_state); @@ -1008,7 +1008,7 @@ etna_update_zsa(struct etna_context *ctx) static bool etna_record_flush_resources(struct etna_context *ctx) { - struct pipe_framebuffer_state *fb = &ctx->framebuffer_s; + struct pipe_framebuffer_state *fb = &ctx->framebuffer_s.base; for (unsigned i = 0; i < fb->nr_cbufs; i++) { if (!fb->cbufs[i].texture)