[Mesa-dev] [PATCH 2/5] radeonsi: don't runtime check gs table info

Dave Airlie airlied at gmail.com
Sun Apr 22 23:59:14 UTC 2018


From: Dave Airlie <airlied at redhat.com>

We can just unreachable here, this aligns with radv code, makes
it easier to move to common code.
---
 src/gallium/drivers/radeonsi/si_pipe.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index f2fdb984139..b3ef098b8ea 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -659,11 +659,11 @@ static void si_destroy_screen(struct pipe_screen* pscreen)
 	FREE(sscreen);
 }
 
-static bool si_init_gs_info(struct si_screen *sscreen)
+static void si_init_gs_info(struct si_screen *sscreen)
 {
 	/* gs_table_depth is not used by GFX9 */
 	if (sscreen->info.chip_class >= GFX9)
-		return true;
+		return;
 
 	switch (sscreen->info.family) {
 	case CHIP_OLAND:
@@ -675,7 +675,7 @@ static bool si_init_gs_info(struct si_screen *sscreen)
 	case CHIP_CARRIZO:
 	case CHIP_STONEY:
 		sscreen->gs_table_depth = 16;
-		return true;
+		return;
 	case CHIP_TAHITI:
 	case CHIP_PITCAIRN:
 	case CHIP_VERDE:
@@ -688,9 +688,9 @@ static bool si_init_gs_info(struct si_screen *sscreen)
 	case CHIP_POLARIS12:
 	case CHIP_VEGAM:
 		sscreen->gs_table_depth = 32;
-		return true;
+		return;
 	default:
-		return false;
+		unreachable("unknown GPU");
 	}
 }
 
@@ -853,8 +853,8 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws,
 	(void) mtx_init(&sscreen->aux_context_lock, mtx_plain);
 	(void) mtx_init(&sscreen->gpu_load_mutex, mtx_plain);
 
-	if (!si_init_gs_info(sscreen) ||
-	    !si_init_shader_cache(sscreen)) {
+	si_init_gs_info(sscreen);
+	if (!si_init_shader_cache(sscreen)) {
 		FREE(sscreen);
 		return NULL;
 	}
-- 
2.14.3



More information about the mesa-dev mailing list