summaryrefslogtreecommitdiff
path: root/src/radeon_kms.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2017-03-14 16:57:17 +0900
committerMichel Dänzer <michel@daenzer.net>2017-07-13 17:29:24 +0900
commit94dc2b80f3ef0b2c17c20501d824fb0447d52e7a (patch)
tree205ab5e7863f7272d868d8567c5cf5de6ef58120 /src/radeon_kms.c
parentaff267ee36cc6a703a532f91f82adc1ba1425ff3 (diff)
If a TearFree flip fails, fall back to non-TearFree operation
In order to avoid possible freeze / log file spam in that case. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99769 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/radeon_kms.c')
-rw-r--r--src/radeon_kms.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 955efc62..b22c9840 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -1008,7 +1008,9 @@ static void
radeon_scanout_update_handler(xf86CrtcPtr crtc, uint32_t frame, uint64_t usec,
void *event_data)
{
- radeon_scanout_do_update(crtc, 0);
+ drmmode_crtc_private_ptr drmmode_crtc = event_data;
+
+ radeon_scanout_do_update(crtc, drmmode_crtc->scanout_id);
radeon_scanout_update_abort(crtc, event_data);
}
@@ -1027,7 +1029,6 @@ radeon_scanout_update(xf86CrtcPtr xf86_crtc)
if (!xf86_crtc->enabled ||
drmmode_crtc->scanout_update_pending ||
- !drmmode_crtc->scanout[drmmode_crtc->scanout_id].pixmap ||
drmmode_crtc->pending_dpms_mode != DPMSModeOn)
return;
@@ -1128,9 +1129,17 @@ radeon_scanout_flip(ScreenPtr pScreen, RADEONInfoPtr info,
if (drmmode_page_flip_target_relative(pRADEONEnt, drmmode_crtc,
drmmode_crtc->flip_pending->handle,
0, drm_queue_seq, 0) != 0) {
- xf86DrvMsg(scrn->scrnIndex, X_WARNING, "flip queue failed in %s: %s\n",
+ xf86DrvMsg(scrn->scrnIndex, X_WARNING, "flip queue failed in %s: %s, "
+ "TearFree inactive until next modeset\n",
__func__, strerror(errno));
radeon_drm_abort_entry(drm_queue_seq);
+ RegionCopy(DamageRegion(drmmode_crtc->scanout_damage),
+ &drmmode_crtc->scanout_last_region);
+ RegionEmpty(&drmmode_crtc->scanout_last_region);
+ radeon_scanout_update(xf86_crtc);
+ drmmode_crtc_scanout_destroy(drmmode_crtc->drmmode,
+ &drmmode_crtc->scanout[scanout_id]);
+ drmmode_crtc->tear_free = FALSE;
return;
}
@@ -1172,11 +1181,7 @@ static void RADEONBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL)
if (drmmode_crtc->tear_free)
radeon_scanout_flip(pScreen, info, crtc);
- else if (info->shadow_primary
-#if XF86_CRTC_VERSION >= 4
- || crtc->driverIsPerformingTransform
-#endif
- )
+ else if (drmmode_crtc->scanout[drmmode_crtc->scanout_id].pixmap)
radeon_scanout_update(crtc);
}
}