diff --git a/shared-core/radeon_irq.c b/shared-core/radeon_irq.c index 1ece639..6875a62 100644 --- a/shared-core/radeon_irq.c +++ b/shared-core/radeon_irq.c @@ -153,12 +153,21 @@ static int radeon_driver_vblank_do_wait(struct drm_device * dev, unsigned int cur_vblank; int ret = 0; int ack = 0; + int fixup = 0; + int saved_crtc; atomic_t *counter; if (!dev_priv) { DRM_ERROR("%s called with no initialization\n", __FUNCTION__); return -EINVAL; } + if (!(radeon_vblank_crtc_get(dev) == crtc)) { + saved_crtc = crtc; + fixup = 1; + radeon_vblank_crtc_set(dev, crtc); + DRM_INFO("Fixup mode !\n"); + } + if (crtc == DRM_RADEON_VBLANK_CRTC1) { counter = &dev->vbl_received; ack |= RADEON_CRTC_VBLANK_STAT; @@ -182,6 +191,9 @@ static int radeon_driver_vblank_do_wait(struct drm_device * dev, *sequence = cur_vblank; + if (fixup == 1) + radeon_vblank_crtc_set(dev, saved_crtc); + return ret; }