summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-01-27 15:43:58 -0800
committerEric Anholt <eric@anholt.net>2009-01-27 15:43:58 -0800
commit66bc44e8f9a0505c0b11b8042243ca74079da85f (patch)
treee292368b8a962b3083d47d3da8cff216ad51123c
parent8d4bc36fae50b09a73ba2cfab920adb32141a358 (diff)
dri2: Use modesetting's master fd instead of opening our own non-master.
This fixes failure to auth DRI2 clients under KMS.
-rw-r--r--src/i830_dri.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/i830_dri.c b/src/i830_dri.c
index 7a95d027..f03be43c 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -1691,7 +1691,17 @@ Bool I830DRI2ScreenInit(ScreenPtr pScreen)
pI830->PciInfo->dev,
pI830->PciInfo->func);
- info.fd = drmOpen("i915", buf);
+ info.fd = -1;
+
+#ifdef XF86DRM_MODE
+ /* Use the already opened (master) fd from modesetting */
+ if (pI830->use_drm_mode)
+ info.fd = pI830->drmSubFD;
+#endif
+
+ if (info.fd < 0)
+ info.fd = drmOpen("i915", buf);
+
if (info.fd < 0) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Failed to open DRM device\n");
return FALSE;