pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/x11/libdrm On FreeBSD, remove checks for hw.dri.%d.mod...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3f181cacc6d4
branches:  trunk
changeset: 649845:3f181cacc6d4
user:      sevan <sevan%pkgsrc.org@localhost>
date:      Sat Apr 11 10:02:10 2015 +0000

description:
On FreeBSD, remove checks for hw.dri.%d.modesetting which is only present if a suitable
KMS module is loaded. Resolves build issue.

Patch obtained from FreeBSD ports.

Reviewed by wiz@ bsiegert@

diffstat:

 x11/libdrm/distinfo                    |   4 +-
 x11/libdrm/patches/patch-xf86drmMode.c |  52 ++++++++++++++++++++++++++++-----
 2 files changed, 46 insertions(+), 10 deletions(-)

diffs (91 lines):

diff -r b2bc3c70e979 -r 3f181cacc6d4 x11/libdrm/distinfo
--- a/x11/libdrm/distinfo       Sat Apr 11 08:51:30 2015 +0000
+++ b/x11/libdrm/distinfo       Sat Apr 11 10:02:10 2015 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.51 2015/04/03 16:09:37 tnn Exp $
+$NetBSD: distinfo,v 1.52 2015/04/11 10:02:10 sevan Exp $
 
 SHA1 (libdrm-2.4.60.tar.bz2) = 4e041a5ff22b2b9132b216eb0574638bf252b7a9
 RMD160 (libdrm-2.4.60.tar.bz2) = 01b3dde0786dea020850a35058ee2be507829293
@@ -12,5 +12,5 @@
 SHA1 (patch-radeon_radeon__bo__gem.c) = 4924fde172b2a2a713d47bf7b60a6b52851d7a8f
 SHA1 (patch-radeon_radeon__cs__gem.c) = 516b5dd6408c10a4f33f2815b3719e34a16d863a
 SHA1 (patch-xf86atomic.h) = 49fce331dc287a26fc4c9de4a1d121d83a68d883
-SHA1 (patch-xf86drmMode.c) = bb453075acd6e2ac8dcc588048c1d642defbf248
+SHA1 (patch-xf86drmMode.c) = 508a1e4bae40243c5445ec51084e760279d35ba6
 SHA1 (patch-xf86drmMode.h) = a28b02887389be8670193c119f711901af61a6b2
diff -r b2bc3c70e979 -r 3f181cacc6d4 x11/libdrm/patches/patch-xf86drmMode.c
--- a/x11/libdrm/patches/patch-xf86drmMode.c    Sat Apr 11 08:51:30 2015 +0000
+++ b/x11/libdrm/patches/patch-xf86drmMode.c    Sat Apr 11 10:02:10 2015 +0000
@@ -1,11 +1,25 @@
-$NetBSD: patch-xf86drmMode.c,v 1.1 2014/10/26 10:20:10 wiz Exp $
+$NetBSD: patch-xf86drmMode.c,v 1.2 2015/04/11 10:02:11 sevan Exp $
 
---- xf86drmMode.c.orig 2014-08-27 18:04:46.000000000 +0000
+Disable checking for hw.dri.%d.modesetting.
+This sysctl is only available if a KMS module is loaded. But the libdrm
+check happens before X got a chance of loading the KMS module.
+
+--- xf86drmMode.c.orig 2015-03-18 17:33:36.000000000 +0000
 +++ xf86drmMode.c
-@@ -806,6 +806,19 @@ int drmCheckModesettingSupported(const c
-                       return -EINVAL;
-               return (modesetting ? 0 : -ENOSYS);
-       }
+@@ -771,38 +771,20 @@ int drmCheckModesettingSupported(const c
+       if (found)
+               return 0;
+ #elif defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
+-      char kbusid[1024], sbusid[1024];
+-      char oid[128];
+-      int domain, bus, dev, func;
+-      int i, modesetting, ret;
+-      size_t len;
+-
+-      ret = sscanf(busid, "pci:%04x:%02x:%02x.%d", &domain, &bus, &dev,
+-          &func);
+-      if (ret != 4)
++      return 0;
 +#elif defined(__NetBSD__)
 +      int fd;
 +      static const struct drm_mode_card_res zero_res;
@@ -14,7 +28,29 @@
 + 
 +      fd = drmOpen(NULL, busid);
 +      if (fd == -1)
-+              return -EINVAL;
+               return -EINVAL;
+-      snprintf(kbusid, sizeof(kbusid), "pci:%04x:%02x:%02x.%d", domain, bus,
+-          dev, func);
+-
+-      /* How many GPUs do we expect in the machine ? */
+-      for (i = 0; i < 16; i++) {
+-              snprintf(oid, sizeof(oid), "hw.dri.%d.busid", i);
+-              len = sizeof(sbusid);
+-              ret = sysctlbyname(oid, sbusid, &len, NULL, 0);
+-              if (ret == -1) {
+-                      if (errno == ENOENT)
+-                              continue;
+-                      return -EINVAL;
+-              }
+-              if (strcmp(sbusid, kbusid) != 0)
+-                      continue;
+-              snprintf(oid, sizeof(oid), "hw.dri.%d.modesetting", i);
+-              len = sizeof(modesetting);
+-              ret = sysctlbyname(oid, &modesetting, &len, NULL, 0);
+-              if (ret == -1 || len != sizeof(modesetting))
+-                      return -EINVAL;
+-              return (modesetting ? 0 : -ENOSYS);
+-      }
 +      ret = drmIoctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &res);
 +      drmClose(fd);
 +      if (ret == 0)
@@ -22,7 +58,7 @@
  #elif defined(__DragonFly__)
        return 0;
  #endif
-@@ -908,7 +921,7 @@ int drmModePageFlip(int fd, uint32_t crt
+@@ -907,7 +889,7 @@ int drmModePageFlip(int fd, uint32_t crt
  
  int drmModeSetPlane(int fd, uint32_t plane_id, uint32_t crtc_id,
                    uint32_t fb_id, uint32_t flags,



Home | Main Index | Thread Index | Old Index