[PATCH] drm/amdgpu: use drm_fb helper for console_(un)lock

Michel Dänzer michel at daenzer.net
Fri Jul 20 13:57:26 UTC 2018


On 2018-07-20 02:30 PM, Shirish S wrote:
> This patch removes the usage of console_(un)lock
> by replacing drm_fb_helper_set_suspend() to
> drm_fb_helper_set_suspend_unlocked() which locks and
> unlocks the console instead of locking ourselves.
> 
> Signed-off-by: Shirish S <shirish.s at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 ++------
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c     | 4 ++--
>  2 files changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 022c136..a759b74 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -2691,11 +2691,9 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon)
>  			DRM_ERROR("amdgpu asic reset failed\n");
>  	}
>  
> -	if (fbcon) {
> -		console_lock();
> +	if (fbcon)
>  		amdgpu_fbdev_set_suspend(adev, 1);
> -		console_unlock();
> -	}
> +
>  	return 0;
>  }
>  
> @@ -2784,9 +2782,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)
>  			}
>  			drm_modeset_unlock_all(dev);
>  		}
> -		console_lock();
>  		amdgpu_fbdev_set_suspend(adev, 0);
> -		console_unlock();
>  	}
>  
>  	drm_kms_helper_poll_enable(dev);
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
> index d44b764..69c5d22 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
> @@ -373,8 +373,8 @@ void amdgpu_fbdev_fini(struct amdgpu_device *adev)
>  void amdgpu_fbdev_set_suspend(struct amdgpu_device *adev, int state)
>  {
>  	if (adev->mode_info.rfbdev)
> -		drm_fb_helper_set_suspend(&adev->mode_info.rfbdev->helper,
> -			state);
> +		drm_fb_helper_set_suspend_unlocked(&adev->mode_info.rfbdev->helper,
> +						   state);
>  }
>  
>  int amdgpu_fbdev_total_size(struct amdgpu_device *adev)
> 

Thanks for doing this, looks good.

Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the amd-gfx mailing list