All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
To: Intel graphics driver community testing & development
	<intel-gfx@lists.freedesktop.org>
Cc: Kirill Rusinov <carasin.berlogue@mail.ru>, Axel Davy <davyaxel@free.fr>
Subject: [PATCH] xwayland: device isn't even open that explains why drmGetCap
Date: Sun, 24 Nov 2013 21:02:14 +0400	[thread overview]
Message-ID: <1385312534.2501.4.camel@PC.localdomain> (raw)

>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(-)

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;
 	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;
-- 
1.8.4.2

                 reply	other threads:[~2013-11-24 17:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1385312534.2501.4.camel@PC.localdomain \
    --to=i.gnatenko.brain@gmail.com \
    --cc=carasin.berlogue@mail.ru \
    --cc=davyaxel@free.fr \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.