]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amdgpu: update the handle ptr in prepare_suspend
authorSunil Khatri <sunil.khatri@amd.com>
Mon, 30 Sep 2024 08:41:22 +0000 (14:11 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 1 Oct 2024 21:43:38 +0000 (17:43 -0400)
Update the *handle to amdgpu_ip_block ptr for all
functions pointers of prepare_suspend.

Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
drivers/gpu/drm/amd/include/amd_shared.h

index fb83708b71d9521fa3d2971486f36db0bd1bf8af..e79370dc3ac7855ad0d5479943a6130c54c6ed49 100644 (file)
@@ -4745,7 +4745,7 @@ int amdgpu_device_prepare(struct drm_device *dev)
                        continue;
                if (!adev->ip_blocks[i].version->funcs->prepare_suspend)
                        continue;
-               r = adev->ip_blocks[i].version->funcs->prepare_suspend((void *)adev);
+               r = adev->ip_blocks[i].version->funcs->prepare_suspend(&adev->ip_blocks[i]);
                if (r)
                        goto unprepare;
        }
index f5804cdfca45640d12a4c801ac86e32382791cc7..c33b86f24a17c519dd67e0a647d79233d7eabdbe 100644 (file)
@@ -704,9 +704,9 @@ static int uvd_v3_1_hw_fini(void *handle)
        return 0;
 }
 
-static int uvd_v3_1_prepare_suspend(void *handle)
+static int uvd_v3_1_prepare_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return amdgpu_uvd_prepare_suspend(adev);
 }
index 522aec5f8e2657ab68bb396cfbcc65e31c3f3f6d..de9e6222d495e853af8a0eb1087e5413f457f584 100644 (file)
@@ -218,9 +218,9 @@ static int uvd_v4_2_hw_fini(void *handle)
        return 0;
 }
 
-static int uvd_v4_2_prepare_suspend(void *handle)
+static int uvd_v4_2_prepare_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return amdgpu_uvd_prepare_suspend(adev);
 }
index 407014149eafc7b962924bb1aafb5b026e63edb9..f9bdbd1483833733947ff255183dfc9759d68649 100644 (file)
@@ -216,9 +216,9 @@ static int uvd_v5_0_hw_fini(void *handle)
        return 0;
 }
 
-static int uvd_v5_0_prepare_suspend(void *handle)
+static int uvd_v5_0_prepare_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return amdgpu_uvd_prepare_suspend(adev);
 }
index 68601bb4ce4489b6a39bf0a6cf933962e92a09a7..642b8db993b3a8c5551d7169dc19d235b37d1280 100644 (file)
@@ -540,9 +540,9 @@ static int uvd_v6_0_hw_fini(void *handle)
        return 0;
 }
 
-static int uvd_v6_0_prepare_suspend(void *handle)
+static int uvd_v6_0_prepare_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return amdgpu_uvd_prepare_suspend(adev);
 }
index 93d37cfdd8057a8be697aa325e57784bb3ab9404..aef7ca1435f2d753933d613737dc6a396e58b693 100644 (file)
@@ -608,9 +608,9 @@ static int uvd_v7_0_hw_fini(void *handle)
        return 0;
 }
 
-static int uvd_v7_0_prepare_suspend(void *handle)
+static int uvd_v7_0_prepare_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return amdgpu_uvd_prepare_suspend(adev);
 }
index 615f880d3e80d5bf4e99fd4bcf3914429f562028..1939c0dcdd1dcbb060c7bcb6325dfe71fc5bf4c9 100644 (file)
@@ -387,7 +387,7 @@ struct amd_ip_funcs {
        int (*hw_init)(void *handle);
        int (*hw_fini)(void *handle);
        void (*late_fini)(struct amdgpu_ip_block *ip_block);
-       int (*prepare_suspend)(void *handle);
+       int (*prepare_suspend)(struct amdgpu_ip_block *ip_block);
        int (*suspend)(void *handle);
        int (*resume)(void *handle);
        bool (*is_idle)(void *handle);