diff options
| author | Mario Limonciello <[email protected]> | 2023-10-06 18:50:22 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2023-10-13 15:01:04 +0000 |
| commit | db9988906535aad9ab64f7e78ab7d52c0d0d2781 (patch) | |
| tree | f27f0e9c7ac1ae89fed525a48a6834abcdf36e35 /drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | |
| parent | drm/amd: Add concept of running prepare_suspend() sequence for IP blocks (diff) | |
| download | kernel-db9988906535aad9ab64f7e78ab7d52c0d0d2781.tar.gz kernel-db9988906535aad9ab64f7e78ab7d52c0d0d2781.zip | |
drm/amd: Split up UVD suspend into prepare and suspend steps
amdgpu_uvd_suspend() allocates memory and copies objects into that
allocated memory. This fails under memory pressure. Instead move
majority of this code into a prepare step when swap can still be
allocated.
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Mario Limonciello <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c index 5fe872f4bea7..74c09230aeb3 100644 --- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c @@ -542,6 +542,13 @@ static int uvd_v6_0_hw_fini(void *handle) return 0; } +static int uvd_v6_0_prepare_suspend(void *handle) +{ + struct amdgpu_device *adev = (struct amdgpu_device *)handle; + + return amdgpu_uvd_prepare_suspend(adev); +} + static int uvd_v6_0_suspend(void *handle) { int r; @@ -1528,6 +1535,7 @@ static const struct amd_ip_funcs uvd_v6_0_ip_funcs = { .sw_fini = uvd_v6_0_sw_fini, .hw_init = uvd_v6_0_hw_init, .hw_fini = uvd_v6_0_hw_fini, + .prepare_suspend = uvd_v6_0_prepare_suspend, .suspend = uvd_v6_0_suspend, .resume = uvd_v6_0_resume, .is_idle = uvd_v6_0_is_idle, |
