summaryrefslogtreecommitdiff
path: root/src/xvmc
diff options
context:
space:
mode:
authorRobert Noland <rnoland@2hip.net>2008-12-17 09:27:30 +0800
committerZhenyu Wang <zhenyu.z.wang@intel.com>2008-12-17 09:27:30 +0800
commited267072db7c58ee16a458fd3dc24ce3a2d0061d (patch)
treeabcebb59066005b548435c798748da497ff1c744 /src/xvmc
parentecdd706873c1f990f4a78fbaecf7380411edabcd (diff)
Fix drmOpen for non-linux 965 XvMC
drmOpen by name only works on linux after falling back to groping around in /proc. This doesn't work on other OS. Signed-off-by: Robert Noland <rnoland@2hip.net>
Diffstat (limited to 'src/xvmc')
-rw-r--r--src/xvmc/intel_xvmc.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/xvmc/intel_xvmc.c b/src/xvmc/intel_xvmc.c
index d18c7229..dbde22f9 100644
--- a/src/xvmc/intel_xvmc.c
+++ b/src/xvmc/intel_xvmc.c
@@ -292,12 +292,6 @@ _X_EXPORT Status XvMCCreateContext(Display *display, XvPortID port,
intel_xvmc_debug_init();
- /* Open DRI Device */
- if((fd = drmOpen("i915", NULL)) < 0) {
- XVMC_ERR("DRM Device could not be opened.");
- return BadValue;
- }
-
/*
Width, Height, and flags are checked against surface_type_id
and port for validity inside the X server, no need to check
@@ -358,8 +352,6 @@ _X_EXPORT Status XvMCCreateContext(Display *display, XvPortID port,
return BadValue;
}
- xvmc_driver->fd = fd;
-
XVMC_INFO("decoder type is %s", intel_xvmc_decoder_string(comm->type));
xvmc_driver->sarea_size = comm->sarea_size;
@@ -390,6 +382,16 @@ _X_EXPORT Status XvMCCreateContext(Display *display, XvPortID port,
return BadValue;
}
+ /* Open DRI Device */
+ if((fd = drmOpen("i915", curBusID)) < 0) {
+ XVMC_ERR("DRM Device could not be opened.");
+ XFree(priv_data);
+ XFree(curBusID);
+ return BadValue;
+ }
+
+ xvmc_driver->fd = fd;
+
strncpy(xvmc_driver->busID, curBusID, 20);
xvmc_driver->busID[20] = '\0';
XFree(curBusID);