svn commit: r371123 - in head/graphics/libdrm: . files
Koop Mast
kwm at FreeBSD.org
Sat Oct 18 13:17:28 UTC 2014
Author: kwm
Date: Sat Oct 18 13:17:26 2014
New Revision: 371123
URL: https://svnweb.freebsd.org/changeset/ports/371123
QAT: https://qat.redports.org/buildarchive/r371123/
Log:
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@
Added:
head/graphics/libdrm/files/
head/graphics/libdrm/files/patch-xf86drmMode.c (contents, props changed)
Modified:
head/graphics/libdrm/Makefile
Modified: head/graphics/libdrm/Makefile
==============================================================================
--- head/graphics/libdrm/Makefile Sat Oct 18 13:14:09 2014 (r371122)
+++ head/graphics/libdrm/Makefile Sat Oct 18 13:17:26 2014 (r371123)
@@ -3,6 +3,7 @@
PORTNAME= libdrm
PORTVERSION= 2.4.58
+PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= graphics x11
MASTER_SITES= http://dri.freedesktop.org/libdrm/
Added: head/graphics/libdrm/files/patch-xf86drmMode.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/graphics/libdrm/files/patch-xf86drmMode.c Sat Oct 18 13:17:26 2014 (r371123)
@@ -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
More information about the svn-ports-head
mailing list