Blame SOURCES/0013-drm-fail-gracefuly-on-monitor-resize.patch

7d1c6e
From a3704bda41737263e8a547fb3d97ba818935d768 Mon Sep 17 00:00:00 2001
7d1c6e
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
7d1c6e
Date: Fri, 8 Aug 2014 19:24:28 +0200
7d1c6e
Subject: [PATCH xf86-qxl] drm: fail gracefuly on monitor resize
7d1c6e
7d1c6e
If drmModeSetCrtc() failed, try to fallback to previous working
7d1c6e
configuration.
7d1c6e
7d1c6e
Related to:
7d1c6e
https://bugzilla.redhat.com/show_bug.cgi?id=1127552
7d1c6e
---
7d1c6e
 src/qxl_drmmode.c | 11 +++++++----
7d1c6e
 1 file changed, 7 insertions(+), 4 deletions(-)
7d1c6e
7d1c6e
diff --git a/src/qxl_drmmode.c b/src/qxl_drmmode.c
7d1c6e
index f9eca5f..42347e6 100644
7d1c6e
--- a/src/qxl_drmmode.c
7d1c6e
+++ b/src/qxl_drmmode.c
7d1c6e
@@ -214,11 +214,13 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
7d1c6e
 		}
7d1c6e
 		ret = drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
7d1c6e
 				     fb_id, x, y, output_ids, output_count, &kmode);
7d1c6e
-		if (ret)
7d1c6e
+		if (ret) {
7d1c6e
 			xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
7d1c6e
 				   "failed to set mode: %s", strerror(-ret));
7d1c6e
-		else
7d1c6e
+			return FALSE;
7d1c6e
+		} else {
7d1c6e
 			ret = TRUE;
7d1c6e
+		}
7d1c6e
 
7d1c6e
 		if (crtc->scrn->pScreen)
7d1c6e
 			xf86CrtcSetScreenSubpixelOrder(crtc->scrn->pScreen);
7d1c6e
@@ -825,8 +827,9 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
7d1c6e
 		xf86CrtcPtr crtc = xf86_config->crtc[i];
7d1c6e
 		if (!crtc->enabled)
7d1c6e
 			continue;
7d1c6e
-		drmmode_set_mode_major(crtc, &crtc->mode, crtc->rotation,
7d1c6e
-				       crtc->x, crtc->y);
7d1c6e
+		if (!drmmode_set_mode_major(crtc, &crtc->mode, crtc->rotation,
7d1c6e
+                                            crtc->x, crtc->y))
7d1c6e
+                    goto fail;
7d1c6e
 	}
7d1c6e
 
7d1c6e
 	{
7d1c6e
-- 
7d1c6e
2.1.0
7d1c6e