drm/amdgpu: skipping SDMA hw_init and hw_fini for S0ix.
authorjsg <jsg@openbsd.org>
Thu, 24 Feb 2022 12:57:15 +0000 (12:57 +0000)
committerjsg <jsg@openbsd.org>
Thu, 24 Feb 2022 12:57:15 +0000 (12:57 +0000)
From Rajib Mahapatra
960c8a55016bece26140eef7a8077e9dc3709098 in linux 5.15.y/5.15.25
f8f4e2a518347063179def4e64580b2d28233d03 in mainline linux

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

index 4e2df08..7085d8a 100644 (file)
@@ -2062,6 +2062,10 @@ static int sdma_v4_0_suspend(void *handle)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+       /* SMU saves SDMA state for us */
+       if (adev->in_s0ix)
+               return 0;
+
        return sdma_v4_0_hw_fini(adev);
 }
 
@@ -2069,6 +2073,10 @@ static int sdma_v4_0_resume(void *handle)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+       /* SMU restores SDMA state for us */
+       if (adev->in_s0ix)
+               return 0;
+
        return sdma_v4_0_hw_init(adev);
 }