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>
This commit is contained in:
Lionel Landwerlin
2023-05-11 10:13:27 +03:00
committed by Marge Bot
parent 9ebd553fc2
commit ec4619a5e9
+32 -25
View File
@@ -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;
}
@@ -1387,22 +1410,6 @@ intel_device_info_compute_system_memory(struct intel_device_info *devinfo, bool
return true;
}
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)
{
@@ -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;
}