]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amdgpu/gfx11: Add Cleaner Shader Support for GFX11.5.4
authorSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Thu, 26 Mar 2026 04:25:08 +0000 (09:55 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 30 Mar 2026 19:13:50 +0000 (15:13 -0400)
The Cleaner Shader is responsible for clearing LDS, VGPRs and SGPRs
between GPU workloads to enforce process isolation and avoid data
leakage.

The cleaner shader clears per-wave GPU state (LDS, VGPRs and SGPRs)
between workloads, improving process isolation and preventing stale data
from being observed by subsequent tasks.

This reuses the existing cleaner shader used on GFX11.0.3 and enables it
for GFX11.5.4 GPUs when firmware requirements are met.

Cc: Muhammad Adam <muhammad.adam@amd.com>
Cc: Mario Sopena-Novales <mario.novales@amd.com>
Cc: Tom Wu <Tom.Wu@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c

index 78d1f3eb522eddb7501525e37c539a529c3aa978..ae39b9e1f7d65a56522ec1ae03d93743671e7654 100644 (file)
@@ -1722,6 +1722,20 @@ static int gfx_v11_0_sw_init(struct amdgpu_ip_block *ip_block)
                        }
                }
                break;
+       case IP_VERSION(11, 5, 4):
+               adev->gfx.cleaner_shader_ptr = gfx_11_0_3_cleaner_shader_hex;
+               adev->gfx.cleaner_shader_size = sizeof(gfx_11_0_3_cleaner_shader_hex);
+               if (adev->gfx.me_fw_version  >= 4 &&
+                   adev->gfx.pfp_fw_version >= 7 &&
+                   adev->gfx.mec_fw_version >= 5) {
+                       adev->gfx.enable_cleaner_shader = true;
+                       r = amdgpu_gfx_cleaner_shader_sw_init(adev, adev->gfx.cleaner_shader_size);
+                       if (r) {
+                               adev->gfx.enable_cleaner_shader = false;
+                               dev_err(adev->dev, "Failed to initialize cleaner shader\n");
+                       }
+               }
+               break;
        default:
                adev->gfx.enable_cleaner_shader = false;
                break;