summaryrefslogtreecommitdiff
path: root/src/xvmc
diff options
context:
space:
mode:
authorZhenyu Wang <zhenyu.z.wang@intel.com>2007-12-28 15:52:12 +0800
committerZhenyu Wang <zhenyu.z.wang@intel.com>2007-12-28 15:52:12 +0800
commita2bb2afd24c95e056b801c85dc12daeac54b37f0 (patch)
tree46bb41f6fc28f025fa70cda0684826858966f9df /src/xvmc
parent666e01bd426a553f23eeb5040ecbc28b4abb87da (diff)
xvmc: move drmOpen earlier
remove wrong comments
Diffstat (limited to 'src/xvmc')
-rw-r--r--src/xvmc/intel_xvmc.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/xvmc/intel_xvmc.c b/src/xvmc/intel_xvmc.c
index 0ce3cc2d..b4a34fc2 100644
--- a/src/xvmc/intel_xvmc.c
+++ b/src/xvmc/intel_xvmc.c
@@ -200,6 +200,7 @@ Status XvMCCreateContext(Display *display, XvPortID port,
int isCapable;
int screen = DefaultScreen(display);
intel_xvmc_context_ptr intel_ctx;
+ int fd;
/* Verify Obvious things first */
if (!display || !context)
@@ -210,14 +211,12 @@ Status XvMCCreateContext(Display *display, XvPortID port,
return BadValue;
}
- /* Limit use to root for now */
- /* FIXME: remove it ??? */
-/*
- if (geteuid()) {
- printf("Use of XvMC on i915 is currently limited to root\n");
- return BadAccess;
+ /* 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
@@ -275,6 +274,8 @@ 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;
@@ -309,15 +310,6 @@ Status XvMCCreateContext(Display *display, XvPortID port,
xvmc_driver->busID[20] = '\0';
XFree(curBusID);
- /* Open DRI Device */
- if((xvmc_driver->fd = drmOpen("i915", NULL)) < 0) {
- XVMC_ERR("DRM Device could not be opened.");
- //(xvmc_driver->fini)();
- xvmc_driver = NULL;
- XFree(priv_data);
- return BadValue;
- }
-
/* Get magic number */
drmGetMagic(xvmc_driver->fd, &magic);
// context->flags = (unsigned long)magic;