diff -Nru libdrm-2.4.52+git1401210630.46d451~gd~s/configure.ac libdrm-2.4.52+git1401250630.cbb31f~gd~s/configure.ac --- libdrm-2.4.52+git1401210630.46d451~gd~s/configure.ac 2014-01-21 05:30:08.000000000 +0000 +++ libdrm-2.4.52+git1401250630.cbb31f~gd~s/configure.ac 2014-01-25 05:30:06.000000000 +0000 @@ -185,6 +185,8 @@ if test "x$LIBKMS" = xauto ; then case $host_os in linux*) LIBKMS="yes" ;; + freebsd* | kfreebsd*-gnu) + LIBKMS="yes" ;; *) LIBKMS="no" ;; esac fi diff -Nru libdrm-2.4.52+git1401210630.46d451~gd~s/debian/changelog libdrm-2.4.52+git1401250630.cbb31f~gd~s/debian/changelog --- libdrm-2.4.52+git1401210630.46d451~gd~s/debian/changelog 2014-01-21 05:30:09.000000000 +0000 +++ libdrm-2.4.52+git1401250630.cbb31f~gd~s/debian/changelog 2014-01-25 05:30:06.000000000 +0000 @@ -1,9 +1,9 @@ -libdrm (2.4.52+git1401210630.46d451~gd~s) saucy; urgency=medium +libdrm (2.4.52+git1401250630.cbb31f~gd~s) saucy; urgency=medium * Checkout from master git branch up to commit - 46d451c9a9514df9de01df647a3f397c5b5d7d1a + cbb31f2d6e674513c0f66484c414475baba09153 - -- Oibaf Tue, 21 Jan 2014 06:30:09 +0100 + -- Oibaf Sat, 25 Jan 2014 06:30:06 +0100 libdrm (2.4.46-1) unstable; urgency=low diff -Nru libdrm-2.4.52+git1401210630.46d451~gd~s/tests/modeprint/modeprint.c libdrm-2.4.52+git1401250630.cbb31f~gd~s/tests/modeprint/modeprint.c --- libdrm-2.4.52+git1401210630.46d451~gd~s/tests/modeprint/modeprint.c 2011-09-30 09:19:15.000000000 +0000 +++ libdrm-2.4.52+git1401250630.cbb31f~gd~s/tests/modeprint/modeprint.c 2014-01-25 05:30:06.000000000 +0000 @@ -41,6 +41,8 @@ #include "xf86drm.h" #include "xf86drmMode.h" +#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) + int connectors; int full_props; int edid; @@ -140,13 +142,37 @@ return 0; } +static const char * const output_names[] = { "None", + "VGA", + "DVI-I", + "DVI-D", + "DVI-A", + "Composite", + "SVIDEO", + "LVDS", + "Component", + "DIN", + "DP", + "HDMI-A", + "HDMI-B", + "TV", + "eDP", + "Virtual", + "DSI", +}; + int printConnector(int fd, drmModeResPtr res, drmModeConnectorPtr connector, uint32_t id) { int i = 0; struct drm_mode_modeinfo *mode = NULL; drmModePropertyPtr props; - printf("Connector: %d-%d\n", connector->connector_type, connector->connector_type_id); + if (connector->connector_type < ARRAY_SIZE(output_names)) + printf("Connector: %s-%d\n", output_names[connector->connector_type], + connector->connector_type_id); + else + printf("Connector: %d-%d\n", connector->connector_type, + connector->connector_type_id); printf("\tid : %i\n", id); printf("\tencoder id : %i\n", connector->encoder_id); printf("\tconn : %s\n", getConnectionText(connector->connection)); diff -Nru libdrm-2.4.52+git1401210630.46d451~gd~s/xf86drmMode.c libdrm-2.4.52+git1401250630.cbb31f~gd~s/xf86drmMode.c --- libdrm-2.4.52+git1401210630.46d451~gd~s/xf86drmMode.c 2014-01-21 05:30:08.000000000 +0000 +++ libdrm-2.4.52+git1401250630.cbb31f~gd~s/xf86drmMode.c 2014-01-25 05:30:06.000000000 +0000 @@ -723,7 +723,7 @@ */ int drmCheckModesettingSupported(const char *busid) { -#ifdef __linux__ +#if defined (__linux__) char pci_dev_dir[1024]; int domain, bus, dev, func; DIR *sysdir; @@ -773,6 +773,39 @@ closedir(sysdir); 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); + } #endif return -ENOSYS;