diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2019-01-28 18:11:10 +0100 |
---|---|---|
committer | Michel Dänzer <michel.daenzer@amd.com> | 2019-01-28 18:11:10 +0100 |
commit | 1bfdccf7639ee2f655dc659cafa63830ba28be85 (patch) | |
tree | e1586f01638cc71329ed5dee076e7dd34afe918e /src/drmmode_display.c | |
parent | dcd3527299c1f6d6faa401c565fa884f4d8f3287 (diff) |
Only update drmmode_crtc->flip_pending after actually submitting a flip
And only clear it if it matches the framebuffer of the completed flip
being processed.
Fixes
(WW) RADEON(0): flip queue failed: Device or resource busy
(WW) RADEON(0): Page flip failed: Device or resource busy
(EE) RADEON(0): present flip failed
due to clobbering drmmode_crtc->flip_pending.
Reproducer: Enable TearFree, run warzone2100 fullscreen, toggle
Vertical sync on/off under Video Options. Discovered while investigating
https://bugs.freedesktop.org/109364 .
(Ported from amdgpu commit e72a02ba1d35743fefd939458b9d8cddce86e7f5)
Diffstat (limited to 'src/drmmode_display.c')
-rw-r--r-- | src/drmmode_display.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 71f3539f..c5fccd2a 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -2651,12 +2651,14 @@ drmmode_flip_handler(xf86CrtcPtr crtc, uint32_t frame, uint64_t usec, void *even flipdata->fe_usec = usec; } - if (drmmode_crtc->flip_pending == *fb) { - drmmode_fb_reference(pRADEONEnt->fd, - &drmmode_crtc->flip_pending, NULL); + if (*fb) { + if (drmmode_crtc->flip_pending == *fb) { + drmmode_fb_reference(pRADEONEnt->fd, + &drmmode_crtc->flip_pending, NULL); + } + drmmode_fb_reference(pRADEONEnt->fd, &drmmode_crtc->fb, *fb); + drmmode_fb_reference(pRADEONEnt->fd, fb, NULL); } - drmmode_fb_reference(pRADEONEnt->fd, &drmmode_crtc->fb, *fb); - drmmode_fb_reference(pRADEONEnt->fd, fb, NULL); if (--flipdata->flip_count == 0) { /* Deliver MSC & UST from reference/current CRTC to flip event @@ -3492,9 +3494,10 @@ Bool radeon_do_pageflip(ScrnInfoPtr scrn, ClientPtr client, drmmode_crtc->ignore_damage = TRUE; } - next: drmmode_fb_reference(pRADEONEnt->fd, &drmmode_crtc->flip_pending, flipdata->fb[crtc_id]); + + next: drm_queue_seq = 0; } |