diff options
author | sevan <sevan@pkgsrc.org> | 2015-04-11 10:02:10 +0000 |
---|---|---|
committer | sevan <sevan@pkgsrc.org> | 2015-04-11 10:02:10 +0000 |
commit | 293d0f7728fec9a54a7514452181af2d22af0348 (patch) | |
tree | 538beb832273f19c3f83cfcd656bc8418feb0652 /x11/libdrm | |
parent | 29d3a0d6f66b6cea40315fe00982130dee68cec2 (diff) | |
download | pkgsrc-293d0f7728fec9a54a7514452181af2d22af0348.tar.gz |
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 (limited to 'x11/libdrm')
-rw-r--r-- | x11/libdrm/distinfo | 4 | ||||
-rw-r--r-- | x11/libdrm/patches/patch-xf86drmMode.c | 52 |
2 files changed, 46 insertions, 10 deletions
diff --git a/x11/libdrm/distinfo b/x11/libdrm/distinfo index d05b282a826..5dc1addeed6 100644 --- a/x11/libdrm/distinfo +++ b/x11/libdrm/distinfo @@ -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-libkms_vmwgfx.c) = d49c046a70e5c0edbdb0a424473324cc2a3b6243 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 --git a/x11/libdrm/patches/patch-xf86drmMode.c b/x11/libdrm/patches/patch-xf86drmMode.c index a58fe4a5fed..bd843d66df0 100644 --- a/x11/libdrm/patches/patch-xf86drmMode.c +++ b/x11/libdrm/patches/patch-xf86drmMode.c @@ -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 @@ $NetBSD: patch-xf86drmMode.c,v 1.1 2014/10/26 10:20:10 wiz Exp $ + + 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 @@ $NetBSD: patch-xf86drmMode.c,v 1.1 2014/10/26 10:20:10 wiz Exp $ #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, |