summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/etnaviv
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2018-11-14 15:11:07 +0100
committerLucas Stach <l.stach@pengutronix.de>2018-12-18 19:07:10 +0100
commita3e592e839db7b484ee1e524d3ea5579f76c4b66 (patch)
tree796d6859efd5ced44d99c16360ddc1a7429be93a /src/gallium/drivers/etnaviv
parent7a90886921eb1d5d73b40aadd6fd3f340041bd26 (diff)
etnaviv: use surface format directly
There is no need to do the detour over the resource behind the surface to get the format. Use the surface format directly. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'src/gallium/drivers/etnaviv')
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_blend.c4
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_context.c9
2 files changed, 4 insertions, 9 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_blend.c b/src/gallium/drivers/etnaviv/etnaviv_blend.c
index 9c23411d4ff..0e2299a50b3 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_blend.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_blend.c
@@ -117,7 +117,7 @@ etna_update_blend(struct etna_context *ctx)
uint32_t colormask;
if (pfb->cbufs[0] &&
- translate_rs_format_rb_swap(pfb->cbufs[0]->texture->format)) {
+ translate_rs_format_rb_swap(pfb->cbufs[0]->format)) {
colormask = rt0->colormask & (PIPE_MASK_A | PIPE_MASK_G);
if (rt0->colormask & PIPE_MASK_R)
colormask |= PIPE_MASK_B;
@@ -158,7 +158,7 @@ etna_update_blend_color(struct etna_context *ctx)
struct compiled_blend_color *cs = &ctx->blend_color;
if (pfb->cbufs[0] &&
- translate_rs_format_rb_swap(pfb->cbufs[0]->texture->format)) {
+ translate_rs_format_rb_swap(pfb->cbufs[0]->format)) {
cs->PE_ALPHA_BLEND_COLOR =
VIVS_PE_ALPHA_BLEND_COLOR_R(etna_cfloat_to_uint8(cs->color[2])) |
VIVS_PE_ALPHA_BLEND_COLOR_G(etna_cfloat_to_uint8(cs->color[1])) |
diff --git a/src/gallium/drivers/etnaviv/etnaviv_context.c b/src/gallium/drivers/etnaviv/etnaviv_context.c
index 1c305d82a0f..aa742566289 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_context.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_context.c
@@ -212,13 +212,8 @@ etna_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
ctx->dirty |= ETNA_DIRTY_INDEX_BUFFER;
struct etna_shader_key key = {};
- struct etna_surface *cbuf = etna_surface(pfb->cbufs[0]);
-
- if (cbuf) {
- struct etna_resource *res = etna_resource(cbuf->base.texture);
-
- key.frag_rb_swap = !!translate_rs_format_rb_swap(res->base.format);
- }
+ if (pfb->cbufs[0])
+ key.frag_rb_swap = !!translate_rs_format_rb_swap(pfb->cbufs[0]->format);
if (!etna_get_vs(ctx, key) || !etna_get_fs(ctx, key)) {
BUG("compiled shaders are not okay");