pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

libdrm-dfbsd: Update wip/libdrm-dfbsd to 2.4.75



Module Name:	pkgsrc-wip
Committed By:	David Shao <davshao%gmail.com@localhost>
Pushed By:	dshao
Date:		Mon Feb 13 21:43:16 2017 -0800
Changeset:	647960660a01a881f98b6a6c3e249c40918b5a70

Modified Files:
	libdrm-dfbsd/Makefile
	libdrm-dfbsd/distinfo
	libdrm-dfbsd/patches/patch-ab

Log Message:
libdrm-dfbsd: Update wip/libdrm-dfbsd to 2.4.75

Changes:
* Merged in NetBSD patches to upstream changes for OpenBSD to xf86drm.c.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=647960660a01a881f98b6a6c3e249c40918b5a70

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 libdrm-dfbsd/Makefile         |   4 +-
 libdrm-dfbsd/distinfo         |  12 +-
 libdrm-dfbsd/patches/patch-ab | 282 +++++++++++++++++++++---------------------
 3 files changed, 148 insertions(+), 150 deletions(-)

diffs:
diff --git a/libdrm-dfbsd/Makefile b/libdrm-dfbsd/Makefile
index b8e79133e1..faee8bbee9 100644
--- a/libdrm-dfbsd/Makefile
+++ b/libdrm-dfbsd/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.67 2016/11/30 12:37:40 wiz Exp $
+# $NetBSD: Makefile,v 1.68 2017/02/02 18:39:08 wiz Exp $
 
-DISTNAME=		libdrm-2.4.74
+DISTNAME=		libdrm-2.4.75
 CATEGORIES=		x11 graphics
 MASTER_SITES=		http://dri.freedesktop.org/libdrm/
 EXTRACT_SUFX=		.tar.bz2
diff --git a/libdrm-dfbsd/distinfo b/libdrm-dfbsd/distinfo
index 7502588dea..67f7ab5b14 100644
--- a/libdrm-dfbsd/distinfo
+++ b/libdrm-dfbsd/distinfo
@@ -1,10 +1,10 @@
-$NetBSD: distinfo,v 1.67 2016/11/30 12:37:40 wiz Exp $
+$NetBSD: distinfo,v 1.68 2017/02/02 18:39:08 wiz Exp $
 
-SHA1 (libdrm-2.4.74.tar.bz2) = 0d9c02d5d2c6c2fac862cb687bf45bc20d129017
-RMD160 (libdrm-2.4.74.tar.bz2) = 8ebc6e850ab576928c011f7b2d1e67fc42d37209
-SHA512 (libdrm-2.4.74.tar.bz2) = 5b9784bf00bb8179ad59f2fbe5600b51ede3f79dd1ea2cb50485ffaabf74e83d766b2deb6833b99692a303e6780286ecce41b88a2d7c15f9e839bc7182a8879d
-Size (libdrm-2.4.74.tar.bz2) = 781730 bytes
-SHA1 (patch-ab) = 9e9db1e44618f0072e2dfcbb24fb3268c944ecdf
+SHA1 (libdrm-2.4.75.tar.bz2) = 335c088a9b20c6ce1e113e7d6104c54e8f365f88
+RMD160 (libdrm-2.4.75.tar.bz2) = 884db510421504acf4707b79cb907cc4879ba30a
+SHA512 (libdrm-2.4.75.tar.bz2) = 7d30029dfc384024eb6a82a04122064366572f5888ac4594fd9e02bc0a22ed2d154bef1840bd24f0543b77460d6359d7e424d424e10f4256ee3c898041be2292
+Size (libdrm-2.4.75.tar.bz2) = 774589 bytes
+SHA1 (patch-ab) = a6b975875c2cc24a3d034be8cfdd87f47d8e9e99
 SHA1 (patch-ac) = 67c998df7dfc0dabc86320ea6d015cede3e464ea
 SHA1 (patch-include_drm_drm.h) = 48a912f40bf2b2a1c23edbe4446fa7869212f17b
 SHA1 (patch-libkms_vmwgfx.c) = d2204c0b79098c6c36b7f282b486c58c6354bd1d
diff --git a/libdrm-dfbsd/patches/patch-ab b/libdrm-dfbsd/patches/patch-ab
index 1892aff218..01b7ef2fbe 100644
--- a/libdrm-dfbsd/patches/patch-ab
+++ b/libdrm-dfbsd/patches/patch-ab
@@ -9,7 +9,7 @@ Tries to account for DragonFly major number not well defined.
 
 Tries to account for FreeBSD device control64D to be ignored.
 
