Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Jun 2017 14:02:35 +0000 (UTC)
From:      Matthew Rezny <rezny@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r443828 - in head/graphics: libosmesa mesa-dri mesa-dri/files
Message-ID:  <201706181402.v5IE2ZSk074722@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rezny
Date: Sun Jun 18 14:02:35 2017
New Revision: 443828
URL: https://svnweb.freebsd.org/changeset/ports/443828

Log:
  Update the Mesa ports to 17.1.2
  
  - patch the Intel driver to re-enable hardware acceleration on 10.x [1]
  
  Reported by:	cpm [1]
  Approved by:	swills (mentor)
  Differential Revision:	https://reviews.freebsd.org/D11148

Added:
  head/graphics/mesa-dri/files/extra-src_mesa_drivers_dri_i965_intel__screen.c   (contents, props changed)
Modified:
  head/graphics/libosmesa/Makefile
  head/graphics/mesa-dri/Makefile
  head/graphics/mesa-dri/Makefile.common
  head/graphics/mesa-dri/Makefile.targets
  head/graphics/mesa-dri/distinfo
  head/graphics/mesa-dri/files/configure.ac
  head/graphics/mesa-dri/files/patch-configure

Modified: head/graphics/libosmesa/Makefile
==============================================================================
--- head/graphics/libosmesa/Makefile	Sun Jun 18 13:16:52 2017	(r443827)
+++ head/graphics/libosmesa/Makefile	Sun Jun 18 14:02:35 2017	(r443828)
@@ -9,6 +9,12 @@ COMMENT=	Off-Screen Mesa implementation of the OpenGL 
 
 USE_XORG=	glproto
 
+# As of version 17.0.5 / 17.1.2, the Gallium variant fails to build due to
+# incorrectly ordered linker flags. Fortunately, autoreconf fixes the problem.
+# Unfortunately, we must reconf before we know if we're doing a Gallium build.
+USES=		autoreconf
+EXTRA_PATCHES=	${PATCHDIR}/configure.ac
+
 .include <bsd.port.options.mk>
 .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
 

Modified: head/graphics/mesa-dri/Makefile
==============================================================================
--- head/graphics/mesa-dri/Makefile	Sun Jun 18 13:16:52 2017	(r443827)
+++ head/graphics/mesa-dri/Makefile	Sun Jun 18 14:02:35 2017	(r443828)
@@ -42,19 +42,21 @@ GALLIUM_DRIVERS=	""
  || ${ARCH} == powerpc || ${ARCH} == powerpc64
 DRI_DRIVERS+=		RADEON R200
 GALLIUM_DRIVERS+=	R300 R600
-.if "${MESA_LLVM_VER}" != ""	# until PPC gets LLVM in base
+. if "${MESA_LLVM_VER}" != ""	# until PPC gets LLVM in base
 GALLIUM_DRIVERS+=	RADEONSI
+. endif
 .endif
-.endif
 .if ${ARCH} == amd64 || ${ARCH} == i386
 DRI_DRIVERS+=		I915 I965
 GALLIUM_DRIVERS+=	SVGA
+. if ${OPSYS} == FreeBSD && ${OSVERSION} < 1100000
+EXTRA_PATCHES+=	${PATCHDIR}/extra-src_mesa_drivers_dri_i965_intel__screen.c
+. endif
 .elif ${ARCH} == armv6 || ${ARCH} == aarch64
 GALLIUM_DRIVERS+=	FREEDRENO VC4
-.endif
-
-.if ${ARCH} == armv6
+. if ${ARCH} == armv6
 EXTRA_PATCHES+=	${PATCHDIR}/extra-src_gallium_drivers_vc4_Makefile.in
+. endif
 .endif
 
 CONFIGURE_ARGS+=	--with-dri-drivers="${DRI_DRIVERS:tl}" \

Modified: head/graphics/mesa-dri/Makefile.common
==============================================================================
--- head/graphics/mesa-dri/Makefile.common	Sun Jun 18 13:16:52 2017	(r443827)
+++ head/graphics/mesa-dri/Makefile.common	Sun Jun 18 14:02:35 2017	(r443828)
@@ -14,7 +14,7 @@
 MESAVERSION=	${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/}
 MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/}
 
-MESABASEVERSION=	17.1.1
+MESABASEVERSION=	17.1.2
 # if there is a subversion, don't include the '-' between 7.11-rc2.
 MESASUBVERSION=
 

Modified: head/graphics/mesa-dri/Makefile.targets
==============================================================================
--- head/graphics/mesa-dri/Makefile.targets	Sun Jun 18 13:16:52 2017	(r443827)
+++ head/graphics/mesa-dri/Makefile.targets	Sun Jun 18 14:02:35 2017	(r443828)
@@ -5,13 +5,19 @@
 post-patch:
 .if ${OPSYS} == FreeBSD
 	@${REINPLACE_CMD} -e 's|x86_64|amd64|' ${WRKSRC}/configure
+. if ${COMPONENT} == osmesa
+	@${REINPLACE_CMD} -e 's|x86_64|amd64|' ${WRKSRC}/configure.ac
+. endif
 # Disable use of GCC_ATOMICs on i386 to avoid build failures
 # Clang in 10.3 fails with cannot compile this atomic library call yet 'p_atomic_add'
 # Clang in 11.0 fails with undefined reference to `__atomic_fetch_add_8`
-.if ${ARCH} == "i386"
+. if ${ARCH} == "i386"
 	@${REINPLACE_CMD} -e 's|-DUSE_GCC_ATOMIC_BUILTINS||' ${WRKSRC}/configure
