summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLyude Paul <cpaul@redhat.com>2016-06-13 15:31:02 -0400
committerHans de Goede <hdegoede@redhat.com>2016-06-21 12:11:30 +0200
commit0dc1a58b9379c79ede8c40b2e6f008dc0868a40e (patch)
tree2e99de4a32446ee8a63ba5098d849334980d7f9a
parent619730cac614ff8306e17edd07ae860051c700b7 (diff)
modesetting: Clear drmmode->fb_id before unflippingfor-server-1.18
[fix copied from 40191d82370e in xf86-video-ati] Without this, we end up setting rotated CRTCs back to their previous framebuffer right after we perform a rotation. Reproducer: - Have two monitors connected at the same resolution - Rotate one monitor from normal straight to inverted - Watch as the monitor you didn't rotate either freezes or shows intense flickering Signed-off-by: Lyude <cpaul@redhat.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> (cherry picked from commit 848089e0dde38f043c85332785520946103e77c1)
-rw-r--r--hw/xfree86/drivers/modesetting/present.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/xfree86/drivers/modesetting/present.c b/hw/xfree86/drivers/modesetting/present.c
index d65c8c845..9a596de75 100644
--- a/hw/xfree86/drivers/modesetting/present.c
+++ b/hw/xfree86/drivers/modesetting/present.c
@@ -626,6 +626,15 @@ ms_present_unflip(ScreenPtr screen, uint64_t event_id)
if (!crtc->enabled)
continue;
+ /* info->drmmode.fb_id still points to the FB for the last flipped BO.
+ * Clear it, drmmode_set_mode_major will re-create it
+ */
+ if (drmmode_crtc->drmmode->fb_id) {
+ drmModeRmFB(drmmode_crtc->drmmode->fd,
+ drmmode_crtc->drmmode->fb_id);
+ drmmode_crtc->drmmode->fb_id = 0;
+ }
+
if (drmmode_crtc->dpms_mode == DPMSModeOn)
crtc->funcs->set_mode_major(crtc, &crtc->mode, crtc->rotation,
crtc->x, crtc->y);