From a977cd49d155e5672bc9ec45f98c00edcdd7f27b Mon Sep 17 00:00:00 2001 From: Calder Young Date: Wed, 26 Nov 2025 20:21:57 -0800 Subject: [PATCH] intel: Fix calculation of max_scratch_ids on fused devices The subslice IDs provided by the SR0.0 EU register are not adjusted to account for fusing, so the upper bound max_scratch_ids can vary from device to device depending on what specific slices were fused during manufacturing. Reviewed-by: Sagar Ghuge Reviewed-by: Lionel Landwerlin Cc: mesa-stable (cherry picked from commit c0d809820f35378928f719c1e2ddba9a41d5fbd9) Part-of: --- .pick_status.json | 2 +- src/intel/dev/intel_device_info.c | 31 ++----------------------------- 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 5482eab008c..dd5188c817a 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -244,7 +244,7 @@ "description": "intel: Fix calculation of max_scratch_ids on fused devices", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/intel/dev/intel_device_info.c b/src/intel/dev/intel_device_info.c index ffdd1718882..379d9f6baa8 100644 --- a/src/intel/dev/intel_device_info.c +++ b/src/intel/dev/intel_device_info.c @@ -1686,37 +1686,10 @@ intel_device_info_adjust_memory(struct intel_device_info *devinfo) static void init_max_scratch_ids(struct intel_device_info *devinfo) { - /* Determine the max number of subslices that potentially might be used in + /* Determine the max subslice that potentially might be used in * scratch space ids. - * - * For, Gfx11+, scratch space allocation is based on the number of threads - * in the base configuration. - * - * For Gfx9, devinfo->subslice_total is the TOTAL number of subslices and - * we wish to view that there are 4 subslices per slice instead of the - * actual number of subslices per slice. The documentation for 3DSTATE_PS - * "Scratch Space Base Pointer" says: - * - * "Scratch Space per slice is computed based on 4 sub-slices. SW - * must allocate scratch space enough so that each slice has 4 - * slices allowed." - * - * According to the other driver team, this applies to compute shaders - * as well. This is not currently documented at all. - * - * For Gfx8 and older we user devinfo->subslice_total. */ - unsigned subslices; - if (devinfo->verx10 == 125) - subslices = 32; - else if (devinfo->ver == 12) - subslices = (devinfo->platform == INTEL_PLATFORM_DG1 || devinfo->gt == 2 ? 6 : 2); - else if (devinfo->ver == 11) - subslices = 8; - else if (devinfo->ver >= 9 && devinfo->ver < 11) - subslices = 4 * devinfo->num_slices; - else - subslices = devinfo->subslice_total; + unsigned subslices = intel_device_info_dual_subslice_id_bound(devinfo); assert(subslices >= devinfo->subslice_total); unsigned scratch_ids_per_subslice;