From 41b83a99583486ad4f8760a6537d34783769bfc3 Mon Sep 17 00:00:00 2001 From: Coleman Kane Date: Mon, 18 Aug 2008 17:08:21 -0400 Subject: Change prototype of drmIoctl to unsigned long request. This resolves and issue on amd64 FreeBSD and it looks like the linux ioctl syscall should be unsigned long as well. Signed-off-by: Robert Noland --- libdrm/xf86drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libdrm/xf86drm.c') diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c index 150dd5f8..7202c8d7 100644 --- a/libdrm/xf86drm.c +++ b/libdrm/xf86drm.c @@ -175,7 +175,7 @@ static char *drmStrdup(const char *s) * Call ioctl, restarting if it is interupted */ static int -drmIoctl(int fd, int request, void *arg) +drmIoctl(int fd, unsigned long request, void *arg) { int ret; -- cgit v1.2.3 From 9101a0205c897fea28e6a3d875111a83ad7f7732 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 24 Aug 2008 16:54:43 +1000 Subject: libdrm: add udev support. This patch allows you to --enable-udev, and will avoid having libdrm make device nodes. If you are using udev, you should really --enable-udev your libdrm. --- libdrm/xf86drm.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'libdrm/xf86drm.c') diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c index 7202c8d7..c36f1964 100644 --- a/libdrm/xf86drm.c +++ b/libdrm/xf86drm.c @@ -297,6 +297,7 @@ static int drmOpenDevice(long dev, int minor) group = (serv_group >= 0) ? serv_group : DRM_DEV_GID; } +#if !defined(UDEV) if (stat(DRM_DIR_NAME, &st)) { if (!isroot) return DRM_ERR_NOT_ROOT; @@ -317,6 +318,30 @@ static int drmOpenDevice(long dev, int minor) chown(buf, user, group); chmod(buf, devmode); } +#else + /* if we modprobed then wait for udev */ + { + int udev_count = 0; +wait_for_udev: + if (stat(DRM_DIR_NAME, &st)) { + usleep(20); + udev_count++; + + if (udev_count == 50) + return -1; + goto wait_for_udev; + } + + if (stat(buf, &st)) { + usleep(20); + udev_count++; + + if (udev_count == 50) + return -1; + goto wait_for_udev; + } + } +#endif fd = open(buf, O_RDWR, 0); drmMsg("drmOpenDevice: open result is %d, (%s)\n", -- cgit v1.2.3