winsys/amdgpu: add an assertion to cik_get_num_tile_pipes (v2)
authorMarek Olšák <marek.olsak@amd.com>
Sat, 30 Jan 2016 00:44:26 +0000 (01:44 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 5 Feb 2016 16:28:18 +0000 (17:28 +0100)
v2: print an error to stderr

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c

index d1ba259be9a08ee5983cea76ed36e688fef55259..2c4de75f8be7b0d222c244724d13c66cf515c262 100644 (file)
@@ -68,7 +68,6 @@ static unsigned cik_get_num_tile_pipes(struct amdgpu_gpu_info *info)
 
    switch (CIK__GB_TILE_MODE__PIPE_CONFIG(mode2d)) {
    case CIK__PIPE_CONFIG__ADDR_SURF_P2:
-   default:
        return 2;
    case CIK__PIPE_CONFIG__ADDR_SURF_P4_8x16:
    case CIK__PIPE_CONFIG__ADDR_SURF_P4_16x16:
@@ -86,6 +85,10 @@ static unsigned cik_get_num_tile_pipes(struct amdgpu_gpu_info *info)
    case CIK__PIPE_CONFIG__ADDR_SURF_P16_32X32_8X16:
    case CIK__PIPE_CONFIG__ADDR_SURF_P16_32X32_16X16:
        return 16;
+   default:
+       fprintf(stderr, "Invalid CIK pipe configuration, assuming P2\n");
+       assert(!"this should never occur");
+       return 2;
    }
 }