From owner-svn-ports-all@freebsd.org Tue Apr 10 00:18:47 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03C73F8AFD2; Tue, 10 Apr 2018 00:18:47 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A868F70FA4; Tue, 10 Apr 2018 00:18:46 +0000 (UTC) (envelope-from jbeich@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A342525E30; Tue, 10 Apr 2018 00:18:46 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3A0IkVq064689; Tue, 10 Apr 2018 00:18:46 GMT (envelope-from jbeich@FreeBSD.org) Received: (from jbeich@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3A0Ik0h064687; Tue, 10 Apr 2018 00:18:46 GMT (envelope-from jbeich@FreeBSD.org) Message-Id: <201804100018.w3A0Ik0h064687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jbeich set sender to jbeich@FreeBSD.org using -f From: Jan Beich Date: Tue, 10 Apr 2018 00:18:46 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r466930 - in branches/2018Q2/graphics/mesa-dri: . files X-SVN-Group: ports-branches X-SVN-Commit-Author: jbeich X-SVN-Commit-Paths: in branches/2018Q2/graphics/mesa-dri: . files X-SVN-Commit-Revision: 466930 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 00:18:47 -0000 Author: jbeich Date: Tue Apr 10 00:18:46 2018 New Revision: 466930 URL: https://svnweb.freebsd.org/changeset/ports/466930 Log: MFH: r466924 graphics/mesa-dri: fix device name detection for Wayland/EGL PR: 223030 Submitted by: Greg V Obtained from: upstream (Mesa 18.0.0) Approved by: maintainer timeout (4 months) Approved by: ports-secteam blanket Added: branches/2018Q2/graphics/mesa-dri/files/patch-src_loader_loader.c - copied unchanged from r466924, head/graphics/mesa-dri/files/patch-src_loader_loader.c Modified: branches/2018Q2/graphics/mesa-dri/Makefile Directory Properties: branches/2018Q2/ (props changed) Modified: branches/2018Q2/graphics/mesa-dri/Makefile ============================================================================== --- branches/2018Q2/graphics/mesa-dri/Makefile Tue Apr 10 00:18:04 2018 (r466929) +++ branches/2018Q2/graphics/mesa-dri/Makefile Tue Apr 10 00:18:46 2018 (r466930) @@ -3,7 +3,7 @@ PORTNAME= mesa-dri PORTVERSION= ${MESAVERSION} -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= graphics COMMENT= OpenGL hardware acceleration drivers for DRI2+ Copied: branches/2018Q2/graphics/mesa-dri/files/patch-src_loader_loader.c (from r466924, head/graphics/mesa-dri/files/patch-src_loader_loader.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2018Q2/graphics/mesa-dri/files/patch-src_loader_loader.c Tue Apr 10 00:18:46 2018 (r466930, copy of r466924, head/graphics/mesa-dri/files/patch-src_loader_loader.c) @@ -0,0 +1,68 @@ +commit db8519a369261cdedda50852facc45616d4eba28 +Author: Greg V +Date: Mon Oct 23 23:20:40 2017 +0300 + + loader: use drmGetDeviceNameFromFd2 from libdrm + + Reduce code duplication and automatically benefit from OS-specific + fixes to libdrm (e.g. in FreeBSD ports). + + API was introduced with 2.4.74 and we already require 2.4.75 globally. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103283 + Reviewed-by: Eric Engestrom + Reviewed-by: Emil Velikov + +--- src/loader/loader.c.orig 2017-12-21 17:31:21 UTC ++++ src/loader/loader.c +@@ -245,30 +245,7 @@ int loader_get_user_preferred_fd(int default_fd, bool + #endif + + #if defined(HAVE_LIBDRM) +-static int +-dev_node_from_fd(int fd, unsigned int *maj, unsigned int *min) +-{ +- struct stat buf; + +- if (fstat(fd, &buf) < 0) { +- log_(_LOADER_WARNING, "MESA-LOADER: failed to stat fd %d\n", fd); +- return -1; +- } +- +- if (!S_ISCHR(buf.st_mode)) { +- log_(_LOADER_WARNING, "MESA-LOADER: fd %d not a character device\n", fd); +- return -1; +- } +- +- *maj = major(buf.st_rdev); +- *min = minor(buf.st_rdev); +- +- return 0; +-} +-#endif +- +-#if defined(HAVE_LIBDRM) +- + static int + drm_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id) + { +@@ -312,18 +289,7 @@ loader_get_pci_id_for_fd(int fd, int *vendor_id, int * + static char * + drm_get_device_name_for_fd(int fd) + { +- unsigned int maj, min; +- char buf[0x40]; +- int n; +- +- if (dev_node_from_fd(fd, &maj, &min) < 0) +- return NULL; +- +- n = snprintf(buf, sizeof(buf), DRM_DEV_NAME, DRM_DIR_NAME, min); +- if (n == -1 || n >= sizeof(buf)) +- return NULL; +- +- return strdup(buf); ++ return drmGetDeviceNameFromFd2(fd); + } + #endif +