Commit e0b34e38 authored by Mario Kleiner's avatar Mario Kleiner Committed by Dave Airlie

drm/radeon/pm: Handle failure of drm_vblank_get.

Make sure that drm_vblank_get/put() stay balanced in
case drm_vblank_get fails, by skipping the corresponding
put.
Signed-off-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Cc: michel@daenzer.net
Cc: dri-devel@lists.freedesktop.org
Cc: alexander.deucher@amd.com
Cc: christian.koenig@amd.com
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent bb74fc1b
...@@ -276,8 +276,12 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev) ...@@ -276,8 +276,12 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev)
if (rdev->irq.installed) { if (rdev->irq.installed) {
for (i = 0; i < rdev->num_crtc; i++) { for (i = 0; i < rdev->num_crtc; i++) {
if (rdev->pm.active_crtcs & (1 << i)) { if (rdev->pm.active_crtcs & (1 << i)) {
/* This can fail if a modeset is in progress */
if (drm_vblank_get(rdev->ddev, i) == 0)
rdev->pm.req_vblank |= (1 << i); rdev->pm.req_vblank |= (1 << i);
drm_vblank_get(rdev->ddev, i); else
DRM_DEBUG_DRIVER("crtc %d no vblank, can glitch\n",
i);
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment