summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2015-10-19 14:47:43 +0200
committerAdam Jackson <ajax@redhat.com>2015-10-19 12:11:54 -0400
commit08c4912406b965bbac0a3a52413c374a073c051b (patch)
tree39f191f55c81ee43c64f2891b90f68d9936dcb3f /hw
parenta4cd8ee5f8e8de776c7f764656770311cdbde0d2 (diff)
xorg-wrapper: fix build without libdrm
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/xorg-wrapper.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/xfree86/xorg-wrapper.c b/hw/xfree86/xorg-wrapper.c
index 22e97ad5d..75d120ab6 100644
--- a/hw/xfree86/xorg-wrapper.c
+++ b/hw/xfree86/xorg-wrapper.c
@@ -39,8 +39,10 @@
#include <sys/consio.h>
#endif
#include <unistd.h>
+#ifdef WITH_LIBDRM
#include <drm.h>
#include <xf86drm.h> /* For DRM_DEV_NAME */
+#endif
#define CONFIG_FILE SYSCONFDIR "/X11/Xwrapper.config"
@@ -183,7 +185,9 @@ static int on_console(int fd)
int main(int argc, char *argv[])
{
+#ifdef WITH_LIBDRM
struct drm_mode_card_res res;
+#endif
char buf[PATH_MAX];
int i, r, fd;
int kms_cards = 0;
@@ -219,6 +223,7 @@ int main(int argc, char *argv[])
}
}
+#ifdef WITH_LIBDRM
/* Detect if we need root rights, except when overriden by the config */
if (needs_root_rights == -1) {
for (i = 0; i < 16; i++) {
@@ -237,6 +242,7 @@ int main(int argc, char *argv[])
close(fd);
}
}
+#endif
/* If we've found cards, and all cards support kms, drop root rights */
if (needs_root_rights == 0 || (total_cards && kms_cards == total_cards)) {