isl/state: Refactor the per-gen isl_to_gen_h/valign tables
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 3 Jun 2016 02:00:10 +0000 (19:00 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 22 Jun 2016 19:26:43 +0000 (12:26 -0700)
This moves the #if's around so that halign and valign have different sets
of #if conditions.  This also prepares us for SNB because isl_to_gen_halign
is not defined at all on gen6.

Reviewed-by: Chad Versace <chad.versace@intel.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
src/intel/isl/isl_surface_state.c

index 49baec9..745fea8 100644 (file)
@@ -47,18 +47,20 @@ static const uint8_t isl_to_gen_halign[] = {
     [8] = HALIGN8,
     [16] = HALIGN16,
 };
+#elif GEN_GEN >= 7
+static const uint8_t isl_to_gen_halign[] = {
+    [4] = HALIGN_4,
+    [8] = HALIGN_8,
+};
+#endif
 
+#if GEN_GEN >= 8
 static const uint8_t isl_to_gen_valign[] = {
     [4] = VALIGN4,
     [8] = VALIGN8,
     [16] = VALIGN16,
 };
-#else
-static const uint8_t isl_to_gen_halign[] = {
-    [4] = HALIGN_4,
-    [8] = HALIGN_8,
-};
-
+#elif GEN_GEN >= 6
 static const uint8_t isl_to_gen_valign[] = {
     [2] = VALIGN_2,
     [4] = VALIGN_4,