Date: Sat, 18 Oct 2014 13:17:27 +0000 (UTC) From: Koop Mast <kwm@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r371123 - in head/graphics/libdrm: . files Message-ID: <201410181317.s9IDHROn037602@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410181317.s9IDHROn037602>