From 2b87cb01b2bfd445631169393a046d4c5acbeca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Ondra=C4=8Dka?= Date: Mon, 23 Feb 2026 14:12:16 +0100 Subject: [PATCH] r300: add shared HyperZ pipe-count helper Introduce r300_hyperz_pipe_count and use it in\nr300_setup_hyperz_properties.\n\nRV530 selects pipe topology from NUM_Z_PIPES, while other families use\nNUM_GB_PIPES. Keeping this in one helper avoids duplicated family checks\nand prepares follow-up HiZ clear sizing changes to reuse the same rule. (cherry picked from commit e97ac38ff3b8bb8bbd10b3e44e3bbaf44b45bbd3) Part-of: --- .pick_status.json | 2 +- src/gallium/drivers/r300/r300_screen.h | 8 ++++++++ src/gallium/drivers/r300/r300_texture_desc.c | 6 +----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index ee8a5a6d5f5..e76267f3a7c 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -664,7 +664,7 @@ "description": "r300: add shared HyperZ pipe-count helper", "nominated": false, "nomination_type": 0, - "resolution": 4, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h index fc7996af580..f17b9e3ee33 100644 --- a/src/gallium/drivers/r300/r300_screen.h +++ b/src/gallium/drivers/r300/r300_screen.h @@ -53,6 +53,14 @@ radeon_winsys(struct pipe_screen *screen) { return r300_screen(screen)->rws; } +static inline unsigned +r300_hyperz_pipe_count(const struct r300_screen *screen) +{ + if (screen->caps.family == CHIP_RV530) + return screen->info.r300_num_z_pipes; + return screen->info.r300_num_gb_pipes; +} + /* Debug functionality. */ /** diff --git a/src/gallium/drivers/r300/r300_texture_desc.c b/src/gallium/drivers/r300/r300_texture_desc.c index 58b3f8a0f99..bec95837950 100644 --- a/src/gallium/drivers/r300/r300_texture_desc.c +++ b/src/gallium/drivers/r300/r300_texture_desc.c @@ -366,11 +366,7 @@ static void r300_setup_hyperz_properties(struct r300_screen *screen, tex->tex.microtile) { unsigned i, pipes; - if (screen->caps.family == CHIP_RV530) { - pipes = screen->info.r300_num_z_pipes; - } else { - pipes = screen->info.r300_num_gb_pipes; - } + pipes = r300_hyperz_pipe_count(screen); for (i = 0; i <= tex->b.last_level; i++) { unsigned zcomp_numdw, zcompsize, hiz_numdw, stride, height;