diff options
author | Niclas Zeising <zeising@FreeBSD.org> | 2018-05-16 15:33:08 +0000 |
---|---|---|
committer | Niclas Zeising <zeising@FreeBSD.org> | 2018-05-16 15:33:08 +0000 |
commit | d36c859681bbcae5756c7f1d82f6eef2bf59dee5 (patch) | |
tree | d2bf4decf26952d17e37dd4fd33b35bdea39ff7d /graphics/libdrm/files | |
parent | 203f337f911239a7d5bafc03cfac77f1d2b0bafb (diff) | |
download | ports-d36c859681bbcae5756c7f1d82f6eef2bf59dee5.tar.gz ports-d36c859681bbcae5756c7f1d82f6eef2bf59dee5.zip |
Notes
Diffstat (limited to 'graphics/libdrm/files')
-rw-r--r-- | graphics/libdrm/files/patch-libkms_vmwgfx.c | 8 | ||||
-rw-r--r-- | graphics/libdrm/files/patch-xf86drm.c | 86 | ||||
-rw-r--r-- | graphics/libdrm/files/patch-xf86drm.h | 9 | ||||
-rw-r--r-- | graphics/libdrm/files/patch-xf86drmMode.c | 11 |
4 files changed, 55 insertions, 59 deletions
diff --git a/graphics/libdrm/files/patch-libkms_vmwgfx.c b/graphics/libdrm/files/patch-libkms_vmwgfx.c index 202954253aeb..17e68b6c6191 100644 --- a/graphics/libdrm/files/patch-libkms_vmwgfx.c +++ b/graphics/libdrm/files/patch-libkms_vmwgfx.c @@ -4,11 +4,11 @@ # _WANT_KERNEL_ERRNO is too recent to be part of any release, so just # define ERESTART if we still don't have it after including errno.h # ---- libkms/vmwgfx.c.orig 2017-04-14 23:29:46 UTC +--- libkms/vmwgfx.c.orig 2018-05-09 22:26:03 UTC +++ libkms/vmwgfx.c -@@ -30,10 +30,18 @@ - #include "config.h" - #endif +@@ -26,10 +26,18 @@ + **************************************************************************/ + +#if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) +#define _WANT_KERNEL_ERRNO diff --git a/graphics/libdrm/files/patch-xf86drm.c b/graphics/libdrm/files/patch-xf86drm.c index 6a53c3e52f58..d9030294ae09 100644 --- a/graphics/libdrm/files/patch-xf86drm.c +++ b/graphics/libdrm/files/patch-xf86drm.c @@ -1,6 +1,6 @@ ---- xf86drm.c.orig 2017-07-25 19:15:41 UTC +--- xf86drm.c.orig 2018-05-13 08:59:08 UTC +++ xf86drm.c -@@ -49,6 +49,9 @@ +@@ -46,6 +46,9 @@ #include <signal.h> #include <time.h> #include <sys/types.h> @@ -10,7 +10,7 @@ #include <sys/stat.h> #define stat_t struct stat #include <sys/ioctl.h> -@@ -62,6 +65,10 @@ +@@ -59,6 +62,10 @@ #endif #include <math.h> @@ -21,7 +21,7 @@ /* Not all systems have MAP_FAILED defined */ #ifndef MAP_FAILED #define MAP_FAILED ((void *)-1) -@@ -72,18 +79,8 @@ +@@ -69,18 +76,8 @@ #include "util_math.h" @@ -41,7 +41,7 @@ #endif #ifdef __NetBSD__ -@@ -180,7 +177,7 @@ void drmFree(void *pt) +@@ -177,7 +174,7 @@ void drmFree(void *pt) } /** @@ -50,7 +50,7 @@ */ int drmIoctl(int fd, unsigned long request, void *arg) -@@ -223,6 +220,89 @@ drmHashEntry *drmGetEntry(int fd) +@@ -220,6 +217,89 @@ drmHashEntry *drmGetEntry(int fd) return entry; } @@ -140,7 +140,7 @@ /** * Compare two busid strings * -@@ -290,7 +370,7 @@ static int drmMatchBusID(const char *id1 +@@ -287,7 +367,7 @@ static int drmMatchBusID(const char *id1, const char * * * \internal * Checks for failure. If failure was caused by signal call chown again. @@ -148,8 +148,8 @@ + * If any other failure happened then it will output error message using * drmMsg() call. */ - #if !defined(UDEV) -@@ -327,8 +407,8 @@ static int chown_check_return(const char + #if !UDEV +@@ -324,8 +404,8 @@ static int chown_check_return(const char *path, uid_t static int drmOpenDevice(dev_t dev, int minor, int type) { stat_t st; @@ -160,7 +160,7 @@ int fd; mode_t devmode = DRM_DEV_MODE, serv_mode; gid_t serv_group; -@@ -338,21 +418,14 @@ static int drmOpenDevice(dev_t dev, int +@@ -335,21 +415,14 @@ static int drmOpenDevice(dev_t dev, int minor, int typ gid_t group = DRM_DEV_GID; #endif @@ -187,7 +187,7 @@ drmMsg("drmOpenDevice: node name is %s\n", buf); if (drm_server_info && drm_server_info->get_perms) { -@@ -456,27 +529,20 @@ wait_for_udev: +@@ -453,27 +526,20 @@ wait_for_udev: static int drmOpenMinor(int minor, int create, int type) { int fd; @@ -222,7 +222,7 @@ if ((fd = open(buf, O_RDWR, 0)) >= 0) return fd; return -errno; -@@ -517,51 +583,6 @@ int drmAvailable(void) +@@ -514,51 +580,6 @@ int drmAvailable(void) return retval; } @@ -274,7 +274,7 @@ /** * Open the device by bus ID. * -@@ -2703,33 +2724,40 @@ int drmDropMaster(int fd) +@@ -2737,33 +2758,40 @@ int drmDropMaster(int fd) char *drmGetDeviceNameFromFd(int fd) { @@ -328,7 +328,7 @@ int maj, min, type; if (fstat(fd, &sbuf)) -@@ -2747,6 +2775,7 @@ int drmGetNodeTypeFromFd(int fd) +@@ -2781,6 +2809,7 @@ int drmGetNodeTypeFromFd(int fd) if (type == -1) errno = ENODEV; return type; @@ -336,19 +336,19 @@ } int drmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags, int *prime_fd) -@@ -2786,7 +2815,7 @@ static char *drmGetMinorNameForFD(int fd +@@ -2820,7 +2849,7 @@ static char *drmGetMinorNameForFD(int fd, int type) #ifdef __linux__ DIR *sysdir; - struct dirent *pent, *ent; + struct dirent *ent; - struct stat sbuf; + stat_t sbuf; const char *name = drmGetMinorName(type); int len; char dev_name[64], buf[64]; -@@ -2837,13 +2866,35 @@ static char *drmGetMinorNameForFD(int fd - - out_close_dir: - closedir(sysdir); +@@ -2856,13 +2885,35 @@ static char *drmGetMinorNameForFD(int fd, int type) + } + } + return NULL; +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) + const char *dev_name = drmGetDeviceName(type); + if (!dev_name) @@ -384,7 +384,7 @@ if (fstat(fd, &sbuf)) return NULL; -@@ -2853,20 +2904,6 @@ out_close_dir: +@@ -2872,20 +2923,6 @@ static char *drmGetMinorNameForFD(int fd, int type) if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode)) return NULL; @@ -405,7 +405,7 @@ base = drmGetMinorBase(type); if (base < 0) return NULL; -@@ -2964,7 +3001,7 @@ static int drmParseSubsystemType(int maj +@@ -2982,7 +3019,7 @@ static int drmParseSubsystemType(int maj, int min) return DRM_BUS_HOST1X; return -EINVAL; @@ -414,7 +414,7 @@ return DRM_BUS_PCI; #else #warning "Missing implementation of drmParseSubsystemType" -@@ -2972,7 +3009,8 @@ static int drmParseSubsystemType(int maj +@@ -2990,7 +3027,8 @@ static int drmParseSubsystemType(int maj, int min) #endif } @@ -424,7 +424,7 @@ { #ifdef __linux__ unsigned int domain, bus, dev, func; -@@ -3021,6 +3059,60 @@ static int drmParsePciBusInfo(int maj, i +@@ -3039,6 +3077,60 @@ static int drmParsePciBusInfo(int maj, int min, drmPci info->func = pinfo.func; return 0; @@ -485,7 +485,7 @@ #else #warning "Missing implementation of drmParsePciBusInfo" return -EINVAL; -@@ -3055,32 +3147,6 @@ int drmDevicesEqual(drmDevicePtr a, drmD +@@ -3073,32 +3165,6 @@ int drmDevicesEqual(drmDevicePtr a, drmDevicePtr b) return 0; } @@ -518,7 +518,7 @@ #ifdef __linux__ static int parse_separate_sysfs_files(int maj, int min, drmPciDeviceInfoPtr device, -@@ -3150,6 +3216,7 @@ static int parse_config_sysfs_file(int m +@@ -3168,6 +3234,7 @@ static int parse_config_sysfs_file(int maj, int min, #endif static int drmParsePciDeviceInfo(int maj, int min, @@ -526,7 +526,7 @@ drmPciDeviceInfoPtr device, uint32_t flags) { -@@ -3186,6 +3253,43 @@ static int drmParsePciDeviceInfo(int maj +@@ -3204,6 +3271,43 @@ static int drmParsePciDeviceInfo(int maj, int min, device->subdevice_id = pinfo.subdevice_id; return 0; @@ -570,7 +570,7 @@ #else #warning "Missing implementation of drmParsePciDeviceInfo" return -EINVAL; -@@ -3266,7 +3370,7 @@ static drmDevicePtr drmDeviceAlloc(unsig +@@ -3284,7 +3388,7 @@ static drmDevicePtr drmDeviceAlloc(unsigned int type, unsigned int i; char *ptr; @@ -579,7 +579,7 @@ extra = DRM_NODE_MAX * (sizeof(void *) + max_node_length); size = sizeof(*device) + extra + bus_size + device_size; -@@ -3312,7 +3416,7 @@ static int drmProcessPciDevice(drmDevice +@@ -3330,7 +3434,7 @@ static int drmProcessPciDevice(drmDevicePtr *device, dev->businfo.pci = (drmPciBusInfoPtr)addr; @@ -588,7 +588,7 @@ if (ret) goto free_device; -@@ -3321,7 +3425,7 @@ static int drmProcessPciDevice(drmDevice +@@ -3339,7 +3443,7 @@ static int drmProcessPciDevice(drmDevicePtr *device, addr += sizeof(drmPciBusInfo); dev->deviceinfo.pci = (drmPciDeviceInfoPtr)addr; @@ -597,7 +597,7 @@ if (ret) goto free_device; } -@@ -3671,7 +3775,7 @@ static void drmFoldDuplicatedDevices(drm +@@ -3689,7 +3793,7 @@ static void drmFoldDuplicatedDevices(drmDevicePtr loca local_devices[i]->available_nodes |= local_devices[j]->available_nodes; node_type = log2(local_devices[j]->available_nodes); memcpy(local_devices[i]->nodes[node_type], @@ -606,7 +606,7 @@ drmFreeDevice(&local_devices[j]); } } -@@ -3689,7 +3793,7 @@ drm_device_validate_flags(uint32_t flags +@@ -3707,7 +3811,7 @@ drm_device_validate_flags(uint32_t flags) * Get information about the opened drm device * * \param fd file descriptor of the drm device @@ -615,7 +615,7 @@ * \param device the address of a drmDevicePtr where the information * will be allocated in stored * -@@ -3707,8 +3811,8 @@ int drmGetDevice2(int fd, uint32_t flags +@@ -3725,8 +3829,8 @@ int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr * Avoid stat'ing all of /dev needlessly by implementing this custom path. */ drmDevicePtr d; @@ -626,7 +626,7 @@ const char *dev_name; int node_type, subsystem_type; int maj, min, n, ret, base; -@@ -3729,26 +3833,16 @@ int drmGetDevice2(int fd, uint32_t flags +@@ -3747,26 +3851,16 @@ int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr if (node_type == -1) return -ENODEV; @@ -657,7 +657,7 @@ return -errno; if (stat(node, &sbuf)) return -EINVAL; -@@ -3769,8 +3863,8 @@ int drmGetDevice2(int fd, uint32_t flags +@@ -3787,8 +3881,8 @@ int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr drmDevicePtr d; DIR *sysdir; struct dirent *dent; @@ -668,7 +668,7 @@ int node_type, subsystem_type; int maj, min; int ret, i, node_count; -@@ -3790,7 +3884,7 @@ int drmGetDevice2(int fd, uint32_t flags +@@ -3808,7 +3902,7 @@ int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr maj = major(sbuf.st_rdev); min = minor(sbuf.st_rdev); @@ -677,7 +677,7 @@ return -EINVAL; subsystem_type = drmParseSubsystemType(maj, min); -@@ -3811,14 +3905,14 @@ int drmGetDevice2(int fd, uint32_t flags +@@ -3829,14 +3923,14 @@ int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr if (node_type < 0) continue; @@ -694,7 +694,7 @@ continue; if (drmParseSubsystemType(maj, min) != subsystem_type) -@@ -3916,7 +4010,7 @@ int drmGetDevice(int fd, drmDevicePtr *d +@@ -3934,7 +4028,7 @@ int drmGetDevice(int fd, drmDevicePtr *device) /** * Get drm devices on the system * @@ -703,7 +703,7 @@ * \param devices the array of devices with drmDevicePtr elements * can be NULL to get the device number first * \param max_devices the maximum number of devices for the array -@@ -3935,8 +4029,8 @@ int drmGetDevices2(uint32_t flags, drmDe +@@ -3953,8 +4047,8 @@ int drmGetDevices2(uint32_t flags, drmDevicePtr device drmDevicePtr device; DIR *sysdir; struct dirent *dent; @@ -714,7 +714,7 @@ int node_type, subsystem_type; int maj, min; int ret, i, node_count, device_count; -@@ -3961,14 +4055,14 @@ int drmGetDevices2(uint32_t flags, drmDe +@@ -3979,14 +4073,14 @@ int drmGetDevices2(uint32_t flags, drmDevicePtr device if (node_type < 0) continue; @@ -731,7 +731,7 @@ continue; subsystem_type = drmParseSubsystemType(maj, min); -@@ -4076,7 +4170,7 @@ int drmGetDevices(drmDevicePtr devices[] +@@ -4094,7 +4188,7 @@ int drmGetDevices(drmDevicePtr devices[], int max_devi char *drmGetDeviceNameFromFd2(int fd) { #ifdef __linux__ @@ -740,7 +740,7 @@ char path[PATH_MAX + 1], *value; unsigned int maj, min; -@@ -4099,9 +4193,26 @@ char *drmGetDeviceNameFromFd2(int fd) +@@ -4117,9 +4211,26 @@ char *drmGetDeviceNameFromFd2(int fd) free(value); return strdup(path); @@ -769,7 +769,7 @@ const char *dev_name; int node_type; int maj, min, n, base; -@@ -4119,26 +4230,16 @@ char *drmGetDeviceNameFromFd2(int fd) +@@ -4137,26 +4248,16 @@ char *drmGetDeviceNameFromFd2(int fd) if (node_type == -1) return NULL; diff --git a/graphics/libdrm/files/patch-xf86drm.h b/graphics/libdrm/files/patch-xf86drm.h index f054be787e6e..177ddd95b7d7 100644 --- a/graphics/libdrm/files/patch-xf86drm.h +++ b/graphics/libdrm/files/patch-xf86drm.h @@ -1,6 +1,6 @@ ---- xf86drm.h.orig 2017-04-07 08:49:13 UTC +--- xf86drm.h.orig 2018-03-05 21:06:45 UTC +++ xf86drm.h -@@ -78,17 +78,27 @@ extern "C" { +@@ -78,16 +78,26 @@ extern "C" { #ifdef __OpenBSD__ #define DRM_DIR_NAME "/dev" @@ -20,7 +20,7 @@ +#define DRM_CONTROL_MINOR_NAME "controlD" +#define DRM_RENDER_MINOR_NAME "renderD" #endif - ++ +#define DRM_DEV_NAME "%s/" DRM_PRIMARY_MINOR_NAME "%d" +#define DRM_CONTROL_DEV_NAME "%s/" DRM_CONTROL_MINOR_NAME "%d" +#define DRM_RENDER_DEV_NAME "%s/" DRM_RENDER_MINOR_NAME "%d" @@ -31,7 +31,6 @@ + sizeof(DRM_CONTROL_MINOR_NAME), \ + sizeof(DRM_RENDER_MINOR_NAME)) \ + + 3) /* length of the node number */ -+ + #define DRM_ERR_NO_DEVICE (-1001) #define DRM_ERR_NO_ACCESS (-1002) - #define DRM_ERR_NOT_ROOT (-1003) diff --git a/graphics/libdrm/files/patch-xf86drmMode.c b/graphics/libdrm/files/patch-xf86drmMode.c index 35c7458d84c8..878b17e7ba0f 100644 --- a/graphics/libdrm/files/patch-xf86drmMode.c +++ b/graphics/libdrm/files/patch-xf86drmMode.c @@ -1,6 +1,6 @@ ---- xf86drmMode.c.orig 2017-04-07 08:49:13 UTC +--- xf86drmMode.c.orig 2018-05-13 10:01:15 UTC +++ xf86drmMode.c -@@ -47,6 +47,7 @@ +@@ -43,6 +43,7 @@ #include <stdlib.h> #include <sys/ioctl.h> #ifdef HAVE_SYS_SYSCTL_H @@ -8,7 +8,7 @@ #include <sys/sysctl.h> #endif #include <stdio.h> -@@ -796,43 +797,60 @@ int drmCheckModesettingSupported(const c +@@ -792,41 +793,59 @@ int drmCheckModesettingSupported(const char *busid) closedir(sysdir); if (found) return 0; @@ -95,9 +95,6 @@ } -#elif defined(__DragonFly__) - return 0; --#endif --#ifdef __OpenBSD__ -+#elif defined(__OpenBSD__) + #elif defined(__OpenBSD__) int fd; struct drm_mode_card_res res; - drmModeResPtr r = 0; |