diff mbox

xwayland: device isn't even open that explains why drmGetCap

Message ID 1385312534.2501.4.camel@PC.localdomain (mailing list archive)
State New, archived
Headers show

Commit Message

Igor Gnatenko Nov. 24, 2013, 5:02 p.m. UTC
From 06c37e84627d0d49985c9e056d3fcf6a78bddd0d Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Date: Sun, 24 Nov 2013 20:27:24 +0400
Subject: [PATCH] xwayland: device isn't even open that explains why
drmGetCap
 fails and it advertises no Prime capabilities

Since d9769c193765ac303ad4d4760e57ff368df1f663 DRI_PRIME=1 works
isn't correctly.

1. $ xrandr --listproviders
   Providers: number : 2
   Provider 0: id: 0x7b cap: 0x0 crtcs: 2 outputs: 4 associated
providers: 0 name:Intel
   Provider 1: id: 0x55 cap: 0xf, Source Output, Sink Output, Source
Offload, Sink Offload crtcs: 6 outputs: 0 associated providers: 0
name:radeon

2. $ xrandr --setprovideroffloadsink 0x55 0x7b
   X Error of failed request:  BadValue (integer parameter out of range
for operation)
     Major opcode of failed request:  139 (RANDR)
     Minor opcode of failed request:  34 ()
     Value in failed request:  0x7b
     Serial number of failed request:  16
     Current serial number in output stream:  17

Reported-and-tested-by: Kirill Rusinov <carasin.berlogue@mail.ru>
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Signed-off-by: Axel Davy <davyaxel@free.fr>
Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1033903
---
 src/uxa/intel_driver.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

 	scrn->rgbBits = 8;
@@ -604,14 +610,13 @@ static Bool I830PreInit(ScrnInfoPtr scrn, int
flags)
 		}
 
 		intel->drmSubFD = xwl_screen_get_drm_fd(intel->xwl_screen);
+
+		if (!intel->xwl_screen && !intel_open_drm_master(scrn))
+			xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+				   "Failed to become DRM master.\n");
 	}
 #endif
 
-	if (!intel->xwl_screen && !intel_open_drm_master(scrn))
-		xf86DrvMsg(scrn->scrnIndex, X_ERROR,
-			   "Failed to become DRM master.\n");
-
-
 	if (!intel_init_bufmgr(intel)) {
 		PreInitCleanup(scrn);
 		return FALSE;
diff mbox

Patch

diff --git a/src/uxa/intel_driver.c b/src/uxa/intel_driver.c
index 1c38075..c5d85c8 100644
--- a/src/uxa/intel_driver.c
+++ b/src/uxa/intel_driver.c
@@ -549,6 +549,12 @@  static Bool I830PreInit(ScrnInfoPtr scrn, int
flags)
 
 	intel->PciInfo = xf86GetPciInfoForEntity(intel->pEnt->index);
 
+	if (!xorgWayland && (!intel_open_drm_master(scrn))) {
+		xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+			   "Failed to become DRM master.\n");
+		return FALSE;
+	}
+
 	scrn->monitor = scrn->confScreen->monitor;
 	scrn->progClock = TRUE;