summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-08-20 16:09:25 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-08-20 16:09:25 +0100
commit3c611087e8ae09fc3fe4271f16d912ac8ae89f6b (patch)
tree7619dd82f2673566a754739f5de7ec6bdb53e7fd
parentdd6c67b32f726b6ad7f12f3b83f6d8c868ff4dc1 (diff)
Only open the matching BusID and not the first named
If you pass a name to drmOpen() it will attempt to open any device corresponding to that name if it first fails to open the device corresponding to the BusID. Obviously we want the failure from opening the specified device in order to prevent wrongly opening the first found device multiple times. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/intel_driver.c2
-rw-r--r--src/sna/sna_driver.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/intel_driver.c b/src/intel_driver.c
index 1ef06fbb..c5be6793 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -249,7 +249,7 @@ static Bool intel_open_drm_master(ScrnInfoPtr scrn)
snprintf(busid, sizeof(busid), "pci:%04x:%02x:%02x.%d",
dev->domain, dev->bus, dev->dev, dev->func);
- intel->drmSubFD = drmOpen("i915", busid);
+ intel->drmSubFD = drmOpen(NULL, busid);
if (intel->drmSubFD == -1) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"[drm] Failed to open DRM device for %s: %s\n",
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 6810c7a1..a0beb4cf 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -259,7 +259,7 @@ static int sna_open_drm_master(ScrnInfoPtr scrn)
snprintf(busid, sizeof(busid), "pci:%04x:%02x:%02x.%d",
pci->domain, pci->bus, pci->dev, pci->func);
- fd = drmOpen("i915", busid);
+ fd = drmOpen(NULL, busid);
if (fd == -1) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"[drm] Failed to open DRM device for %s: %s\n",