From 7adaa3a8d55259134887b43362a4f9c394776b2f Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sun, 16 May 2010 10:14:12 +0200 Subject: [PATCH] libdrm: - add some patches from fedora (permissions/ disable backwards compatibility) --- .../libdrm/patches/libdrm-2.4.0-no-bc.diff | 54 +++++++++++++++++++ .../patches/libdrm-make-dri-perms-okay.diff | 12 +++++ 2 files changed, 66 insertions(+) create mode 100644 packages/graphics/libdrm/patches/libdrm-2.4.0-no-bc.diff create mode 100644 packages/graphics/libdrm/patches/libdrm-make-dri-perms-okay.diff diff --git a/packages/graphics/libdrm/patches/libdrm-2.4.0-no-bc.diff b/packages/graphics/libdrm/patches/libdrm-2.4.0-no-bc.diff new file mode 100644 index 0000000000..ad14e2108f --- /dev/null +++ b/packages/graphics/libdrm/patches/libdrm-2.4.0-no-bc.diff @@ -0,0 +1,54 @@ +diff -up libdrm-20080814/xf86drm.c.no-bc libdrm-20080814/xf86drm.c +--- libdrm-20080814/xf86drm.c.no-bc 2008-08-14 15:43:09.000000000 +1000 ++++ libdrm-20080814/xf86drm.c 2008-08-14 15:45:09.000000000 +1000 +@@ -396,11 +396,6 @@ int drmAvailable(void) + int fd; + + if ((fd = drmOpenMinor(0, 1, DRM_NODE_RENDER)) < 0) { +-#ifdef __linux__ +- /* Try proc for backward Linux compatibility */ +- if (!access("/proc/dri/0", R_OK)) +- return 1; +-#endif + return 0; + } + +@@ -519,38 +514,6 @@ static int drmOpenByName(const char *nam + } + } + +-#ifdef __linux__ +- /* Backward-compatibility /proc support */ +- for (i = 0; i < 8; i++) { +- char proc_name[64], buf[512]; +- char *driver, *pt, *devstring; +- int retcode; +- +- sprintf(proc_name, "/proc/dri/%d/name", i); +- if ((fd = open(proc_name, 0, 0)) >= 0) { +- retcode = read(fd, buf, sizeof(buf)-1); +- close(fd); +- if (retcode) { +- buf[retcode-1] = '\0'; +- for (driver = pt = buf; *pt && *pt != ' '; ++pt) +- ; +- if (*pt) { /* Device is next */ +- *pt = '\0'; +- if (!strcmp(driver, name)) { /* Match */ +- for (devstring = ++pt; *pt && *pt != ' '; ++pt) +- ; +- if (*pt) { /* Found busid */ +- return drmOpenByBusid(++pt); +- } else { /* No busid */ +- return drmOpenDevice(strtol(devstring, NULL, 0),i, DRM_NODE_RENDER); +- } +- } +- } +- } +- } +- } +-#endif +- + return -1; + } + diff --git a/packages/graphics/libdrm/patches/libdrm-make-dri-perms-okay.diff b/packages/graphics/libdrm/patches/libdrm-make-dri-perms-okay.diff new file mode 100644 index 0000000000..0d82319f24 --- /dev/null +++ b/packages/graphics/libdrm/patches/libdrm-make-dri-perms-okay.diff @@ -0,0 +1,12 @@ +diff -up libdrm-20080303/xf86drm.h.da libdrm-20080303/xf86drm.h +--- libdrm-20080303/xf86drm.h.da 2008-03-19 15:26:31.000000000 +1000 ++++ libdrm-20080303/xf86drm.h 2008-03-19 15:26:46.000000000 +1000 +@@ -45,7 +45,7 @@ + /* Default /dev/dri directory permissions 0755 */ + #define DRM_DEV_DIRMODE \ + (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) +-#define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) ++#define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) + + #define DRM_DIR_NAME "/dev/dri" + #define DRM_DEV_NAME "%s/card%d"