aboutsummaryrefslogtreecommitdiff
path: root/graphics/libdrm
diff options
context:
space:
mode:
authorKoop Mast <kwm@FreeBSD.org>2014-10-18 13:17:26 +0000
committerKoop Mast <kwm@FreeBSD.org>2014-10-18 13:17:26 +0000
commited2b9a630636c24c2e5f38d393497d358b036b48 (patch)
tree7a3da6b03d5a1b017971af9fd8869a18d0439622 /graphics/libdrm
parent779ac153ed83972b0b5bb3250137980daee078a0 (diff)
downloadports-ed2b9a630636c24c2e5f38d393497d358b036b48.tar.gz
ports-ed2b9a630636c24c2e5f38d393497d358b036b48.zip
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 has a chance of loading a KMS module. This went unnoticed because I preload my KMS modules at boot. Submitted by: tijl@
Notes
Notes: svn path=/head/; revision=371123
Diffstat (limited to 'graphics/libdrm')
-rw-r--r--graphics/libdrm/Makefile1
-rw-r--r--graphics/libdrm/files/patch-xf86drmMode.c46
2 files changed, 47 insertions, 0 deletions
diff --git a/graphics/libdrm/Makefile b/graphics/libdrm/Makefile
index 1e6cfbd5bb33..cebf98c46d80 100644
--- a/graphics/libdrm/Makefile
+++ b/graphics/libdrm/Makefile
@@ -3,6 +3,7 @@
PORTNAME= libdrm
PORTVERSION= 2.4.58
+PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= graphics x11
MASTER_SITES= http://dri.freedesktop.org/libdrm/
diff --git a/graphics/libdrm/files/patch-xf86drmMode.c b/graphics/libdrm/files/patch-xf86drmMode.c
new file mode 100644
index 000000000000..852a2c4147a9
--- /dev/null
+++ b/graphics/libdrm/files/patch-xf86drmMode.c
@@ -0,0 +1,46 @@
+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 2014-08-27 20:04:46.000000000 +0200
++++ xf86drmMode.c 2014-10-18 15:12:02.586937600 +0200
+@@ -774,38 +774,7 @@
+ 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 -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);
+- }
++ return 0;
+ #elif defined(__DragonFly__)
+ return 0;
+ #endif