diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2019-01-28 18:08:35 +0100 |
---|---|---|
committer | Michel Dänzer <michel.daenzer@amd.com> | 2019-01-28 18:08:35 +0100 |
commit | dcd3527299c1f6d6faa401c565fa884f4d8f3287 (patch) | |
tree | d8161105c0714611df58a4bc9e291c018168bd65 | |
parent | 274703087f80342f51fa69c935bb9a1cb0c4ae47 (diff) |
Don't allow TearFree scanout flips to complete in the same vblank period
We were using a relative target of 0, meaning "complete the flip ASAP".
This could result in the flip sometimes, but not always completing in
the same vertical blank period where the corresponding drawing occurred,
potentially causing judder artifacts with applications updating their
window contents synchronized to the display refresh. A good way to test
this is the vsynctester.com site in a windowed browser, where the judder
results in the large "VSYNC" text intermittently appearing red or cyan
instead of the expected gray.
To avoid this, use a relative target MSC of 1, meaning that if a
vertical blank period is in progress, the flip will only complete in the
next one.
Reported by Julian Tempel and Brandon Wright in
https://bugs.freedesktop.org/106175 .
(Ported from amdgpu commit a1b479c7d0066c481af920f297d6af9009dda11e)
-rw-r--r-- | src/radeon_kms.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/radeon_kms.c b/src/radeon_kms.c index 67f42e0f..8b965622 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -858,7 +858,7 @@ radeon_prime_scanout_flip(PixmapDirtyUpdatePtr ent) if (drmmode_page_flip_target_relative(pRADEONEnt, drmmode_crtc, drmmode_crtc->flip_pending->handle, - 0, drm_queue_seq, 0) != 0) { + 0, drm_queue_seq, 1) != 0) { if (!(drmmode_crtc->scanout_status & DRMMODE_SCANOUT_FLIP_FAILED)) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "flip queue failed in %s: %s, TearFree inactive\n", @@ -1175,7 +1175,7 @@ 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) { + 0, drm_queue_seq, 1) != 0) { if (!(drmmode_crtc->scanout_status & DRMMODE_SCANOUT_FLIP_FAILED)) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "flip queue failed in %s: %s, TearFree inactive\n", |