drm/amd/display: don't free stolen console memory during suspend
Subsystems (3)
Alex Deucher
maintainerPATCH 1/1 drm/amd/display: don't free stolen console memory during suspend
Don't free the memory if we are hitting this as part of suspend. This way we don't free any memory during suspend; see amdgpu_bo_free_kernel(). The memory will be freed in the first non-suspend modeset or when the driver is torn down.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +11 -4
@@ -8963,10 +8963,17 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)drm_atomic_helper_cleanup_planes (dev, state); -/* return the stolen vga memory back to VRAM */ -if (!adev->mman.keep_stolen_vga_memory) -amdgpu_bo_free_kernel (&adev->mman.stolen_vga_memory,NULL ,NULL ); -amdgpu_bo_free_kernel (&adev->mman.stolen_extended_memory,NULL ,NULL ); +/* Don't free the memory if we are hitting this as part of suspend. +* This way we don't free any memory during suspend; see +* amdgpu_bo_free_kernel(). The memory will be freed in the first +* non-suspend modeset or when the driver is torn down. +*/ +if (!adev->in_suspend) { +/* return the stolen vga memory back to VRAM */ +if (!adev->mman.keep_stolen_vga_memory) +amdgpu_bo_free_kernel (&adev->mman.stolen_vga_memory,NULL ,NULL ); +amdgpu_bo_free_kernel (&adev->mman.stolen_extended_memory,NULL ,NULL ); + }/* * Finally, drop a runtime PM reference for each newly disabled CRTC,
Signature · 1 line
2.40.1
Quoted 7 lines · Alex Deucher
Don't free the memory if we are hitting this as part of suspend. This way we don't free any memory during suspend; see
amdgpu_bo_free_kernel(). The memory will be freed in the first non-suspend modeset or when the driver is torn down.
Harry
Quoted 30 lines
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +11
-4@@ -8963,10 +8963,17 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)drm_atomic_helper_cleanup_planes (dev, state); -/* return the stolen vga memory back to VRAM */ -if (!adev->mman.keep_stolen_vga_memory) -amdgpu_bo_free_kernel (&adev->mman.stolen_vga_memory,NULL ,NULL ); -amdgpu_bo_free_kernel (&adev->mman.stolen_extended_memory,NULL ,NULL ); +/* Don't free the memory if we are hitting this as part of suspend. +* This way we don't free any memory during suspend; see +* amdgpu_bo_free_kernel(). The memory will be freed in the first +* non-suspend modeset or when the driver is torn down. +*/ +if (!adev->in_suspend) { +/* return the stolen vga memory back to VRAM */ +if (!adev->mman.keep_stolen_vga_memory) +amdgpu_bo_free_kernel (&adev->mman.stolen_vga_memory,NULL ,NULL ); +amdgpu_bo_free_kernel (&adev->mman.stolen_extended_memory,NULL ,NULL ); + }/* * Finally, drop a runtime PM reference for each newly disabled CRTC,
[Public]
Quoted 55 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Monday, June 12, 2023 10:55 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH] drm/amd/display: don't free stolen console memory during suspendDon't free the memory if we are hitting this as part of suspend. This way we don't free any memory during suspend; see
amdgpu_bo_free_kernel(). The memory will be freed in the first non- suspend modeset or when the driver is torn down.Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +9
-4@@ -8963,10 +8963,17 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)drm_atomic_helper_cleanup_planes (dev, state); -/* return the stolen vga memory back to VRAM */ -if (!adev->mman.keep_stolen_vga_memory) -amdgpu_bo_free_kernel (&adev->mman.stolen_vga_memory, NULL, NULL); -amdgpu_bo_free_kernel (&adev->mman.stolen_extended_memory, NULL, NULL); +/* Don't free the memory if we are hitting this as part of suspend. +* This way we don't free any memory during suspend; see +* amdgpu_bo_free_kernel(). The memory will be freed in the first +* non-suspend modeset or when the driver is torn down. +*/ +if (!adev->in_suspend) { +/* return the stolen vga memory back to VRAM */ +if (!adev->mman.keep_stolen_vga_memory) + amdgpu_bo_free_kernel(&adev-Quoted 1 line
mman.stolen_vga_memory, NULL, NULL);
+ amdgpu_bo_free_kernel(&adev-
Quoted 1 line
mman.stolen_extended_memory, NULL, NULL);
+ }
/*
* Finally, drop a runtime PM reference for each newly disabled CRTC,
--
2.40.1