summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/radeon_kms.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index a7aade70..796dac5f 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -752,6 +752,7 @@ radeon_prime_scanout_update(PixmapDirtyUpdatePtr dirty)
{
ScreenPtr screen = dirty->slave_dst->drawable.pScreen;
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+ RADEONEntPtr pRADEONEnt = RADEONEntPriv(scrn);
xf86CrtcPtr xf86_crtc = radeon_prime_dirty_to_crtc(dirty);
drmmode_crtc_private_ptr drmmode_crtc;
uintptr_t drm_queue_seq;
@@ -774,19 +775,23 @@ radeon_prime_scanout_update(PixmapDirtyUpdatePtr dirty)
if (drm_queue_seq == RADEON_DRM_QUEUE_ERROR) {
xf86DrvMsg(scrn->scrnIndex, X_WARNING,
"radeon_drm_queue_alloc failed for PRIME update\n");
+ radeon_prime_scanout_update_handler(xf86_crtc, 0, 0, NULL);
return;
}
+ drmmode_crtc->scanout_update_pending = drm_queue_seq;
+
if (!drmmode_wait_vblank(xf86_crtc, DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT,
1, drm_queue_seq, NULL, NULL)) {
xf86DrvMsg(scrn->scrnIndex, X_WARNING,
"drmmode_wait_vblank failed for PRIME update: %s\n",
strerror(errno));
- radeon_drm_abort_entry(drm_queue_seq);
- return;
+ drmmode_crtc->drmmode->event_context.vblank_handler(pRADEONEnt->fd,
+ 0, 0, 0,
+ (void*)drm_queue_seq);
+ drmmode_crtc->wait_flip_nesting_level++;
+ radeon_drm_queue_handle_deferred(xf86_crtc);
}
-
- drmmode_crtc->scanout_update_pending = drm_queue_seq;
}
static void
@@ -1022,8 +1027,9 @@ static void
radeon_scanout_update(xf86CrtcPtr xf86_crtc)
{
drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private;
+ ScrnInfoPtr scrn = xf86_crtc->scrn;
+ RADEONEntPtr pRADEONEnt = RADEONEntPriv(scrn);
uintptr_t drm_queue_seq;
- ScrnInfoPtr scrn;
DamagePtr pDamage;
RegionPtr pRegion;
BoxRec extents;
@@ -1048,7 +1054,6 @@ radeon_scanout_update(xf86CrtcPtr xf86_crtc)
return;
}
- scrn = xf86_crtc->scrn;
drm_queue_seq = radeon_drm_queue_alloc(xf86_crtc,
RADEON_DRM_QUEUE_CLIENT_DEFAULT,
RADEON_DRM_QUEUE_ID_DEFAULT,
@@ -1059,19 +1064,23 @@ radeon_scanout_update(xf86CrtcPtr xf86_crtc)
if (drm_queue_seq == RADEON_DRM_QUEUE_ERROR) {
xf86DrvMsg(scrn->scrnIndex, X_WARNING,
"radeon_drm_queue_alloc failed for scanout update\n");
+ radeon_scanout_update_handler(xf86_crtc, 0, 0, drmmode_crtc);
return;
}
+ drmmode_crtc->scanout_update_pending = drm_queue_seq;
+
if (!drmmode_wait_vblank(xf86_crtc, DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT,
1, drm_queue_seq, NULL, NULL)) {
xf86DrvMsg(scrn->scrnIndex, X_WARNING,
"drmmode_wait_vblank failed for scanout update: %s\n",
strerror(errno));
- radeon_drm_abort_entry(drm_queue_seq);
- return;
+ drmmode_crtc->drmmode->event_context.vblank_handler(pRADEONEnt->fd,
+ 0, 0, 0,
+ (void*)drm_queue_seq);
+ drmmode_crtc->wait_flip_nesting_level++;
+ radeon_drm_queue_handle_deferred(xf86_crtc);
}
-
- drmmode_crtc->scanout_update_pending = drm_queue_seq;
}
static void