[PATCH 6/6] drm/radeon/pm: Handle failure of drm_vblank_get.
Daniel Vetter
daniel at ffwll.ch
Tue Feb 9 10:10:05 UTC 2016
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 at gmail.com>
> Cc: michel at daenzer.net
> Cc: dri-devel at lists.freedesktop.org
> Cc: alexander.deucher at amd.com
> Cc: christian.koenig at amd.com
Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> ---
> 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 at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the dri-devel
mailing list