---- xf86drm.c.orig	2016-11-29 11:15:10.000000000 +0000
+--- xf86drm.c.orig	2017-01-28 01:15:16.000000000 +0000
 +++ xf86drm.c
 @@ -31,6 +31,36 @@
   * DEALINGS IN THE SOFTWARE.
@@ -85,31 +85,29 @@ Tries to account for FreeBSD device control64D to be ignored.
  #endif
  
  #ifdef __OpenBSD__
-@@ -102,6 +146,23 @@
+@@ -102,7 +146,7 @@
  #define DRM_MAJOR 226 /* Linux */
  #endif
  
-+#if defined(__NetBSD__)
-+/* From OpenBSD xenocara/lib/libdrm/xf86drm.c */
-+struct drm_pciinfo {
-+        uint16_t        domain;
-+        uint8_t         bus;
-+        uint8_t         dev;
-+        uint8_t         func;
-+        uint16_t        vendor_id;
-+        uint16_t        device_id;
-+        uint16_t        subvendor_id;
-+        uint16_t        subdevice_id;
-+        uint8_t         revision_id;
-+};
-+
-+#define DRM_IOCTL_GET_PCIINFO   DRM_IOR(0x0f, struct drm_pciinfo)
+-#ifdef __OpenBSD__
++#if defined(__OpenBSD__) || defined(__NetBSD__)
+ struct drm_pciinfo {
+ 	uint16_t	domain;
+ 	uint8_t		bus;
+@@ -114,8 +158,12 @@ struct drm_pciinfo {
+ 	uint16_t	subdevice_id;
+ 	uint8_t		revision_id;
+ };
 +#endif
-+
- #define DRM_MSG_VERBOSITY 3
  
- #define memclear(s) memset(&s, 0, sizeof(s))
-@@ -532,6 +593,7 @@ static int drmGetMinorType(int minor)
++#if defined(__OpenBSD__)
+ #define DRM_IOCTL_GET_PCIINFO	DRM_IOR(0x15, struct drm_pciinfo)
++#elif defined(__NetBSD__)
++#define DRM_IOCTL_GET_PCIINFO   DRM_IOR(0x0f, struct drm_pciinfo)
+ #endif
+ 
+ #define DRM_MSG_VERBOSITY 3
+@@ -548,6 +596,7 @@ static int drmGetMinorType(int minor)
      }
  }
  
