From 74e3535b3c78ebcd56e991c11f642e012e7c408e 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: (cherry picked from commit 20984aab0f6717f5fbf79fc21c2c5f442472b605) --- .pick_status.json | 2 +- src/gallium/drivers/etnaviv/etnaviv_emit.c | 4 ++-- src/gallium/drivers/etnaviv/etnaviv_state.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 6e70ca0bcd2..25b87b81608 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -382,7 +382,7 @@ "description": "etnaviv: Use old set of state registers for PE configuration on GC880", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "7c46a4883625a20691a78170f8da783dc9b8a9c6" }, 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 6bc836459eb..947486c65d2 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_state.c +++ b/src/gallium/drivers/etnaviv/etnaviv_state.c @@ -186,7 +186,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 || @@ -271,7 +271,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;