winsys/radeon: drop support for kernels lacking tile mode array queries
authorMarek Olšák <marek.olsak@amd.com>
Thu, 28 Apr 2016 13:05:29 +0000 (15:05 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 2 May 2016 20:49:25 +0000 (22:49 +0200)
This will allow us to simplify a lot of code around tiling.

Kernel 3.10 is required for SI support.
Kernel 3.13 is required for CIK support.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/winsys/radeon/drm/radeon_drm_winsys.c

index 2d9ec8cee0939d9c7f41d5c6f58171da7657ce31..702d0733bfaec756fffa12fbea26fc2b40d96d9b 100644 (file)
@@ -504,14 +504,22 @@ static boolean do_winsys_init(struct radeon_drm_winsys *ws)
         return FALSE;
     }
 
-    if (radeon_get_drm_value(ws->fd, RADEON_INFO_SI_TILE_MODE_ARRAY, NULL,
-                             ws->info.si_tile_mode_array)) {
-        ws->info.si_tile_mode_array_valid = TRUE;
+    if (ws->info.chip_class == CIK) {
+        if (!radeon_get_drm_value(ws->fd, RADEON_INFO_CIK_MACROTILE_MODE_ARRAY, NULL,
+                                  ws->info.cik_macrotile_mode_array)) {
+            fprintf(stderr, "radeon: Kernel 3.13 is required for CIK support.\n");
+            return FALSE;
+        }
+        ws->info.cik_macrotile_mode_array_valid = TRUE;
     }
 
-    if (radeon_get_drm_value(ws->fd, RADEON_INFO_CIK_MACROTILE_MODE_ARRAY, NULL,
-                             ws->info.cik_macrotile_mode_array)) {
-        ws->info.cik_macrotile_mode_array_valid = TRUE;
+    if (ws->info.chip_class >= SI) {
+        if (!radeon_get_drm_value(ws->fd, RADEON_INFO_SI_TILE_MODE_ARRAY, NULL,
+                                  ws->info.si_tile_mode_array)) {
+            fprintf(stderr, "radeon: Kernel 3.10 is required for SI support.\n");
+            return FALSE;
+        }
+        ws->info.si_tile_mode_array_valid = TRUE;
     }
 
     /* Hawaii with old firmware needs type2 nop packet.