@@ -117,7 +115,7 @@ Tries to account for FreeBSD device control64D to be ignored.
  static const char *drmGetMinorName(int type)
  {
      switch (type) {
-@@ -545,6 +607,7 @@ static const char *drmGetMinorName(int t
+@@ -561,6 +610,7 @@ static const char *drmGetMinorName(int t
          return NULL;
      }
  }
@@ -125,7 +123,7 @@ Tries to account for FreeBSD device control64D to be ignored.
  
  /**
   * Open the device by bus ID.
-@@ -2718,7 +2781,11 @@ int drmGetNodeTypeFromFd(int fd)
+@@ -2734,7 +2784,11 @@ int drmGetNodeTypeFromFd(int fd)
      maj = major(sbuf.st_rdev);
      min = minor(sbuf.st_rdev);
  
@@ -137,7 +135,7 @@ Tries to account for FreeBSD device control64D to be ignored.
          errno = EINVAL;
          return -1;
      }
-@@ -2817,6 +2884,15 @@ static char *drmGetMinorNameForFD(int fd
+@@ -2833,6 +2887,15 @@ static char *drmGetMinorNameForFD(int fd
  
  out_close_dir:
      closedir(sysdir);
@@ -151,12 +149,12 @@ Tries to account for FreeBSD device control64D to be ignored.
 +
 +    return strdup(name);
  #else
- #warning "Missing implementation of drmGetMinorNameForFD"
- #endif
-@@ -2854,6 +2930,12 @@ static int drmParseSubsystemType(int maj
-         return DRM_BUS_PCI;
- 
+     struct stat sbuf;
+     char buf[PATH_MAX + 1];
+@@ -2962,6 +3025,12 @@ static int drmParseSubsystemType(int maj
      return -EINVAL;
+ #elif defined(__OpenBSD__)
+     return DRM_BUS_PCI;
 +#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__)
 +    /* XXX: Don't know how to get the subsystem type, hardcode for now.
 +     * The code following the call to this function needs depends on
@@ -166,35 +164,39 @@ Tries to account for FreeBSD device control64D to be ignored.
  #else
  #warning "Missing implementation of drmParseSubsystemType"
      return -EINVAL;
-@@ -2896,6 +2978,82 @@ static int drmParsePciBusInfo(int maj, i
+@@ -2993,18 +3062,27 @@ static int drmParsePciBusInfo(int maj, i
      info->func = func;
  
      return 0;
-+#elif defined(__NetBSD__)
-+/* From OpenBSD xenocara/lib/libdrm/xf86drm.c */
-+    struct drm_pciinfo pinfo;
-+    int fd;
-+
-+    drmMsg("NetBSD: drmParsePciBusInfo(): Before drmOpenMinor min (%d)\n", min);
-+
-+    fd = drmOpenMinor(min, 0, DRM_NODE_PRIMARY);
-+    if (fd < 0)
-+        return -errno;
-+
-+    drmMsg("Before drmIoctl (0x0f) using fd (%d)\n", fd);
+-#elif defined(__OpenBSD__)
++#elif defined(__OpenBSD__) || defined(__NetBSD__)
+     struct drm_pciinfo pinfo;
+     int fd, type;
+ 
++    drmMsg("drmParsePciBusInfo()\n");
++    drmMsg("Before drmGetMinorType: min (%d)\n", min);
 +
-+    if (drmIoctl(fd, DRM_IOCTL_GET_PCIINFO, &pinfo)) {
-+        close(fd);
-+        return -errno;
-+    }
-+    close(fd);
+     type = drmGetMinorType(min);
+     if (type == -1)
+         return -ENODEV;
+ 
++    drmMsg("Before drmOpenMinor: type (%d), DRM_NODE_PRIMARY (%d)\n",
++        type, DRM_NODE_PRIMARY);
 +
-+    info->domain = pinfo.domain;
-+    info->bus = pinfo.bus;
-+    info->dev = pinfo.dev;
-+    info->func = pinfo.func;
+     fd = drmOpenMinor(min, 0, type);
+     if (fd < 0)
+         return -errno;
+ 
++    drmMsg("Before drmIoctl: ioctl (0x%02x) using fd (%d)\n",
++        DRM_IOCTL_GET_PCIINFO, fd);
 +
-+    return 0;
+     if (drmIoctl(fd, DRM_IOCTL_GET_PCIINFO, &pinfo)) {
+         close(fd);
+         return -errno;
+@@ -3017,6 +3095,57 @@ static int drmParsePciBusInfo(int maj, i
+     info->func = pinfo.func;
+ 
+     return 0;
 +#elif (defined(__FreeBSD__) || defined(__DragonFly__))
 +/* Read the hw.dri.$min.busid sysctl
 + * Adapted from function devq_device_get_pcibusaddr(),
@@ -249,9 +251,9 @@ Tries to account for FreeBSD device control64D to be ignored.
  #else
  #warning "Missing implementation of drmParsePciBusInfo"
      return -EINVAL;
-@@ -2946,8 +3104,87 @@ static int drmGetMaxNodeName(void)
-            3 /* length of the node number */;
+@@ -3145,9 +3274,89 @@ static int parse_config_sysfs_file(int m
  }
+ #endif
  
 +#if defined(__FreeBSD__) || defined(__DragonFly__)
 +/* Uses function of name prefixed by devq_
@@ -327,50 +329,51 @@ Tries to account for FreeBSD device control64D to be ignored.
 +#endif
 +
 +#if !defined(__FreeBSD__) && !defined(__DragonFly__)
- static int drmParsePciDeviceInfo(const char *d_name,
-                                  drmPciDeviceInfoPtr device)
+ static int drmParsePciDeviceInfo(int maj, int min,
+                                  drmPciDeviceInfoPtr device,
+                                  uint32_t flags)
 +#else
-+static int drmParsePciDeviceInfoBSD(const char *d_name,
++static int drmParsePciDeviceInfoBSD(int maj, int min,
 +                                 drmPciDeviceInfoPtr device,
-+                                 drmPciBusInfoPtr info)
++                                 drmPciBusInfoPtr info,
++                                 uint32_t flags)
 +#endif
  {
  #ifdef __linux__
-     char path[PATH_MAX + 1];
-@@ -2971,6 +3208,112 @@ static int drmParsePciDeviceInfo(const c
-     device->subdevice_id = config[46] | (config[47] << 8);
+     if (!(flags & DRM_DEVICE_GET_PCI_REVISION))
+@@ -3157,18 +3366,27 @@ static int drmParsePciDeviceInfo(int maj
+         return parse_config_sysfs_file(maj, min, device);
  
      return 0;
-+#elif defined(__NetBSD__)
-+/* From OpenBSD xenocara/lib/libdrm/xf86drm.c */
-+    struct drm_pciinfo pinfo;
-+    char buf[PATH_MAX + 1];
-+    int fd, n;
-+
-+    n = snprintf(buf, sizeof(buf), "%s/%s", DRM_DIR_NAME, d_name);
-+    if (n == -1 || n >= sizeof(buf))
-+        return -errno;
-+
-+    drmMsg("NetBSD: drmParsePciDeviceInfo(): open (%s)\n", buf);
-+    fd = open(buf, O_RDWR, 0);
-+
-+    if (fd < 0)
-+        return -errno;
+-#elif defined(__OpenBSD__)
++#elif defined(__OpenBSD__) || defined(__NetBSD__)
+     struct drm_pciinfo pinfo;
+     int fd, type;
+ 
++    drmMsg("drmParsePciDeviceInfo()\n");
++    drmMsg("Before drmGetMinorType: min (%d)\n", min);
 +
-+    drmMsg("Before drmIoctl (0x0f) with fd (%d)\n", fd);
-+    if (drmIoctl(fd, DRM_IOCTL_GET_PCIINFO, &pinfo)) {
-+        close(fd);
-+        return -errno;
-+    }
-+    close(fd);
+     type = drmGetMinorType(min);
+     if (type == -1)
+         return -ENODEV;
+ 
++    drmMsg("Before drmOpenMinor: type (%d), DRM_NODE_PRIMARY (%d)\n",
++        type, DRM_NODE_PRIMARY);
 +
-+    device->vendor_id = pinfo.vendor_id;
-+    device->device_id = pinfo.device_id;
-+    device->revision_id = pinfo.revision_id;
-+    device->subvendor_id = pinfo.subvendor_id;
-+    device->subdevice_id = pinfo.subdevice_id;
+     fd = drmOpenMinor(min, 0, type);
+     if (fd < 0)
+         return -errno;
+ 
++    drmMsg("Before drmIoctl: ioctl (0x%02x) using fd (%d)\n",
++        DRM_IOCTL_GET_PCIINFO, fd);
 +
-+    return 0;
+     if (drmIoctl(fd, DRM_IOCTL_GET_PCIINFO, &pinfo)) {
+         close(fd);
+         return -errno;
+@@ -3182,6 +3400,82 @@ static int drmParsePciDeviceInfo(int maj
+     device->subdevice_id = pinfo.subdevice_id;
+ 
+     return 0;
 +#elif defined(__FreeBSD__) || defined(__DragonFly__)
 +/* Adapted from function devq_device_get_pciid_full_from_fd(),
 + * from libdevq 0.0.4, file src/freebsd/device.c,
@@ -450,72 +453,73 @@ Tries to account for FreeBSD device control64D to be ignored.
  #else
  #warning "Missing implementation of drmParsePciDeviceInfo"
      return -EINVAL;
-@@ -3006,6 +3349,9 @@ static int drmProcessPciDevice(drmDevice
-     int ret, i;
+@@ -3299,6 +3593,9 @@ static int drmProcessPciDevice(drmDevice
      char *addr;
+     int ret;
  
 +    drmMsg("libdrm, file xf86drm.c, drmProcessPciDevice() called\n");
 +    drmMsg("    node (%s), node_type (%d)\n", node, node_type);
 +
-     *device = calloc(1, sizeof(drmDevice) +
-                      (DRM_NODE_MAX * (sizeof(void *) + max_node_str)) +
-                      sizeof(drmPciBusInfo) +
-@@ -3030,19 +3376,41 @@ static int drmProcessPciDevice(drmDevice
+     dev = drmDeviceAlloc(node_type, node, sizeof(drmPciBusInfo),
+                          sizeof(drmPciDeviceInfo), &addr);
+     if (!dev)
+@@ -3308,18 +3605,39 @@ static int drmProcessPciDevice(drmDevice
  
-     (*device)->businfo.pci = (drmPciBusInfoPtr)addr;
+     dev->businfo.pci = (drmPciBusInfoPtr)addr;
  
 +    drmMsg("Before drmParsePciBusInfo(): maj (%d), min (%d)\n", maj, min);
-     ret = drmParsePciBusInfo(maj, min, (*device)->businfo.pci);
+     ret = drmParsePciBusInfo(maj, min, dev->businfo.pci);
 +    drmMsg("After  drmParsePciBusInfo(): return value (%d)\n", ret);
 +
      if (ret)
          goto free_device;
  
-+    drmMsg("d domain == %04x\n", (*device)->businfo.pci->domain);
-+    drmMsg("d bus    == %02x\n", (*device)->businfo.pci->bus);
-+    drmMsg("d dev    == %02x\n", (*device)->businfo.pci->dev);
-+    drmMsg("d func   == %1u\n", (*device)->businfo.pci->func);
++    drmMsg("d domain == %04x\n", dev->businfo.pci->domain);
++    drmMsg("d bus    == %02x\n", dev->businfo.pci->bus);
++    drmMsg("d dev    == %02x\n", dev->businfo.pci->dev);
++    drmMsg("d func   == %1u\n",  dev->businfo.pci->func);
 +
      // Fetch the device info if the user has requested it
      if (fetch_deviceinfo) {
          addr += sizeof(drmPciBusInfo);
-         (*device)->deviceinfo.pci = (drmPciDeviceInfoPtr)addr;
+         dev->deviceinfo.pci = (drmPciDeviceInfoPtr)addr;
  
-+        drmMsg("Before drmParsePciDeviceInfo(): d_name (%s)\n", d_name);
++        drmMsg("Before drmParsePciDeviceInfo(): maj (%d), min (%d), flags (%d)\n",
++            maj, min, flags);
++
 +#if defined(__FreeBSD__) || defined(__DragonFly__)
-+        ret = drmParsePciDeviceInfoBSD(d_name, (*device)->deviceinfo.pci,
-+                                               (*device)->businfo.pci);
++        ret = drmParsePciDeviceInfoBSD(maj, min, dev->deviceinfo.pci, dev->businfo.pci, flags);
 +#else
-         ret = drmParsePciDeviceInfo(d_name, (*device)->deviceinfo.pci);
+         ret = drmParsePciDeviceInfo(maj, min, dev->deviceinfo.pci, flags);
 +#endif
-+        drmMsg("After  drmParsePciDeviceInfo(): return value (%d)\n", ret);
          if (ret)
              goto free_device;
-     }
-+
-+    drmMsg("d vendor_id    == %04x\n", (*device)->deviceinfo.pci->vendor_id);
-+    drmMsg("d device_id    == %04x\n", (*device)->deviceinfo.pci->device_id);
-+    drmMsg("d subvendor_id == %04x\n", (*device)->deviceinfo.pci->subvendor_id);
-+    drmMsg("d subdevice_id == %04x\n", (*device)->deviceinfo.pci->subdevice_id);
-+    drmMsg("d revision_id  == %02x\n", (*device)->deviceinfo.pci->revision_id);
 +
-     return 0;
++            drmMsg("d vendor_id    == %04x\n", dev->deviceinfo.pci->vendor_id);
++            drmMsg("d device_id    == %04x\n", dev->deviceinfo.pci->device_id);
++            drmMsg("d subvendor_id == %04x\n", dev->deviceinfo.pci->subvendor_id);
++            drmMsg("d subdevice_id == %04x\n", dev->deviceinfo.pci->subdevice_id);
++            drmMsg("d revision_id  == %02x\n", dev->deviceinfo.pci->revision_id);
+     }
  
- free_device:
-@@ -3096,6 +3464,8 @@ int drmGetDevice(int fd, drmDevicePtr *d
+     *device = dev;
+@@ -3773,6 +4091,11 @@ int drmGetDevice2(int fd, uint32_t flags
      int max_count = 16;
      dev_t find_rdev;
  
-+    drmMsg("libdrm, file xf86drm.c, drmGetDevice(): fd == %d\n", fd);
++    drmMsg("libdrm, file xf86drm.c, drmGetDevice2(): fd (%d)\n", fd);
 +
-     if (fd == -1 || device == NULL)
++    drmMsg("Before drm_device_validate_flags: flags (%d), DRM_DEVICE_GET_PCI_REVISION (%d)\n",
++        flags, DRM_DEVICE_GET_PCI_REVISION);
++
+     if (drm_device_validate_flags(flags))
          return -EINVAL;
  
-@@ -3106,15 +3476,35 @@ int drmGetDevice(int fd, drmDevicePtr *d
+@@ -3786,15 +4109,35 @@ int drmGetDevice2(int fd, uint32_t flags
      maj = major(sbuf.st_rdev);
      min = minor(sbuf.st_rdev);
  
-+    drmMsg("DRM_MAJOR == %d, fd maj == %d, min == %d\n", DRM_MAJOR, maj, min);
++    drmMsg("DRM_MAJOR (%d), fd maj (%d), min (%d)\n", DRM_MAJOR, maj, min);
 +
      if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode))
 +#if defined(__DragonFly__)
@@ -536,7 +540,7 @@ Tries to account for FreeBSD device control64D to be ignored.
 +#endif
  
      subsystem_type = drmParseSubsystemType(maj, min);
-+    drmMsg("fd subsystem_type == %d\n", subsystem_type);
++    drmMsg("fd subsystem_type (%d)\n", subsystem_type);
  
      local_devices = calloc(max_count, sizeof(drmDevicePtr));
      if (local_devices == NULL)
@@ -547,7 +551,7 @@ Tries to account for FreeBSD device control64D to be ignored.
      sysdir = opendir(DRM_DIR_NAME);
      if (!sysdir) {
          ret = -errno;
-@@ -3123,10 +3513,20 @@ int drmGetDevice(int fd, drmDevicePtr *d
+@@ -3803,10 +4146,22 @@ int drmGetDevice2(int fd, uint32_t flags
  
      i = 0;
      while ((dent = readdir(sysdir))) {
@@ -555,12 +559,14 @@ Tries to account for FreeBSD device control64D to be ignored.
 +        drmMsg("Examining dent->d_name (%s)\n", dent->d_name);
 +
          node_type = drmGetNodeType(dent->d_name);
++
++        drmMsg("Examining node_type (%d)\n", node_type);
++
          if (node_type < 0)
              continue;
  
 +#if defined(__FreeBSD__)
 +/* FreeBSD has /dev/dri/control64D devices which are not relevant */
-+        drmMsg("Examining node_type (%d)\n", node_type);
 +        if (node_type > 0)
 +            continue;
 +#endif
@@ -568,7 +574,7 @@ Tries to account for FreeBSD device control64D to be ignored.
          snprintf(node, PATH_MAX, "%s/%s", DRM_DIR_NAME, dent->d_name);
          if (stat(node, &sbuf))
              continue;
-@@ -3134,16 +3534,32 @@ int drmGetDevice(int fd, drmDevicePtr *d
+@@ -3814,15 +4169,37 @@ int drmGetDevice2(int fd, uint32_t flags
          maj = major(sbuf.st_rdev);
          min = minor(sbuf.st_rdev);
  
@@ -583,6 +589,7 @@ Tries to account for FreeBSD device control64D to be ignored.
  
 +        drmMsg("    and subsystem_type (%d) compared to DRM_BUS_PCI (%d)\n",
 +            drmParseSubsystemType(maj, min), DRM_BUS_PCI);
++
          if (drmParseSubsystemType(maj, min) != subsystem_type)
              continue;
  
@@ -594,27 +601,18 @@ Tries to account for FreeBSD device control64D to be ignored.
 +
          switch (subsystem_type) {
          case DRM_BUS_PCI:
-+            drmMsg("Before drmProcessPciDevice(): card (%d), node_type (%d)\n", min, node_type);
-             ret = drmProcessPciDevice(&d, dent->d_name, node, node_type,
-                                       maj, min, true);
++
++            drmMsg("Before drmProcessPciDevice(): min (%d), node_type (%d)\n",
++                min, node_type);
++
+             ret = drmProcessPciDevice(&d, node, node_type, maj, min, true, flags);
++
 +            drmMsg("After drmProcessPciDevice():  return value (%d)\n", ret);
++
              if (ret)
-                 goto free_devices;
- 
-@@ -3234,6 +3650,12 @@ int drmGetDevices(drmDevicePtr devices[]
-         if (node_type < 0)
-             continue;
+                 continue;
  
-+#if defined(__FreeBSD__)
-+/* FreeBSD has /dev/dri/control64D devices which are not relevant */
-+        if (node_type > 0)
-+            continue;
-+#endif
-+
-         snprintf(node, PATH_MAX, "%s/%s", DRM_DIR_NAME, dent->d_name);
-         if (stat(node, &sbuf))
-             continue;
-@@ -3241,7 +3663,11 @@ int drmGetDevices(drmDevicePtr devices[]
+@@ -3964,7 +4341,11 @@ int drmGetDevices2(uint32_t flags, drmDe
          maj = major(sbuf.st_rdev);
          min = minor(sbuf.st_rdev);
  


Home | Main Index | Thread Index | Old Index