On 6/12/23 10:55, Alex Deucher wrote:
> 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.
> 
> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2568
> Signed-off-by: Alex Deucher <alexander.deuc...@amd.com>

Acked-by: Harry Wentland <harry.wentl...@amd.com>

Harry

> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 0454e94d5680..fc0dd31785cb 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -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,

Reply via email to