Re: [PATCH 6/6] drm/radeon/pm: Handle failure of drm_vblank_get.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 08, 2016 at 02:13:29AM +0100, Mario Kleiner wrote:
> Make sure that drm_vblank_get/put() stay balanced in
> case drm_vblank_get fails, by skipping the corresponding
> put.
> 
> Signed-off-by: Mario Kleiner <mario.kleiner.de@xxxxxxxxx>
> Cc: michel@xxxxxxxxxxx
> Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
> Cc: alexander.deucher@xxxxxxx
> Cc: christian.koenig@xxxxxxx

Reviewed-by: Daniel Vetter <daniel.vetter@xxxxxxxx>

> ---
>  drivers/gpu/drm/radeon/radeon_pm.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
> index 59abebd..339a6c5 100644
> --- a/drivers/gpu/drm/radeon/radeon_pm.c
> +++ b/drivers/gpu/drm/radeon/radeon_pm.c
> @@ -276,8 +276,12 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev)
>  	if (rdev->irq.installed) {
>  		for (i = 0; i < rdev->num_crtc; i++) {
>  			if (rdev->pm.active_crtcs & (1 << i)) {
> -				rdev->pm.req_vblank |= (1 << i);
> -				drm_vblank_get(rdev->ddev, i);
> +				/* This can fail if a modeset is in progress */
> +				if (0 == drm_vblank_get(rdev->ddev, i))
> +					rdev->pm.req_vblank |= (1 << i);
> +				else
> +					DRM_DEBUG_DRIVER("crtc %d no vblank, can glitch\n",
> +							 i);
>  			}
>  		}
>  	}
> -- 
> 1.9.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux