diff options
author | Matthieu Herrb <matthieu@herrb.eu> | 2020-08-16 11:48:22 +0200 |
---|---|---|
committer | Matthieu Herrb <matthieu@herrb.eu> | 2020-08-16 12:36:33 +0200 |
commit | 6d6a3b19718d4ca26c9debddd67cc23cbfe63d13 (patch) | |
tree | 49b8a8bebc5c66e9e863103a18a48c0db32f9eae /sysutils/libdrm/patches/patch-xf86drm_c | |
parent | 7b37172033f776bf36f1eea532751d3f59cd01a6 (diff) |
Update to libdrm 2.4.100
Diffstat (limited to 'sysutils/libdrm/patches/patch-xf86drm_c')
-rw-r--r-- | sysutils/libdrm/patches/patch-xf86drm_c | 102 |
1 files changed, 7 insertions, 95 deletions
diff --git a/sysutils/libdrm/patches/patch-xf86drm_c b/sysutils/libdrm/patches/patch-xf86drm_c index 835484b..2a1decb 100644 --- a/sysutils/libdrm/patches/patch-xf86drm_c +++ b/sysutils/libdrm/patches/patch-xf86drm_c @@ -3,7 +3,7 @@ $OpenBSD$ Index: xf86drm.c --- xf86drm.c.orig +++ xf86drm.c -@@ -101,6 +101,10 @@ +@@ -91,6 +91,10 @@ #define DRM_MAJOR 226 /* Linux */ #endif @@ -14,9 +14,9 @@ Index: xf86drm.c #if defined(__OpenBSD__) || defined(__DragonFly__) struct drm_pciinfo { uint16_t domain; -@@ -310,6 +314,18 @@ static int chown_check_return(const char *path, uid_t +@@ -313,6 +317,18 @@ static const char *drmGetDeviceName(int type) + return NULL; } - #endif +#ifdef X_PRIVSEP +static int @@ -33,7 +33,7 @@ Index: xf86drm.c /** * Open the DRM device, creating it if necessary. * -@@ -360,6 +376,7 @@ static int drmOpenDevice(dev_t dev, int minor, int typ +@@ -352,6 +368,7 @@ static int drmOpenDevice(dev_t dev, int minor, int typ devmode &= ~(S_IXUSR|S_IXGRP|S_IXOTH); } @@ -41,7 +41,7 @@ Index: xf86drm.c #if !UDEV if (stat(DRM_DIR_NAME, &st)) { if (!isroot) -@@ -406,14 +423,19 @@ wait_for_udev: +@@ -398,14 +415,19 @@ wait_for_udev: } } #endif @@ -62,8 +62,8 @@ Index: xf86drm.c /* Check if the device node is not what we expect it to be, and recreate it * and try again if so. */ -@@ -476,8 +498,13 @@ static int drmOpenMinor(int minor, int create, int typ - }; +@@ -457,8 +479,13 @@ static int drmOpenMinor(int minor, int create, int typ + return -EINVAL; sprintf(buf, dev_name, DRM_DIR_NAME, minor); - if ((fd = open(buf, O_RDWR | O_CLOEXEC, 0)) >= 0) @@ -78,91 +78,3 @@ Index: xf86drm.c return -errno; } -@@ -2904,7 +2931,7 @@ static char *drmGetMinorNameForFD(int fd, int type) - char buf[PATH_MAX + 1]; - const char *dev_name; - unsigned int maj, min; -- int n, base; -+ int n; - - if (fstat(fd, &sbuf)) - return NULL; -@@ -2929,11 +2956,7 @@ static char *drmGetMinorNameForFD(int fd, int type) - return NULL; - }; - -- base = drmGetMinorBase(type); -- if (base < 0) -- return NULL; -- -- n = snprintf(buf, sizeof(buf), dev_name, DRM_DIR_NAME, min - base); -+ n = snprintf(buf, sizeof(buf), dev_name, DRM_DIR_NAME, min); - if (n == -1 || n >= sizeof(buf)) - return NULL; - -@@ -3141,10 +3164,6 @@ drm_public int drmDevicesEqual(drmDevicePtr a, drmDevi - - static int drmGetNodeType(const char *name) - { -- if (strncmp(name, DRM_PRIMARY_MINOR_NAME, -- sizeof(DRM_PRIMARY_MINOR_NAME) - 1) == 0) -- return DRM_NODE_PRIMARY; -- - if (strncmp(name, DRM_CONTROL_MINOR_NAME, - sizeof(DRM_CONTROL_MINOR_NAME ) - 1) == 0) - return DRM_NODE_CONTROL; -@@ -3153,6 +3172,10 @@ static int drmGetNodeType(const char *name) - sizeof(DRM_RENDER_MINOR_NAME) - 1) == 0) - return DRM_NODE_RENDER; - -+ if (strncmp(name, DRM_PRIMARY_MINOR_NAME, -+ sizeof(DRM_PRIMARY_MINOR_NAME) - 1) == 0) -+ return DRM_NODE_PRIMARY; -+ - return -EINVAL; - } - -@@ -3827,7 +3850,7 @@ drm_public int drmGetDevice2(int fd, uint32_t flags, d - char node[PATH_MAX + 1]; - const char *dev_name; - int node_type, subsystem_type; -- int maj, min, n, ret, base; -+ int maj, min, n, ret; - - if (fd == -1 || device == NULL) - return -EINVAL; -@@ -3859,11 +3882,7 @@ drm_public int drmGetDevice2(int fd, uint32_t flags, d - return -EINVAL; - }; - -- base = drmGetMinorBase(node_type); -- if (base < 0) -- return -EINVAL; -- -- n = snprintf(node, PATH_MAX, dev_name, DRM_DIR_NAME, min - base); -+ n = snprintf(node, PATH_MAX, dev_name, DRM_DIR_NAME, min); - if (n == -1 || n >= PATH_MAX) - return -errno; - if (stat(node, &sbuf)) -@@ -4083,7 +4102,7 @@ drm_public char *drmGetDeviceNameFromFd2(int fd) - char node[PATH_MAX + 1]; - const char *dev_name; - int node_type; -- int maj, min, n, base; -+ int maj, min, n; - - if (fstat(fd, &sbuf)) - return NULL; -@@ -4112,11 +4131,7 @@ drm_public char *drmGetDeviceNameFromFd2(int fd) - return NULL; - }; - -- base = drmGetMinorBase(node_type); -- if (base < 0) -- return NULL; -- -- n = snprintf(node, PATH_MAX, dev_name, DRM_DIR_NAME, min - base); -+ n = snprintf(node, PATH_MAX, dev_name, DRM_DIR_NAME, min); - if (n == -1 || n >= PATH_MAX) - return NULL; - |