xf86-video-intel: src/sna/sna_driver.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Nov 2 08:56:44 PDT 2012


 src/sna/sna_driver.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit e62b0cbf958d1ad95e4522973253a1ae5c1a4da9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Nov 2 15:54:20 2012 +0000

    sna: Add a small delay during startup if another master is still active
    
    There exists a race with plymouthd that can cause the drm device to
    reject us as the rightful master, and so cause X to fail to load. Try
    waiting for a couple of seconds for whatever it was to close before
    giving in.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index b7bd84a..055c71c 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -995,10 +995,13 @@ static Bool sna_enter_vt(VT_FUNC_ARGS_DECL)
 	DBG(("%s\n", __FUNCTION__));
 
 	if (drmSetMaster(sna->kgem.fd)) {
-		xf86DrvMsg(scrn->scrnIndex, X_ERROR,
-			   "drmSetMaster failed: %s\n",
-			   strerror(errno));
-		return FALSE;
+		sleep(2); /* XXX wait for the current master to decease */
+		if (drmSetMaster(sna->kgem.fd)) {
+			xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+					"drmSetMaster failed: %s\n",
+					strerror(errno));
+			return FALSE;
+		}
 	}
 
 	if (!xf86SetDesiredModes(scrn))


More information about the xorg-commit mailing list