summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>2023-05-11 10:13:27 +0300
committerMarge Bot <emma+marge@anholt.net>2023-05-16 19:32:41 +0000
commitec4619a5e9ec7c7f9f4016b83a7305c3967be181 (patch)
treea57e58dc8924fdb89c807083170dc8bf64c1dab1
parent9ebd553fc216085e9a7ca1a28dc38030ed7e2071 (diff)
downloadmesa-ec4619a5e9ec7c7f9f4016b83a7305c3967be181.tar.gz
intel/devinfo: call intel_device_info_init_was only once
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8958 Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Mark Janes <markjanes@swizzler.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22862>
-rw-r--r--src/intel/dev/intel_device_info.c57
1 files changed, 32 insertions, 25 deletions
diff --git a/src/intel/dev/intel_device_info.c b/src/intel/dev/intel_device_info.c
index 0cc9bf5019c..9954ba81ec6 100644
--- a/src/intel/dev/intel_device_info.c
+++ b/src/intel/dev/intel_device_info.c
@@ -1268,9 +1268,9 @@ intel_device_info_update_cs_workgroup_threads(struct intel_device_info *devinfo)
MIN2(devinfo->max_cs_threads, 64);
}
-bool
-intel_get_device_info_from_pci_id(int pci_id,
- struct intel_device_info *devinfo)
+static bool
+intel_device_info_init_common(int pci_id,
+ struct intel_device_info *devinfo)
{
switch (pci_id) {
#undef CHIPSET
@@ -1356,14 +1356,37 @@ intel_get_device_info_from_pci_id(int pci_id,
}
intel_device_info_update_cs_workgroup_threads(devinfo);
- intel_device_info_init_was(devinfo);
+ return true;
+}
+
+static void
+intel_device_info_apply_workarounds(struct intel_device_info *devinfo)
+{
if (intel_needs_workaround(devinfo, 22012575642))
devinfo->urb.max_entries[MESA_SHADER_GEOMETRY] = 1536;
+ /* Fixes issues with:
+ * dEQP-GLES31.functional.geometry_shading.layered.render_with_default_layer_cubemap
+ * when running on ADL-N platform.
+ */
+ const uint32_t eu_total = intel_device_info_eu_total(devinfo);
+ if (devinfo->platform == INTEL_PLATFORM_ADL && eu_total < 32)
+ devinfo->urb.max_entries[MESA_SHADER_GEOMETRY] = 1024;
+}
+
+bool
+intel_get_device_info_from_pci_id(int pci_id,
+ struct intel_device_info *devinfo)
+{
+ intel_device_info_init_common(pci_id, devinfo);
+
/* This is a placeholder until a proper value is set. */
devinfo->kmd_type = INTEL_KMD_TYPE_I915;
+ intel_device_info_init_was(devinfo);
+ intel_device_info_apply_workarounds(devinfo);
+
return true;
}
@@ -1388,22 +1411,6 @@ intel_device_info_compute_system_memory(struct intel_device_info *devinfo, bool
}
static void
-fixup_adl_device_info(struct intel_device_info *devinfo)
-{
- assert(devinfo->platform == INTEL_PLATFORM_ADL);
- const uint32_t eu_total = intel_device_info_eu_total(devinfo);
-
- if (eu_total >= 32)
- return;
-
- /* Fixes issues with:
- * dEQP-GLES31.functional.geometry_shading.layered.render_with_default_layer_cubemap
- * when running on ADL-N platform.
- */
- devinfo->urb.max_entries[MESA_SHADER_GEOMETRY] = 1024;
-}
-
-static void
init_max_scratch_ids(struct intel_device_info *devinfo)
{
/* Determine the max number of subslices that potentially might be used in
@@ -1545,8 +1552,8 @@ intel_get_device_info_from_fd(int fd, struct intel_device_info *devinfo)
mesa_loge("Failed to query drm device.");
return false;
}
- if (!intel_get_device_info_from_pci_id
- (drmdev->deviceinfo.pci->device_id, devinfo)) {
+ if (!intel_device_info_init_common(
+ drmdev->deviceinfo.pci->device_id, devinfo)) {
drmFreeDevice(&drmdev);
return false;
}
@@ -1596,9 +1603,6 @@ intel_get_device_info_from_fd(int fd, struct intel_device_info *devinfo)
return false;
}
- if (devinfo->platform == INTEL_PLATFORM_ADL)
- fixup_adl_device_info(devinfo);
-
/* region info is required for lmem support */
if (devinfo->has_local_mem && !devinfo->mem.use_class_instance) {
mesa_logw("Could not query local memory size.");
@@ -1616,6 +1620,9 @@ intel_get_device_info_from_fd(int fd, struct intel_device_info *devinfo)
devinfo->engine_class_prefetch[engine] =
intel_device_info_calc_engine_prefetch(devinfo, engine);
+ intel_device_info_init_was(devinfo);
+ intel_device_info_apply_workarounds(devinfo);
+
return true;
}