summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2000-04-20 16:36:40 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2000-04-20 16:36:40 +0000
commit01836824d5b3dd4833573ebf3f98ed4cfb9cd5b3 (patch)
tree8ce8c56823f3dd769c4e23d328ec2f6ecc19afb7
parentda74fc3f29f3cc093929fe6c54140522ff489e2a (diff)
-rw-r--r--libdrm/xf86drm.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c
index 8b97c7da9..3b66c19a8 100644
--- a/libdrm/xf86drm.c
+++ b/libdrm/xf86drm.c
@@ -217,6 +217,20 @@ static int drmOpenByName(const char *name)
group = xf86ConfigDRI.group ? xf86ConfigDRI.group : DRM_DEV_GID;
#endif
+#if defined(XFree86Server)
+ if (!drmAvailable()) {
+ /* try to load the kernel module now */
+ if (!xf86LoadKernelModule(name)) {
+ ErrorF("[drm] failed to load kernel module \"%s\"\n",
+ name);
+ return -1;
+ }
+ }
+#else
+ if (!drmAvailable())
+ return -1;
+#endif
+
if (!geteuid()) {
dirmode = mode;
if (dirmode & S_IRUSR) dirmode |= S_IXUSR;