From 20984aab0f6717f5fbf79fc21c2c5f442472b605 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 6 Nov 2022 22:07:36 +0100 Subject: [PATCH] etnaviv: Use old set of state registers for PE configuration on GC880 While the GC880 is HALTI0, it still uses the old set of state registers for PE pipe configuration. This is another specialty of the GC880, readd the missing handling for this GPU otherwise e.g. Qt5 cube example suffers from rendering corruption with both eglfs and wayland backends. Fixes: 7c46a488362 ("etnaviv: use new PE pipe address states on >= HALTI0") Reviewed-by: Christian Gmeiner Reviewed-by: Lucas Stach Signed-off-by: Marek Vasut Part-of: --- src/gallium/drivers/etnaviv/etnaviv_emit.c | 4 ++-- src/gallium/drivers/etnaviv/etnaviv_state.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_emit.c b/src/gallium/drivers/etnaviv/etnaviv_emit.c index 84f86975584..ccb2b8c8fa1 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_emit.c +++ b/src/gallium/drivers/etnaviv/etnaviv_emit.c @@ -440,7 +440,7 @@ etna_emit_state(struct etna_context *ctx) if (unlikely(dirty & (ETNA_DIRTY_FRAMEBUFFER))) { /*0140C*/ EMIT_STATE(PE_DEPTH_NORMALIZE, ctx->framebuffer.PE_DEPTH_NORMALIZE); - if (screen->specs.halti < 0) { + if (screen->specs.halti < 0 || screen->model == 0x880) { /*01410*/ EMIT_STATE_RELOC(PE_DEPTH_ADDR, &ctx->framebuffer.PE_DEPTH_ADDR); } @@ -477,7 +477,7 @@ etna_emit_state(struct etna_context *ctx) /*0142C*/ EMIT_STATE(PE_COLOR_FORMAT, val); } if (unlikely(dirty & (ETNA_DIRTY_FRAMEBUFFER))) { - if (screen->specs.halti >= 0) { + if (screen->specs.halti >= 0 && screen->model != 0x880) { /*01434*/ EMIT_STATE(PE_COLOR_STRIDE, ctx->framebuffer.PE_COLOR_STRIDE); /*01454*/ EMIT_STATE(PE_HDEPTH_CONTROL, ctx->framebuffer.PE_HDEPTH_CONTROL); /*01460*/ EMIT_STATE_RELOC(PE_PIPE_COLOR_ADDR(0), &ctx->framebuffer.PE_PIPE_COLOR_ADDR[0]); diff --git a/src/gallium/drivers/etnaviv/etnaviv_state.c b/src/gallium/drivers/etnaviv/etnaviv_state.c index c02c06e329b..750509673d7 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_state.c +++ b/src/gallium/drivers/etnaviv/etnaviv_state.c @@ -190,7 +190,7 @@ etna_set_framebuffer_state(struct pipe_context *pctx, cbuf->surf.offset, cbuf->surf.stride * 4); } - if (screen->specs.halti >= 0) { + if (screen->specs.halti >= 0 && screen->model != 0x880) { /* Rendertargets on GPUs with more than a single pixel pipe must always * be multi-tiled, or single-buffer mode must be supported */ assert(screen->specs.pixel_pipes == 1 || @@ -273,7 +273,7 @@ etna_set_framebuffer_state(struct pipe_context *pctx, /* VIVS_PE_DEPTH_CONFIG_ONLY_DEPTH */ /* merged with depth_stencil_alpha */ - if (screen->specs.halti >= 0) { + if (screen->specs.halti >= 0 && screen->model != 0x880) { for (int i = 0; i < screen->specs.pixel_pipes; i++) { cs->PE_PIPE_DEPTH_ADDR[i] = zsbuf->reloc[i]; cs->PE_PIPE_DEPTH_ADDR[i].flags = ETNA_RELOC_READ | ETNA_RELOC_WRITE;