From: jsg Date: Fri, 2 Feb 2024 03:21:27 +0000 (+0000) Subject: drm/amdgpu: correct the cu count for gfx v11 X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=40b6d6a7717592382eff29bb8a6dcfc53615419b;p=openbsd drm/amdgpu: correct the cu count for gfx v11 From Likun Gao b788696f9ed01019b10b1a2d7e92b4f8c61434d6 in linux-6.6.y/6.6.15 f4a94dbb6dc0bed10a5fc63718d00f1de45b12c0 in mainline linux --- diff --git a/sys/dev/pci/drm/amd/amdgpu/gfx_v11_0.c b/sys/dev/pci/drm/amd/amdgpu/gfx_v11_0.c index 64f9bd920fc..e11eb916ccb 100644 --- a/sys/dev/pci/drm/amd/amdgpu/gfx_v11_0.c +++ b/sys/dev/pci/drm/amd/amdgpu/gfx_v11_0.c @@ -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);