drm/amdgpu: Check num_gfx_rings for gfx v9_0 rb setup.
authorjsg <jsg@openbsd.org>
Fri, 16 Sep 2022 02:20:28 +0000 (02:20 +0000)
committerjsg <jsg@openbsd.org>
Fri, 16 Sep 2022 02:20:28 +0000 (02:20 +0000)
From Candice Li
622a557b28b718d4da92ff3504d83af2310324d2 in linux 5.15.y/5.15.68
c351938350ab9b5e978dede2c321da43de7eb70c in mainline linux

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

index 54f2506..79c15b4 100644 (file)
@@ -2624,7 +2624,8 @@ static void gfx_v9_0_constants_init(struct amdgpu_device *adev)
 
        gfx_v9_0_tiling_mode_table_init(adev);
 
-       gfx_v9_0_setup_rb(adev);
+       if (adev->gfx.num_gfx_rings)
+               gfx_v9_0_setup_rb(adev);
        gfx_v9_0_get_cu_info(adev, &adev->gfx.cu_info);
        adev->gfx.config.db_debug2 = RREG32_SOC15(GC, 0, mmDB_DEBUG2);