+.  if ${COMPONENT} == osmesa
+	@${REINPLACE_CMD} -e 's|-DUSE_GCC_ATOMIC_BUILTINS||' ${WRKSRC}/configure.ac
+.  endif
+. endif
 .endif
-.endif # ${OPSYS}
 	@${REINPLACE_CMD} -e 's|/etc/|${PREFIX}/etc/|g' \
 		${WRKSRC}/src/mesa/drivers/dri/common/xmlconfig.c
 

Modified: head/graphics/mesa-dri/distinfo
==============================================================================
--- head/graphics/mesa-dri/distinfo	Sun Jun 18 13:16:52 2017	(r443827)
+++ head/graphics/mesa-dri/distinfo	Sun Jun 18 14:02:35 2017	(r443828)
@@ -1,3 +1,3 @@
-TIMESTAMP = 1495896958
-SHA256 (mesa-17.1.1.tar.xz) = aed503f94c0c1630a162a3e276f4ee12a86764cee4cb92338ea2dea99a04e7ef
-SIZE (mesa-17.1.1.tar.xz) = 9854480
+TIMESTAMP = 1496724371
+SHA256 (mesa-17.1.2.tar.xz) = 0937804f43746339b1f9540d8f9c8b4a1bb3d3eec0e4020eac283b8799798239
+SIZE (mesa-17.1.2.tar.xz) = 9837516

Modified: head/graphics/mesa-dri/files/configure.ac
==============================================================================
--- head/graphics/mesa-dri/files/configure.ac	Sun Jun 18 13:16:52 2017	(r443827)
+++ head/graphics/mesa-dri/files/configure.ac	Sun Jun 18 14:02:35 2017	(r443828)
@@ -9,15 +9,6 @@
      dri3_default=yes
      ;;
  *)
-@@ -1631,7 +1631,7 @@ dnl platform checks. Set DEFINES and LIB
- if test "x$enable_dri" = xyes; then
-     # Platform specific settings and drivers to build
-     case "$host_os" in
--    linux*)
-+    linux* | freebsd*)
-         if test "x$enable_dri3" = xyes; then
-             DEFINES="$DEFINES -DHAVE_DRI3"
-         fi
 @@ -2002,9 +2002,18 @@ if test "x$enable_opencl" = xyes; then
          AC_MSG_ERROR([cannot enable OpenCL without Gallium])
      fi

Added: head/graphics/mesa-dri/files/extra-src_mesa_drivers_dri_i965_intel__screen.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/mesa-dri/files/extra-src_mesa_drivers_dri_i965_intel__screen.c	Sun Jun 18 14:02:35 2017	(r443828)
@@ -0,0 +1,37 @@
+# Partial revert of the following commit because the feature check fails on 10.x
+# which disables HW accel on gen4+ (the new check occurs for gen6+ as well)
+
+From 088449487ebcb72561d73ffb91c96302583445a8 Mon Sep 17 00:00:00 2001
+From: Kenneth Graunke <kenneth@whitecape.org>
+Date: Wed, 22 Mar 2017 15:20:51 -0700
+Subject: i965: Require Kernel 3.6 for Gen4-5 platforms.
+
+We've already required Kernel 3.6 on Gen6+ since Mesa 9.2 (May 2013,
+commit 92d2f5acfadea672417b6785710c9e8b7f605e41).  It seems reasonable
+to require it for Gen4-5 as well, bumping the requirement from 2.6.39.
+
+This is necessary for glClientWaitSync with a timeout to work, which
+is a feature we expose on Gen4-5.  Without it, we would fall back to an
+infinite wait, which is pretty bad.
+
+See kernel commit 172cf15d18889313bf2c3bfb81fcea08369274ef in 3.6+.
+
+Reviewed-by: Matt Turner <mattst88@gmail.com>
+
+diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
+index c7f111d..bc998ab 100644
+--- src/mesa/drivers/dri/i965/intel_screen.c
++++ src/mesa/drivers/dri/i965/intel_screen.c
+@@ -1274,8 +1274,8 @@ intel_init_bufmgr(struct intel_screen *screen)
+ 
+    drm_intel_bufmgr_gem_enable_fenced_relocs(screen->bufmgr);
+ 
+-   if (!intel_get_boolean(screen, I915_PARAM_HAS_WAIT_TIMEOUT)) {
+-      fprintf(stderr, "[%s: %u] Kernel 3.6 required.\n", __func__, __LINE__);
++   if (!intel_get_boolean(screen, I915_PARAM_HAS_RELAXED_DELTA)) {
++      fprintf(stderr, "[%s: %u] Kernel 2.6.39 required.\n", __func__, __LINE__);
+       return false;
+    }
+ 
+-- 
+cgit v0.10.2

Modified: head/graphics/mesa-dri/files/patch-configure
==============================================================================
--- head/graphics/mesa-dri/files/patch-configure	Sun Jun 18 13:16:52 2017	(r443827)
+++ head/graphics/mesa-dri/files/patch-configure	Sun Jun 18 14:02:35 2017	(r443828)
@@ -9,15 +9,6 @@
      dri3_default=yes
      ;;
  *)
-@@ -24108,7 +24108,7 @@ fi
- if test "x$enable_dri" = xyes; then
-     # Platform specific settings and drivers to build
-     case "$host_os" in
--    linux*)
-+    linux* | freebsd*)
-         if test "x$enable_dri3" = xyes; then
-             DEFINES="$DEFINES -DHAVE_DRI3"
-         fi
 @@ -25972,9 +25972,19 @@ if test "x$enable_opencl" = xyes; then
          as_fn_error $? "cannot enable OpenCL without Gallium" "$LINENO" 5
      fi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706181402.v5IE2ZSk074722>