Commit a782bca5 authored by Gustavo Padovan's avatar Gustavo Padovan Committed by Daniel Vetter

drm/radeon: use drm_crtc_vblank_{get,put}()

Replace the legacy drm_vblank_{get,put}() with the new helper functions.
Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1465224105-21485-13-git-send-email-gustavo@padovan.org
parent 078ace6f
...@@ -381,7 +381,7 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id) ...@@ -381,7 +381,7 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id)
spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); spin_unlock_irqrestore(&rdev->ddev->event_lock, flags);
drm_vblank_put(rdev->ddev, radeon_crtc->crtc_id); drm_crtc_vblank_put(&radeon_crtc->base);
radeon_irq_kms_pflip_irq_put(rdev, work->crtc_id); radeon_irq_kms_pflip_irq_put(rdev, work->crtc_id);
queue_work(radeon_crtc->flip_queue, &work->unpin_work); queue_work(radeon_crtc->flip_queue, &work->unpin_work);
} }
...@@ -598,7 +598,7 @@ static int radeon_crtc_page_flip(struct drm_crtc *crtc, ...@@ -598,7 +598,7 @@ static int radeon_crtc_page_flip(struct drm_crtc *crtc,
} }
work->base = base; work->base = base;
r = drm_vblank_get(crtc->dev, radeon_crtc->crtc_id); r = drm_crtc_vblank_get(crtc);
if (r) { if (r) {
DRM_ERROR("failed to get vblank before flip\n"); DRM_ERROR("failed to get vblank before flip\n");
goto pflip_cleanup; goto pflip_cleanup;
...@@ -625,7 +625,7 @@ static int radeon_crtc_page_flip(struct drm_crtc *crtc, ...@@ -625,7 +625,7 @@ static int radeon_crtc_page_flip(struct drm_crtc *crtc,
return 0; return 0;
vblank_cleanup: vblank_cleanup:
drm_vblank_put(crtc->dev, radeon_crtc->crtc_id); drm_crtc_vblank_put(&radeon_crtc->base);
pflip_cleanup: pflip_cleanup:
if (unlikely(radeon_bo_reserve(new_rbo, false) != 0)) { if (unlikely(radeon_bo_reserve(new_rbo, false) != 0)) {
......
...@@ -246,6 +246,7 @@ static void radeon_set_power_state(struct radeon_device *rdev) ...@@ -246,6 +246,7 @@ static void radeon_set_power_state(struct radeon_device *rdev)
static void radeon_pm_set_clocks(struct radeon_device *rdev) static void radeon_pm_set_clocks(struct radeon_device *rdev)
{ {
struct drm_crtc *crtc;
int i, r; int i, r;
/* no need to take locks, etc. if nothing's going to change */ /* no need to take locks, etc. if nothing's going to change */
...@@ -274,26 +275,30 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev) ...@@ -274,26 +275,30 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev)
radeon_unmap_vram_bos(rdev); radeon_unmap_vram_bos(rdev);
if (rdev->irq.installed) { if (rdev->irq.installed) {
for (i = 0; i < rdev->num_crtc; i++) { i = 0;
drm_for_each_crtc(crtc, rdev->ddev) {
if (rdev->pm.active_crtcs & (1 << i)) { if (rdev->pm.active_crtcs & (1 << i)) {
/* This can fail if a modeset is in progress */ /* This can fail if a modeset is in progress */
if (drm_vblank_get(rdev->ddev, i) == 0) if (drm_crtc_vblank_get(crtc) == 0)
rdev->pm.req_vblank |= (1 << i); rdev->pm.req_vblank |= (1 << i);
else else
DRM_DEBUG_DRIVER("crtc %d no vblank, can glitch\n", DRM_DEBUG_DRIVER("crtc %d no vblank, can glitch\n",
i); i);
} }
i++;
} }
} }
radeon_set_power_state(rdev); radeon_set_power_state(rdev);
if (rdev->irq.installed) { if (rdev->irq.installed) {
for (i = 0; i < rdev->num_crtc; i++) { i = 0;
drm_for_each_crtc(crtc, rdev->ddev) {
if (rdev->pm.req_vblank & (1 << i)) { if (rdev->pm.req_vblank & (1 << i)) {
rdev->pm.req_vblank &= ~(1 << i); rdev->pm.req_vblank &= ~(1 << i);
drm_vblank_put(rdev->ddev, i); drm_crtc_vblank_put(crtc);
} }
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