From owner-svn-ports-head@freebsd.org Tue Mar 14 14:46:11 2017 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78001D0B4F6; Tue, 14 Mar 2017 14:46:11 +0000 (UTC) (envelope-from rezny@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38C52D34; Tue, 14 Mar 2017 14:46:11 +0000 (UTC) (envelope-from rezny@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2EEkAZU086680; Tue, 14 Mar 2017 14:46:10 GMT (envelope-from rezny@FreeBSD.org) Received: (from rezny@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2EEkAxc086678; Tue, 14 Mar 2017 14:46:10 GMT (envelope-from rezny@FreeBSD.org) Message-Id: <201703141446.v2EEkAxc086678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rezny set sender to rezny@FreeBSD.org using -f From: Matthew Rezny Date: Tue, 14 Mar 2017 14:46:10 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r436156 - in head/graphics/libdrm: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Mar 2017 14:46:11 -0000 Author: rezny Date: Tue Mar 14 14:46:10 2017 New Revision: 436156 URL: https://svnweb.freebsd.org/changeset/ports/436156 Log: Don't check device major ID, it's not always zero. Fixes Mesa 13 on drm-next Submitted by: hselasky Reported by: sbruno, hselasky, xmj Reviewed by: hselasky Approved by: swills (mentor) Differential Revision: https://reviews.freebsd.org/D10000 Modified: head/graphics/libdrm/Makefile head/graphics/libdrm/files/patch-xf86drm.c Modified: head/graphics/libdrm/Makefile ============================================================================== --- head/graphics/libdrm/Makefile Tue Mar 14 14:37:20 2017 (r436155) +++ head/graphics/libdrm/Makefile Tue Mar 14 14:46:10 2017 (r436156) @@ -4,7 +4,7 @@ PORTNAME= libdrm PORTVERSION= 2.4.75 PORTEPOCH= 1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= graphics x11 MASTER_SITES= http://dri.freedesktop.org/libdrm/ Modified: head/graphics/libdrm/files/patch-xf86drm.c ============================================================================== --- head/graphics/libdrm/files/patch-xf86drm.c Tue Mar 14 14:37:20 2017 (r436155) +++ head/graphics/libdrm/files/patch-xf86drm.c Tue Mar 14 14:46:10 2017 (r436156) @@ -30,7 +30,7 @@ } } -+#if !defined(__FreeBSD__) && !defined(__DragonFly__) ++#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__DragonFly__) static const char *drmGetMinorName(int type) { switch (type) { @@ -42,11 +42,20 @@ /** * Open the device by bus ID. +@@ -2734,7 +2744,7 @@ int drmGetNodeTypeFromFd(int fd) + maj = major(sbuf.st_rdev); + min = minor(sbuf.st_rdev); + +- if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode)) { ++ if (DRM_MAJOR && maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode)) { + errno = EINVAL; + return -1; + } @@ -2833,6 +2843,15 @@ static char *drmGetMinorNameForFD(int fd out_close_dir: closedir(sysdir); -+#elif defined(__FreeBSD__) || defined(__DragonFly__) ++#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) + struct stat buf; + char name[64]; + @@ -63,7 +72,7 @@ return -EINVAL; -#elif defined(__OpenBSD__) -+#elif defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) ++#elif defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) return DRM_BUS_PCI; #else #warning "Missing implementation of drmParseSubsystemType" @@ -71,7 +80,7 @@ #endif } -+#if defined(__FreeBSD__) || defined(__DragonFly__) ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) +/* + * XXX temporary workaround, because FreeBSD doesn't provide + * pcibus device sysctl trees for renderD and controlD nodes (yet) @@ -133,7 +142,7 @@ #endif } -+#if defined(__FreeBSD__) || defined(__DragonFly__) ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) +static int drmParsePciDeviceInfoBSD(const char *path, + drmPciDeviceInfoPtr device, + uint32_t flags) @@ -170,7 +179,7 @@ dev->businfo.pci = (drmPciBusInfoPtr)addr; -+#if defined(__FreeBSD__) || defined(__DragonFly__) ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) + ret = drmParsePciBusInfoBSD(node, dev->businfo.pci); +#else ret = drmParsePciBusInfo(maj, min, dev->businfo.pci); @@ -183,7 +192,7 @@ addr += sizeof(drmPciBusInfo); dev->deviceinfo.pci = (drmPciDeviceInfoPtr)addr; - -+#if defined(__FreeBSD__) || defined(__DragonFly__) ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) + ret = drmParsePciDeviceInfoBSD(node, dev->deviceinfo.pci, flags); +#else ret = drmParsePciDeviceInfo(maj, min, dev->deviceinfo.pci, flags); @@ -191,3 +200,39 @@ if (ret) goto free_device; } +@@ -3786,7 +3897,7 @@ int drmGetDevice2(int fd, uint32_t flags + maj = major(sbuf.st_rdev); + min = minor(sbuf.st_rdev); + +- if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode)) ++ if (DRM_MAJOR && maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode)) + return -EINVAL; + + subsystem_type = drmParseSubsystemType(maj, min); +@@ -3814,7 +3925,7 @@ int drmGetDevice2(int fd, uint32_t flags + maj = major(sbuf.st_rdev); + min = minor(sbuf.st_rdev); + +- if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode)) ++ if (DRM_MAJOR && maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode)) + continue; + + if (drmParseSubsystemType(maj, min) != subsystem_type) +@@ -3964,7 +4075,7 @@ int drmGetDevices2(uint32_t flags, drmDe + maj = major(sbuf.st_rdev); + min = minor(sbuf.st_rdev); + +- if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode)) ++ if (DRM_MAJOR && maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode)) + continue; + + subsystem_type = drmParseSubsystemType(maj, min); +@@ -4108,7 +4219,7 @@ char *drmGetDeviceNameFromFd2(int fd) + maj = major(sbuf.st_rdev); + min = minor(sbuf.st_rdev); + +- if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode)) ++ if (DRM_MAJOR && maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode)) + return NULL; + + node_type = drmGetMinorType(min);