intel/l3: Allow platforms to have no l3 configurations
authorJordan Justen <jordan.l.justen@intel.com>
Mon, 8 Jun 2020 10:19:08 +0000 (03:19 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Mon, 22 Jun 2020 18:41:59 +0000 (11:41 -0700)
On some gen12 platforms we will use the L3FullWayAllocationEnable and
never reconfigure the L3 setup.

Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4956>

src/intel/common/gen_l3_config.c

index 328aa5bebda4a0d4fcaf1cb36774343d444dffc6..6bfcb6ba7d7faf8d00ab8f6271a50b1980128e9c 100644 (file)
@@ -294,10 +294,15 @@ gen_get_default_l3_config(const struct gen_device_info *devinfo)
     * default configuration.
     */
    const struct gen_l3_list *const list = get_l3_list(devinfo);
-   const struct gen_l3_config *const cfg = &list->configs[0];
-   assert(cfg == gen_get_l3_config(devinfo,
-                    gen_get_default_l3_weights(devinfo, false, false)));
-   return cfg;
+   assert(list->length > 0 || devinfo->gen >= 12);
+   if (list->length > 0) {
+      const struct gen_l3_config *const cfg = &list->configs[0];
+      assert(cfg == gen_get_l3_config(devinfo,
+                       gen_get_default_l3_weights(devinfo, false, false)));
+      return cfg;
+   } else {
+      return NULL;
+   }
 }
 
 /**
@@ -323,6 +328,7 @@ gen_get_l3_config(const struct gen_device_info *devinfo,
       }
    }
 
+   assert(cfg_best || devinfo->gen >= 12);
    return cfg_best;
 }