From f424ef18010751aae1e70ebda363ada0bed82bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 13 Mar 2024 17:24:28 -0400 Subject: [PATCH] r300: enable tiling for scanout to fix DRI3 performance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also don't use square tiling for scanout because the DDX doesn't use it either. Reviewed-off-by: Pavel Ondračka Part-of: --- src/gallium/drivers/r300/ci/r300-rv530-nohiz-fails.txt | 1 - src/gallium/drivers/r300/r300_texture.c | 4 ++-- src/gallium/drivers/r300/r300_texture_desc.c | 4 +++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/r300/ci/r300-rv530-nohiz-fails.txt b/src/gallium/drivers/r300/ci/r300-rv530-nohiz-fails.txt index d2ba3a10611..140e9702c41 100644 --- a/src/gallium/drivers/r300/ci/r300-rv530-nohiz-fails.txt +++ b/src/gallium/drivers/r300/ci/r300-rv530-nohiz-fails.txt @@ -374,7 +374,6 @@ spec@!opengl 1.0@depth-clear-precision-check@depth24,Fail spec@!opengl 1.0@depth-clear-precision-check@depth24_stencil8,Fail spec@!opengl 1.0@depth-clear-precision-check@depth32,Fail spec@!opengl 1.0@gl-1.0-blend-func,Fail -spec@!opengl 1.0@gl-1.0-drawbuffer-modes,Fail spec@!opengl 1.0@gl-1.0-edgeflag,Fail spec@!opengl 1.0@gl-1.0-edgeflag-quads,Fail spec@!opengl 1.0@gl-1.0-no-op-paths,Fail diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 5bdeca72af9..c4208c07b4b 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -1120,8 +1120,8 @@ struct pipe_resource *r300_texture_create(struct pipe_screen *screen, struct r300_screen *rscreen = r300_screen(screen); enum radeon_bo_layout microtile, macrotile; - if ((base->flags & R300_RESOURCE_FLAG_TRANSFER) || - (base->bind & (PIPE_BIND_SCANOUT | PIPE_BIND_LINEAR))) { + if (base->flags & R300_RESOURCE_FLAG_TRANSFER || + base->bind & PIPE_BIND_LINEAR) { microtile = RADEON_LAYOUT_LINEAR; macrotile = RADEON_LAYOUT_LINEAR; } else { diff --git a/src/gallium/drivers/r300/r300_texture_desc.c b/src/gallium/drivers/r300/r300_texture_desc.c index d8ebcad3a48..de430b5f47f 100644 --- a/src/gallium/drivers/r300/r300_texture_desc.c +++ b/src/gallium/drivers/r300/r300_texture_desc.c @@ -527,7 +527,9 @@ static void r300_setup_tiling(struct r300_screen *screen, break; case 2: - tex->tex.microtile = RADEON_LAYOUT_SQUARETILED; + tex->tex.microtile = + tex->b.bind & PIPE_BIND_SCANOUT ? + RADEON_LAYOUT_TILED : RADEON_LAYOUT_SQUARETILED; break; }