summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/i830_dri.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/i830_dri.c b/src/i830_dri.c
index 70b76aed..93bb3409 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -1829,8 +1829,22 @@ Bool I830DRI2ScreenInit(ScreenPtr pScreen)
info.fd = pI830->drmSubFD;
#endif
- if (info.fd < 0)
+ if (info.fd < 0) {
info.fd = drmOpen("i915", buf);
+ drmSetVersion sv;
+ int err;
+
+ /* Check that what we opened was a master or a master-capable FD,
+ * by setting the version of the interface we'll use to talk to it.
+ * (see DRIOpenDRMMaster() in DRI1)
+ */
+ sv.drm_di_major = 1;
+ sv.drm_di_minor = 1;
+ sv.drm_dd_major = -1;
+ err = drmSetInterfaceVersion(info.fd, &sv);
+ if (err != 0)
+ return FALSE;
+ }
if (info.fd < 0) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Failed to open DRM device\n");