From f4b4c28f25ac56ad7f30c37a7700a6a4560953b1 Mon Sep 17 00:00:00 2001 From: Matthew Rezny Date: Sun, 18 Jun 2017 14:02:35 +0000 Subject: [PATCH] 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 --- graphics/libosmesa/Makefile | 6 +++ graphics/mesa-dri/Makefile | 12 +++--- graphics/mesa-dri/Makefile.common | 2 +- graphics/mesa-dri/Makefile.targets | 10 ++++- graphics/mesa-dri/distinfo | 6 +-- graphics/mesa-dri/files/configure.ac | 9 ----- ...-src_mesa_drivers_dri_i965_intel__screen.c | 37 +++++++++++++++++++ graphics/mesa-dri/files/patch-configure | 9 ----- 8 files changed, 62 insertions(+), 29 deletions(-) create mode 100644 graphics/mesa-dri/files/extra-src_mesa_drivers_dri_i965_intel__screen.c diff --git a/graphics/libosmesa/Makefile b/graphics/libosmesa/Makefile index de324b088a60..c3d9cd79cdda 100644 --- a/graphics/libosmesa/Makefile +++ b/graphics/libosmesa/Makefile @@ -9,6 +9,12 @@ COMMENT= Off-Screen Mesa implementation of the OpenGL API 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 .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" diff --git a/graphics/mesa-dri/Makefile b/graphics/mesa-dri/Makefile index 4f16ca6253fc..beca61bc9461 100644 --- a/graphics/mesa-dri/Makefile +++ b/graphics/mesa-dri/Makefile @@ -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}" \ diff --git a/graphics/mesa-dri/Makefile.common b/graphics/mesa-dri/Makefile.common index a7e7ef53303c..eb4b6b0e0214 100644 --- a/graphics/mesa-dri/Makefile.common +++ b/graphics/mesa-dri/Makefile.common @@ -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= diff --git a/graphics/mesa-dri/Makefile.targets b/graphics/mesa-dri/Makefile.targets index ef92d271891e..fcf2ea9b9c9f 100644 --- a/graphics/mesa-dri/Makefile.targets +++ b/graphics/mesa-dri/Makefile.targets @@ -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 diff --git a/graphics/mesa-dri/distinfo b/graphics/mesa-dri/distinfo index af98d6f0eba6..de90dce7b059 100644 --- a/graphics/mesa-dri/distinfo +++ b/graphics/mesa-dri/distinfo @@ -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 diff --git a/graphics/mesa-dri/files/configure.ac b/graphics/mesa-dri/files/configure.ac index 1fdf8ec86794..44577f288558 100644 --- a/graphics/mesa-dri/files/configure.ac +++ b/graphics/mesa-dri/files/configure.ac @@ -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 diff --git a/graphics/mesa-dri/files/extra-src_mesa_drivers_dri_i965_intel__screen.c b/graphics/mesa-dri/files/extra-src_mesa_drivers_dri_i965_intel__screen.c new file mode 100644 index 000000000000..704aad20f611 --- /dev/null +++ b/graphics/mesa-dri/files/extra-src_mesa_drivers_dri_i965_intel__screen.c @@ -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 +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 + +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 diff --git a/graphics/mesa-dri/files/patch-configure b/graphics/mesa-dri/files/patch-configure index fe673a86a1a9..ea546ee330c1 100644 --- a/graphics/mesa-dri/files/patch-configure +++ b/graphics/mesa-dri/files/patch-configure @@ -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