drm/amdgpu: correct the cu count for gfx v11
authorjsg <jsg@openbsd.org>
Fri, 2 Feb 2024 03:21:27 +0000 (03:21 +0000)
committerjsg <jsg@openbsd.org>
Fri, 2 Feb 2024 03:21:27 +0000 (03:21 +0000)
From Likun Gao
b788696f9ed01019b10b1a2d7e92b4f8c61434d6 in linux-6.6.y/6.6.15
f4a94dbb6dc0bed10a5fc63718d00f1de45b12c0 in mainline linux

sys/dev/pci/drm/amd/amdgpu/gfx_v11_0.c

index 64f9bd9..e11eb91 100644 (file)
@@ -6353,6 +6353,9 @@ static int gfx_v11_0_get_cu_info(struct amdgpu_device *adev,
        mutex_lock(&adev->grbm_idx_mutex);
        for (i = 0; i < adev->gfx.config.max_shader_engines; i++) {
                for (j = 0; j < adev->gfx.config.max_sh_per_se; j++) {
+                       bitmap = i * adev->gfx.config.max_sh_per_se + j;
+                       if (!((gfx_v11_0_get_sa_active_bitmap(adev) >> bitmap) & 1))
+                               continue;
                        mask = 1;
                        counter = 0;
                        gfx_v11_0_select_se_sh(adev, i, j, 0xffffffff, 0);