summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authortnn <tnn>2015-09-11 00:03:36 +0000
committertnn <tnn>2015-09-11 00:03:36 +0000
commit95613921f54075c709d202035371883e8f891040 (patch)
tree9d832559a4f0961af0a00cd737683ce9d68177c8 /graphics
parent581cafdc19a7a4be8d6abb8e079840e5e4b4e738 (diff)
downloadpkgsrc-95613921f54075c709d202035371883e8f891040.tar.gz
Update to MesaLib-10.6.7.
Requested by David Shao in PR pkg/50202. Also as suggested add support for using libdevq for FreeBSD, from Ports. (Re the PR: I think we should have TLS GLX unconditionally enabled on platforms that support it, but needs more testing so not commited just yet.) New features in MesaLib 10.6: GL_AMD_pinned_memory on r600, radeonsi GL_ARB_clip_control on i965 GL_ARB_depth_buffer_float on freedreno GL_ARB_depth_clamp on freedreno GL_ARB_direct_state_access on all drivers that support GL 2.0+ GL_ARB_draw_indirect, GL_ARB_multi_draw_indirect on r600 GL_ARB_draw_instanced on freedreno GL_ARB_gpu_shader_fp64 on nvc0, softpipe GL_ARB_gpu_shader5 on i965/gen8+ GL_ARB_instanced_arrays on freedreno GL_ARB_pipeline_statistics_query on i965, nv50, nvc0, r600, radeonsi, softpipe GL_ARB_program_interface_query (all drivers) GL_ARB_texture_stencil8 on nv50, nvc0, r600, radeonsi, softpipe GL_ARB_texture_view on llvmpipe, softpipe GL_ARB_uniform_buffer_object on freedreno GL_ARB_vertex_attrib_64bit on nvc0, softpipe GL_ARB_viewport_array, GL_AMD_vertex_shader_viewport_index on i965/gen6 GL_EXT_draw_buffers2 on freedreno GL_OES_EGL_sync on all drivers EGL_KHR_fence_sync on i965, freedreno, nv50, nvc0, r600, radeonsi EGL_KHR_wait_sync on i965, freedreno, nv50, nvc0, r600, radeonsi EGL_KHR_cl_event2 on freedreno, nv50, nvc0, r600, radeonsi GL_AMD_performance_monitor on nvc0 Also many bugfixes.
Diffstat (limited to 'graphics')
-rw-r--r--graphics/MesaLib/Makefile17
-rw-r--r--graphics/MesaLib/PLIST4
-rw-r--r--graphics/MesaLib/distinfo27
-rw-r--r--graphics/MesaLib/dri.mk6
-rw-r--r--graphics/MesaLib/options.mk3
-rw-r--r--graphics/MesaLib/patches/patch-configure171
-rw-r--r--graphics/MesaLib/patches/patch-include_EGL_eglplatform.h26
-rw-r--r--graphics/MesaLib/patches/patch-src_gallium_auxiliary_util_u__cpu__detect.c15
-rw-r--r--graphics/MesaLib/patches/patch-src_gallium_auxiliary_util_u__math.h22
-rw-r--r--graphics/MesaLib/patches/patch-src_gallium_include_pipe_p__config.h15
-rw-r--r--graphics/MesaLib/patches/patch-src_loader_Makefile.in24
-rw-r--r--graphics/MesaLib/patches/patch-src_loader_loader.c82
-rw-r--r--graphics/MesaLib/patches/patch-src_mapi_glapi_gen_gl__gentable.py15
-rw-r--r--graphics/MesaLib/patches/patch-src_mesa_drivers_dri_Makefile.in8
-rw-r--r--graphics/MesaLib/patches/patch-src_mesa_drivers_dri_common_xmlconfig.c23
-rw-r--r--graphics/MesaLib/patches/patch-src_mesa_main_compiler.h20
-rw-r--r--graphics/MesaLib/patches/patch-src_mesa_tnl_t__pipeline.c20
-rw-r--r--graphics/MesaLib/patches/patch-src_mesa_x86_common__x86.c27
18 files changed, 405 insertions, 120 deletions
diff --git a/graphics/MesaLib/Makefile b/graphics/MesaLib/Makefile
index 2ed23930b66..7b5df0a37fd 100644
--- a/graphics/MesaLib/Makefile
+++ b/graphics/MesaLib/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.104 2015/06/07 15:48:12 tnn Exp $
+# $NetBSD: Makefile,v 1.105 2015/09/11 00:03:36 tnn Exp $
-DISTNAME= mesa-10.5.7
+DISTNAME= mesa-10.6.7
PKGNAME= ${DISTNAME:S/mesa/MesaLib/}
CATEGORIES= graphics x11
MASTER_SITES= ftp://ftp.freedesktop.org/pub/mesa/${PKGVERSION_NOREV}/
@@ -26,7 +26,6 @@ PKGCONFIG_OVERRIDE+= src/gallium/targets/xa/xatracker.pc.in
PKGCONFIG_OVERRIDE+= src/gbm/main/gbm.pc.in
PKGCONFIG_OVERRIDE+= src/mapi/es1api/glesv1_cm.pc.in
PKGCONFIG_OVERRIDE+= src/mapi/es2api/glesv2.pc.in
-PKGCONFIG_OVERRIDE+= src/mapi/vgapi/vg.pc.in
PKGCONFIG_OVERRIDE+= src/mesa/drivers/dri/dri.pc.in
PKGCONFIG_OVERRIDE+= src/mesa/drivers/osmesa/osmesa.pc.in
PKGCONFIG_OVERRIDE+= src/mesa/gl.pc.in
@@ -45,6 +44,13 @@ SUBST_SED.wrapper-bug= -e 's,shared-glapi/libglapi.la,shared-glapi/libglapi_sha
SUBST_SED.wrapper-bug+= -e 's,libglapi.la,libglapi_static.la,g'
SUBST_SED.wrapper-bug+= -e 's,libglapi_shared.la,libglapi.la,g'
+# Replace /etc/drirc with ${PREFIX}/etc/drirc
+SUBST_CLASSES+= drirc
+SUBST_STAGE.drirc= post-patch
+SUBST_MESSAGE.drirc= Fixing hardcoded /etc/drirc references
+SUBST_FILES.drirc+= src/mesa/drivers/dri/common/xmlconfig.c
+SUBST_SED.drirc+= -e 's|/etc/|${PREFIX}/etc/|g'
+
.include "../../mk/bsd.prefs.mk"
.include "../../mk/compiler.mk"
.include "options.mk"
@@ -77,6 +83,11 @@ CPPFLAGS+= -Dexp2\(x\)=exp\(\(x\)\*M_LN2\)
CPPFLAGS+= -Dexp2f\(x\)=expf\(\(x\)\*M_LN2\)
.endif
+INSTALLATION_DIRS+= share/examples/MesaLib
+
+post-install:
+ ${INSTALL_DATA} ${WRKSRC}/src/mesa/drivers/dri/common/drirc ${DESTDIR}${PREFIX}/share/examples/MesaLib
+
.include "../../x11/libX11/buildlink3.mk"
.include "../../x11/libXext/buildlink3.mk"
.include "../../x11/libxcb/buildlink3.mk"
diff --git a/graphics/MesaLib/PLIST b/graphics/MesaLib/PLIST
index d8af612185f..233ff73c8a3 100644
--- a/graphics/MesaLib/PLIST
+++ b/graphics/MesaLib/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.27 2015/04/25 11:19:18 tnn Exp $
+@comment $NetBSD: PLIST,v 1.28 2015/09/11 00:03:36 tnn Exp $
include/EGL/egl.h
include/EGL/eglext.h
include/EGL/eglextchromium.h
@@ -14,7 +14,6 @@ include/GL/glxext.h
${PLIST.dri}include/GL/internal/dri_interface.h
include/GL/osmesa.h
include/GL/wglext.h
-include/GL/wmesa.h
include/KHR/khrplatform.h
${PLIST.dri}include/gbm.h
${PLIST.i915_dri}lib/dri/i915_dri.so
@@ -38,3 +37,4 @@ ${PLIST.dri}lib/pkgconfig/dri.pc
lib/pkgconfig/egl.pc
${PLIST.dri}lib/pkgconfig/gbm.pc
lib/pkgconfig/gl.pc
+share/examples/MesaLib/drirc
diff --git a/graphics/MesaLib/distinfo b/graphics/MesaLib/distinfo
index 22769703ff5..23af48cacec 100644
--- a/graphics/MesaLib/distinfo
+++ b/graphics/MesaLib/distinfo
@@ -1,36 +1,39 @@
-$NetBSD: distinfo,v 1.96 2015/06/07 15:48:12 tnn Exp $
+$NetBSD: distinfo,v 1.97 2015/09/11 00:03:36 tnn Exp $
-SHA1 (mesa-10.5.7.tar.xz) = b600f09ccaeab9f6bb5b98091cf01732bab854a2
-RMD160 (mesa-10.5.7.tar.xz) = 0e15cf97678ecdc95996b598169130dcfd239533
-Size (mesa-10.5.7.tar.xz) = 6992848 bytes
-SHA1 (patch-configure) = 3fc150370e36fc49382b491d907608f00cf99a72
-SHA1 (patch-include_EGL_eglplatform.h) = c34bac7386fd93ee8d0b83a748ae14dc4742d776
+SHA1 (mesa-10.6.7.tar.xz) = c63008bf8f2b1022a60a82fa4f2200db6fbd956c
+RMD160 (mesa-10.6.7.tar.xz) = cdf2062b98094afdb281da6b040484f66383a17a
+Size (mesa-10.6.7.tar.xz) = 7041708 bytes
+SHA1 (patch-configure) = 24d1ee6bf62cdea9c9356132f727b490679f0330
+SHA1 (patch-include_EGL_eglplatform.h) = a20ee1690b2977d53a60c738e292b07c6f999e8d
SHA1 (patch-include_GL_glxext.h) = 830902f2d38a8395cda682c059fc5223e1b0e89e
+SHA1 (patch-src_gallium_auxiliary_util_u__cpu__detect.c) = 5f4c3db54620739da0fe7dfb57c58728ecbbb6e0
SHA1 (patch-src_gallium_auxiliary_util_u__format__tests.c) = 4d5e4677c2825778c43440ab131b8807f6840975
-SHA1 (patch-src_gallium_auxiliary_util_u__math.h) = b126390d4a8ee495edfb4c3b1dfdab981445969e
+SHA1 (patch-src_gallium_auxiliary_util_u__math.h) = 8dd195b29f6ba598260348194aca149f1ca057f9
SHA1 (patch-src_gallium_auxiliary_util_u__network.c) = 283f505af780071dc9fd7914f8065e3fb7d8a4fd
SHA1 (patch-src_gallium_auxiliary_util_u__network.h) = c6106d67b4fa9db0d790474182d6e0ce0c5da677
SHA1 (patch-src_gallium_drivers_nouveau_codegen_nv50__ir__peephole.cpp) = 5fc2ef7eafac3006896af96bac8176c79b17cfdc
SHA1 (patch-src_gallium_drivers_nouveau_nouveau__vp3__video.c) = ae1b6eb4df3e4db0f37e44118cdf69b16f3c471e
SHA1 (patch-src_gallium_drivers_nouveau_nv50_nv84__video.c) = 1b4239fe053523835ecac006894bdb0cde0ee626
-SHA1 (patch-src_gallium_include_pipe_p__config.h) = 1698482bb7b468c6fa5f9bb553f9065cecc33f0d
SHA1 (patch-src_gallium_targets_dri_Makefile.in) = a9a8265d97297040a3e3260b362ca920ec852280
SHA1 (patch-src_gallium_winsys_radeon_drm_radeon__drm__winsys.c) = 2358b7d5ea89e28cb3ac07a408b18e8bf55e057a
SHA1 (patch-src_gallium_winsys_svga_drm_vmw__screen.c) = 4b2ae565377b1a0396c8bf6b2663c261592b8e5e
SHA1 (patch-src_gallium_winsys_svga_drm_vmw__screen__ioctl.c) = e4b891e8b4ebe5b8e8c7b8c2c1dbed11b9c417df
SHA1 (patch-src_gbm_main_gbm.c) = 70225ab7352f123c9efc68b6d4ff0d9675b6f9dc
SHA1 (patch-src_glsl_ralloc.c) = 7443d00ff05ee1e1dcfa2b76972b55abadebcad8
+SHA1 (patch-src_loader_Makefile.in) = b0475273e2fdd3379528a0d8d393236df131bb30
+SHA1 (patch-src_loader_loader.c) = 4086fcee5030b6d6624c08894ace67c8889887ce
SHA1 (patch-src_mapi_entry__x86-64__tls.h) = c722ce4a22911d9a3d04e1a4fd6ab1a5ddd81cf0
SHA1 (patch-src_mapi_entry__x86__tls.h) = 51d6ef1aa3db69b23eea6fe145a54c0e7e265190
SHA1 (patch-src_mapi_entry__x86__tsd.h) = 62501b6e609fa81e33fd826a694e9d9752a7ba21
-SHA1 (patch-src_mesa_drivers_dri_Makefile.in) = b016b3f9324b05e4206e1c23150bd1cde9b9e100
+SHA1 (patch-src_mapi_glapi_gen_gl__gentable.py) = 53026e520a510e54494760a3fa05af6f15dfb9d8
+SHA1 (patch-src_mesa_drivers_dri_Makefile.in) = 48032b8f8e6eac59092f68f3c32cfdd44d7ce8bf
SHA1 (patch-src_mesa_drivers_dri_common_Makefile.in) = 5e160f7d92c2e9f3fa36e52a082a496af67e634e
-SHA1 (patch-src_mesa_drivers_dri_common_xmlconfig.c) = 8c8e748397bcdc9b9abbd14604af5d79de08dfbf
+SHA1 (patch-src_mesa_drivers_dri_common_xmlconfig.c) = 668cc1d6a58f8f02eb9eb32c1aeffb4bef7beaf4
SHA1 (patch-src_mesa_drivers_dri_i915_intel__screen.c) = fd8436e4e3a69250256c2cddf8138effb16bd7b3
SHA1 (patch-src_mesa_drivers_dri_i965_intel__screen.c) = 7c1a1e5c549f64d4c390e0c87984c44a88d4abfe
SHA1 (patch-src_mesa_drivers_dri_swrast_swrast.c) = b8a6cca517e1cccbdb2c59cf67a6d2481cdfebd4
-SHA1 (patch-src_mesa_main_compiler.h) = fc0e2b6be8afa9e21ddca1d1a14608a1687bddd8
SHA1 (patch-src_mesa_main_context.c) = 30c3796865372aa16297c2aaa647ddb49958fa64
SHA1 (patch-src_mesa_main_shader__query.cpp) = 6273c74161f045363c58f38adeb672287f6a0898
-SHA1 (patch-src_mesa_x86_common__x86.c) = f8b36603f7495b7712943c4a86459bcdd733d6a2
+SHA1 (patch-src_mesa_tnl_t__pipeline.c) = afc7d5f27aeadacc7c6a762e5aa892e01a0c1317
+SHA1 (patch-src_mesa_x86_common__x86.c) = bdac91384d67ad0238ecd4cdcf5cfc787952a3d9
SHA1 (patch-src_util_u__atomic.h) = 4a567b6fe5bf67fb7f386fa5f37bedb66d593085
diff --git a/graphics/MesaLib/dri.mk b/graphics/MesaLib/dri.mk
index 82e315d2fd4..d7180bba81e 100644
--- a/graphics/MesaLib/dri.mk
+++ b/graphics/MesaLib/dri.mk
@@ -1,4 +1,4 @@
-# $NetBSD: dri.mk,v 1.11 2015/06/22 22:45:06 jperkin Exp $
+# $NetBSD: dri.mk,v 1.12 2015/09/11 00:03:36 tnn Exp $
#
# Currently, this is for convenience only.
#
@@ -35,4 +35,8 @@ BUILDLINK_API_DEPENDS.libxcb+= libxcb>=1.9.3
. include "../../x11/presentproto/buildlink3.mk"
. include "../../x11/libxshmfence/buildlink3.mk"
. endif
+. if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
+. include "../../x11/libxshmfence/buildlink3.mk"
+. include "../../devel/libdevq/buildlink3.mk"
+. endif
.endif
diff --git a/graphics/MesaLib/options.mk b/graphics/MesaLib/options.mk
index cc7dfbb12c0..4af5756efc7 100644
--- a/graphics/MesaLib/options.mk
+++ b/graphics/MesaLib/options.mk
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.32 2015/05/28 21:09:07 tnn Exp $
+# $NetBSD: options.mk,v 1.33 2015/09/11 00:03:36 tnn Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.MesaLib
PKG_SUPPORTED_OPTIONS= llvm dri
@@ -114,6 +114,7 @@ PLIST.radeonsi= yes
GALLIUM_DRIVERS+= radeonsi
CONFIGURE_ARGS+= --enable-gallium-llvm
CONFIGURE_ARGS+= --enable-r600-llvm-compiler
+.include "../../devel/libelf/buildlink3.mk"
.include "../../lang/libLLVM/buildlink3.mk"
CONFIGURE_ENV+= ac_cv_path_ac_pt_LLVM_CONFIG=${LLVM_CONFIG_PATH}
.else # !llvm
diff --git a/graphics/MesaLib/patches/patch-configure b/graphics/MesaLib/patches/patch-configure
index 6cdfd513082..4ed6376da8c 100644
--- a/graphics/MesaLib/patches/patch-configure
+++ b/graphics/MesaLib/patches/patch-configure
@@ -1,10 +1,37 @@
-$NetBSD: patch-configure,v 1.1 2015/04/25 11:19:18 tnn Exp $
+$NetBSD: patch-configure,v 1.2 2015/09/11 00:03:36 tnn Exp $
Make sure toolchain can assemble SSE stuff in addition to having intrinsics.
+Add libdevq support from FreeBSD ports.
---- configure.orig 2015-03-28 18:43:34.000000000 +0000
+--- configure.orig 2015-09-04 22:02:51.000000000 +0000
+++ configure
-@@ -19578,7 +19578,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_
+@@ -858,6 +858,8 @@ GLPROTO_LIBS
+ GLPROTO_CFLAGS
+ XLIBGL_LIBS
+ XLIBGL_CFLAGS
++LIBDEVQ_LIBS
++LIBDEVQ_CFLAGS
+ LIBUDEV_LIBS
+ LIBUDEV_CFLAGS
+ MESA_LLVM
+@@ -1154,6 +1156,8 @@ LIBDRM_CFLAGS
+ LIBDRM_LIBS
+ LIBUDEV_CFLAGS
+ LIBUDEV_LIBS
++LIBDEVQ_CFLAGS
++LIBDEVQ_LIBS
+ XLIBGL_CFLAGS
+ XLIBGL_LIBS
+ GLPROTO_CFLAGS
+@@ -5231,6 +5235,7 @@ DRI2PROTO_REQUIRED=2.6
+ DRI3PROTO_REQUIRED=1.0
+ PRESENTPROTO_REQUIRED=1.0
+ LIBUDEV_REQUIRED=151
++LIBDEVQ_REQUIRED=0.0.2
+ GLPROTO_REQUIRED=1.4.14
+ LIBOMXIL_BELLAGIO_REQUIRED=0.0
+ LIBVA_REQUIRED=0.35.0
+@@ -19694,7 +19699,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_
#include <smmintrin.h>
int main () {
__m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
@@ -13,12 +40,132 @@ Make sure toolchain can assemble SSE stuff in addition to having intrinsics.
return 0;
}
_ACEOF
-@@ -23563,7 +23563,7 @@ if test "x$enable_nine" = xyes; then
- if ! echo "$with_gallium_drivers" | grep -q 'swrast'; then
- as_fn_error $? "nine requires the gallium swrast driver" "$LINENO" 5
- fi
-- if test "x$with_gallium_drivers" == xswrast; then
-+ if test "x$with_gallium_drivers" = xswrast; then
- as_fn_error $? "nine requires at least one non-swrast gallium driver" "$LINENO" 5
- fi
- if test "x$enable_dri3" = xno; then
+@@ -20466,7 +20471,7 @@ _ACEOF
+ $as_echo_n "checking if more special flags are required for pthreads... " >&6; }
+ flag=no
+ case ${host_os} in
+- aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
++ aix* | freebsd* | dragonfly* | darwin*) flag="-D_THREAD_SAFE";;
+ osf* | hpux*) flag="-D_REENTRANT";;
+ solaris*)
+ if test "$GCC" = "yes"; then
+@@ -21349,6 +21354,89 @@ else
+ fi
+
+
++
++# Check for libdevq
++
++pkg_failed=no
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBDEVQ" >&5
++$as_echo_n "checking for LIBDEVQ... " >&6; }
++if test -n "$LIBDEVQ_CFLAGS"; then
++ pkg_cv_LIBDEVQ_CFLAGS="$LIBDEVQ_CFLAGS"
++ elif test -n "$PKG_CONFIG"; then
++ if test -n "$PKG_CONFIG" && \
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists
++ --print-errors \"libdevq-1.0 >= \$LIBDEVQ_REQUIRED\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "libdevq-1.0 >= $LIBDEVQ_REQUIRED") 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }; then
++ pkg_cv_LIBDEVQ_CFLAGS=`$PKG_CONFIG --cflags "libdevq-1.0 >=
++ $LIBDEVQ_REQUIRED" 2>/dev/null`
++ test "x$?" != "x0" && pkg_failed=yes
++else
++ pkg_failed=yes
++fi
++ else
++ pkg_failed=untried
++fi
++if test -n "$LIBDEVQ_LIBS"; then
++ pkg_cv_LIBDEVQ_LIBS="$LIBDEVQ_LIBS"
++ elif test -n "$PKG_CONFIG"; then
++ if test -n "$PKG_CONFIG" && \
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists
++ --print-errors \"libdevq-1.0 >= \$LIBDEVQ_REQUIRED\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "libdevq-1.0 >= $LIBDEVQ_REQUIRED") 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }; then
++ pkg_cv_LIBDEVQ_LIBS=`$PKG_CONFIG --libs "libdevq-1.0 >=
++ $LIBDEVQ_REQUIRED" 2>/dev/null`
++ test "x$?" != "x0" && pkg_failed=yes
++else
++ pkg_failed=yes
++fi
++ else
++ pkg_failed=untried
++fi
++
++
++
++if test $pkg_failed = yes; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++
++if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
++ _pkg_short_errors_supported=yes
++else
++ _pkg_short_errors_supported=no
++fi
++ if test $_pkg_short_errors_supported = yes; then
++ LIBDEVQ_PKG_ERRORS=`$PKG_CONFIG --short-errors
++ --print-errors --cflags --libs "libdevq-1.0 >= $LIBDEVQ_REQUIRED"
++ 2>&1`
++ else
++ LIBDEVQ_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags
++ --libs "libdevq-1.0 >= $LIBDEVQ_REQUIRED" 2>&1`
++ fi
++ # Put the nasty error message in config.log where it belongs
++ echo "$LIBDEVQ_PKG_ERRORS" >&5
++
++ have_libdevq=no
++elif test $pkg_failed = untried; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++ have_libdevq=no
++else
++ LIBDEVQ_CFLAGS=$pkg_cv_LIBDEVQ_CFLAGS
++ LIBDEVQ_LIBS=$pkg_cv_LIBDEVQ_LIBS
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++ have_libdevq=yes
++fi
++
++
++
++
+ if test "x$enable_dri" = xyes; then
+ if test "$enable_static" = yes; then
+ as_fn_error $? "Cannot use static libraries for DRI drivers" "$LINENO" 5
+@@ -22060,6 +22148,10 @@ if test "$have_sysfs" = yes; then
+ DEFINES="$DEFINES -DHAVE_SYSFS"
+ have_pci_id=yes
+ fi
++if test "$have_libdevq" = yes; then
++ DEFINES="$DEFINES -DHAVE_LIBDEVQ"
++ have_pci_id=yes
++fi
+
+ # This is outside the case (above) so that it is invoked even for non-GLX
+ # builds.
+@@ -23002,6 +23094,8 @@ fi
+
+ if test "x$need_pci_id$have_libudev" = xyesyes; then
+ GBM_PC_REQ_PRIV="libudev >= $LIBUDEV_REQUIRED"
++elif test "x$need_libdevq" = xyes; then
++ GBM_PC_REQ_PRIV="libdevq-1.0 >= $LIBDEVQ_REQUIRED"
+ else
+ GBM_PC_REQ_PRIV=""
+ fi
+@@ -24558,9 +24652,6 @@ fi
+ CLANG_LIBDIR=${LLVM_LIBDIR}
+ fi
+ CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
+- if test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"; then :
+- as_fn_error $? "Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries." "$LINENO" 5
+-fi
+ fi
+ else
+ MESA_LLVM=0
diff --git a/graphics/MesaLib/patches/patch-include_EGL_eglplatform.h b/graphics/MesaLib/patches/patch-include_EGL_eglplatform.h
index 24aef142b91..bdff264d518 100644
--- a/graphics/MesaLib/patches/patch-include_EGL_eglplatform.h
+++ b/graphics/MesaLib/patches/patch-include_EGL_eglplatform.h
@@ -1,29 +1,10 @@
-$NetBSD: patch-include_EGL_eglplatform.h,v 1.1 2015/05/16 16:39:52 tnn Exp $
+$NetBSD: patch-include_EGL_eglplatform.h,v 1.2 2015/09/11 00:03:36 tnn Exp $
https://bugs.freedesktop.org/show_bug.cgi?id=90249
-From 5b31c5cdcdb09d12e3dc5180ab5c80250e8dd2bd Mon Sep 17 00:00:00 2001
-From: Julien Isorce <j.isorce@samsung.com>
-Date: Thu, 30 Apr 2015 08:36:50 +0100
-Subject: [PATCH] egl: use unix defines on osx with clang
-
-CC egl_dri2.lo
-include/EGL/eglplatform.h:135:2:
- error: "Platform not recognized"
-include/EGL/eglplatform.h:140:9:
- error: unknown type name 'EGLNativeDisplayType'
-typedef EGLNativeDisplayType NativeDisplayType;
-
-Signed-off-by: Julien Isorce <j.isorce@samsung.com>
----
- include/EGL/eglplatform.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/include/EGL/eglplatform.h b/include/EGL/eglplatform.h
-index 2eb6865..672119e 100644
---- include/EGL/eglplatform.h
+--- include/EGL/eglplatform.h.orig 2015-09-10 17:40:30.000000000 +0000
+++ include/EGL/eglplatform.h
-@@ -104,7 +104,7 @@ typedef struct ANativeWindow *EGLNativeWindowType;
+@@ -104,7 +104,7 @@ typedef struct ANativeWindow *EGL
typedef struct egl_native_pixmap_t *EGLNativePixmapType;
typedef void *EGLNativeDisplayType;
@@ -31,3 +12,4 @@ index 2eb6865..672119e 100644
+#elif defined(__unix__) || defined(__APPLE__)
#if defined(MESA_EGL_NO_X11_HEADERS)
+
diff --git a/graphics/MesaLib/patches/patch-src_gallium_auxiliary_util_u__cpu__detect.c b/graphics/MesaLib/patches/patch-src_gallium_auxiliary_util_u__cpu__detect.c
new file mode 100644
index 00000000000..95db3b4501c
--- /dev/null
+++ b/graphics/MesaLib/patches/patch-src_gallium_auxiliary_util_u__cpu__detect.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_gallium_auxiliary_util_u__cpu__detect.c,v 1.1 2015/09/11 00:03:36 tnn Exp $
+
+DragonFly support.
+
+--- src/gallium/auxiliary/util/u_cpu_detect.c.orig 2015-07-29 21:10:43.953534000 +0000
++++ src/gallium/auxiliary/util/u_cpu_detect.c
+@@ -52,7 +52,7 @@
+ #include <machine/cpu.h>
+ #endif
+
+-#if defined(PIPE_OS_FREEBSD)
++#if defined(PIPE_OS_FREEBSD) || defined(PIPE_OS_DRAGONFLY)
+ #include <sys/types.h>
+ #include <sys/sysctl.h>
+ #endif
diff --git a/graphics/MesaLib/patches/patch-src_gallium_auxiliary_util_u__math.h b/graphics/MesaLib/patches/patch-src_gallium_auxiliary_util_u__math.h
index a5e55a2bab1..6af4cc9b492 100644
--- a/graphics/MesaLib/patches/patch-src_gallium_auxiliary_util_u__math.h
+++ b/graphics/MesaLib/patches/patch-src_gallium_auxiliary_util_u__math.h
@@ -1,23 +1,21 @@
-$NetBSD: patch-src_gallium_auxiliary_util_u__math.h,v 1.2 2015/05/11 21:33:58 tnn Exp $
+$NetBSD: patch-src_gallium_auxiliary_util_u__math.h,v 1.3 2015/09/11 00:03:36 tnn Exp $
The C99 "restrict" keyword is not valid in C++, but most compilers will
understand __restrict.
---- src/gallium/auxiliary/util/u_math.h.orig 2015-03-28 18:20:39.000000000 +0000
+--- src/gallium/auxiliary/util/u_math.h.orig 2015-09-10 17:40:30.000000000 +0000
+++ src/gallium/auxiliary/util/u_math.h
-@@ -528,7 +528,10 @@ unsigned ffs( unsigned u )
-
- return i;
- }
--#elif defined(__MINGW32__) || defined(PIPE_OS_ANDROID)
+@@ -401,6 +401,9 @@ unsigned ffs( unsigned u )
+ #if defined(__MINGW32__) || defined(PIPE_OS_ANDROID) || \
+ defined(HAVE___BUILTIN_FFSLL)
+ #define ffsll __builtin_ffsll
+#elif defined(__NetBSD__)
+#include <sys/bitops.h>
+#define ffsll ffs64
-+#elif defined(__GNUC__)
- #define ffs __builtin_ffs
- #define ffsll __builtin_ffsll
#endif
-@@ -821,6 +824,11 @@ util_bswap16(uint16_t n)
+
+ #endif /* FFSLL_DEFINED */
+@@ -690,6 +693,11 @@ util_bswap16(uint16_t n)
(n << 8);
}
@@ -29,7 +27,7 @@ understand __restrict.
static INLINE void*
util_memcpy_cpu_to_le32(void * restrict dest, const void * restrict src, size_t n)
{
-@@ -839,6 +847,11 @@ util_memcpy_cpu_to_le32(void * restrict
+@@ -708,6 +716,11 @@ util_memcpy_cpu_to_le32(void * restrict
#endif
}
diff --git a/graphics/MesaLib/patches/patch-src_gallium_include_pipe_p__config.h b/graphics/MesaLib/patches/patch-src_gallium_include_pipe_p__config.h
deleted file mode 100644
index bb80ba11515..00000000000
--- a/graphics/MesaLib/patches/patch-src_gallium_include_pipe_p__config.h
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-src_gallium_include_pipe_p__config.h,v 1.5 2015/04/25 11:19:18 tnn Exp $
-
-Fix endian detection on NetBSD.
-
---- src/gallium/include/pipe/p_config.h.orig 2015-01-17 14:53:45.000000000 +0000
-+++ src/gallium/include/pipe/p_config.h
-@@ -157,7 +157,7 @@
- # define PIPE_ARCH_BIG_ENDIAN
- #endif
-
--#elif defined(__OpenBSD__)
-+#elif defined(__OpenBSD__) || defined(__NetBSD__)
- #include <sys/types.h>
- #include <machine/endian.h>
-
diff --git a/graphics/MesaLib/patches/patch-src_loader_Makefile.in b/graphics/MesaLib/patches/patch-src_loader_Makefile.in
new file mode 100644
index 00000000000..586c065b0d0
--- /dev/null
+++ b/graphics/MesaLib/patches/patch-src_loader_Makefile.in
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_loader_Makefile.in,v 1.1 2015/09/11 00:03:36 tnn Exp $
+
+FreeBSD & DragonFly support for libdevq.
+
+--- src/loader/Makefile.in.orig 2015-08-12 00:50:19.110973000 +0000
++++ src/loader/Makefile.in
+@@ -319,6 +319,8 @@ LEXLIB = @LEXLIB@
+ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+ LIBCLC_INCLUDEDIR = @LIBCLC_INCLUDEDIR@
+ LIBCLC_LIBEXECDIR = @LIBCLC_LIBEXECDIR@
++LIBDEVQ_CFLAGS = @LIBDEVQ_CFLAGS@
++LIBDEVQ_LIBS = @LIBDEVQ_LIBS@
+ LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
+ LIBDRM_LIBS = @LIBDRM_LIBS@
+ LIBOBJS = @LIBOBJS@
+@@ -508,7 +510,7 @@ EXTRA_DIST = SConscript
+ noinst_LTLIBRARIES = libloader.la
+ libloader_la_CPPFLAGS = $(DEFINES) -I$(top_srcdir)/include \
+ -I$(top_srcdir)/src $(VISIBILITY_CFLAGS) $(LIBUDEV_CFLAGS) \
+- $(am__append_1) $(am__append_3) $(am__append_4)
++ $(LIBDEVQ_CFLAGS) $(am__append_1) $(am__append_3) $(am__append_4)
+ libloader_la_SOURCES = $(LOADER_C_FILES)
+ libloader_la_LIBADD = $(am__append_2) $(am__append_5)
+ all: all-am
diff --git a/graphics/MesaLib/patches/patch-src_loader_loader.c b/graphics/MesaLib/patches/patch-src_loader_loader.c
new file mode 100644
index 00000000000..bb3d292c1c5
--- /dev/null
+++ b/graphics/MesaLib/patches/patch-src_loader_loader.c
@@ -0,0 +1,82 @@
+$NetBSD: patch-src_loader_loader.c,v 1.1 2015/09/11 00:03:36 tnn Exp $
+
+FreeBSD & DragonFly support for libdevq. From FreeBSD ports(?)
+
+--- src/loader/loader.c.orig 2015-07-26 13:32:59.000000000 +0000
++++ src/loader/loader.c
+@@ -68,7 +68,7 @@
+ #include <stdarg.h>
+ #include <stdio.h>
+ #include <string.h>
+-#ifdef HAVE_LIBUDEV
++#if defined(HAVE_LIBUDEV) || defined(HAVE_LIBDEVQ)
+ #include <assert.h>
+ #include <dlfcn.h>
+ #include <fcntl.h>
+@@ -501,6 +501,53 @@ sysfs_get_pci_id_for_fd(int fd, int *ven
+ }
+ #endif
+
++#if defined(HAVE_LIBDEVQ)
++#include <libdevq.h>
++
++static void *devq_handle = NULL;
++
++static void *
++devq_dlopen_handle(void)
++{
++ if (!devq_handle) {
++ devq_handle = dlopen("libdevq.so.0", RTLD_LOCAL | RTLD_LAZY);
++ }
++
++ return devq_handle;
++}
++
++static void *
++asserted_dlsym(void *dlopen_handle, const char *name)
++{
++ void *result = dlsym(dlopen_handle, name);
++ assert(result);
++ return result;
++}
++
++#define DEVQ_SYMBOL(ret, name, args) \
++ ret (*name) args = asserted_dlsym(devq_dlopen_handle(), #name);
++
++static int
++devq_get_pci_id_from_fd(int fd, int *vendor_id, int *chip_id)
++{
++ int ret;
++ DEVQ_SYMBOL(int, devq_device_get_pciid_from_fd,
++ (int fd, int *vendor_id, int *chip_id));
++
++ *chip_id = -1;
++
++ ret = devq_device_get_pciid_from_fd(fd, vendor_id, chip_id);
++ if (ret < 0) {
++ log_(_LOADER_WARNING, "MESA-LOADER: could not get PCI ID\n");
++ goto out;
++ }
++
++out:
++ return (*chip_id >= 0);
++}
++
++#endif
++
+ #if !defined(__NOT_HAVE_DRM_H)
+ /* for i915 */
+ #include <i915_drm.h>
+@@ -584,6 +631,12 @@ loader_get_pci_id_for_fd(int fd, int *ve
+ if (sysfs_get_pci_id_for_fd(fd, vendor_id, chip_id))
+ return 1;
+ #endif
++
++#if HAVE_LIBDEVQ
++ if (devq_get_pci_id_from_fd(fd, vendor_id, chip_id))
++ return 1;
++#endif
++
+ #if !defined(__NOT_HAVE_DRM_H)
+ if (drm_get_pci_id_for_fd(fd, vendor_id, chip_id))
+ return 1;
diff --git a/graphics/MesaLib/patches/patch-src_mapi_glapi_gen_gl__gentable.py b/graphics/MesaLib/patches/patch-src_mapi_glapi_gen_gl__gentable.py
new file mode 100644
index 00000000000..4c9561c75d4
--- /dev/null
+++ b/graphics/MesaLib/patches/patch-src_mapi_glapi_gen_gl__gentable.py
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_mapi_glapi_gen_gl__gentable.py,v 1.1 2015/09/11 00:03:36 tnn Exp $
+
+FreeBSD support.
+
+--- src/mapi/glapi/gen/gl_gentable.py.orig 2015-07-29 21:28:50.156039000 +0000
++++ src/mapi/glapi/gen/gl_gentable.py
+@@ -42,7 +42,7 @@ header = """/* GLXEXT is the define used
+ #endif
+
+ #if (defined(GLXEXT) && defined(HAVE_BACKTRACE)) \\
+- || (!defined(GLXEXT) && defined(DEBUG) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__DragonFly__))
++ || (!defined(GLXEXT) && defined(DEBUG) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__DragonFly__))
+ #define USE_BACKTRACE
+ #endif
+
diff --git a/graphics/MesaLib/patches/patch-src_mesa_drivers_dri_Makefile.in b/graphics/MesaLib/patches/patch-src_mesa_drivers_dri_Makefile.in
index e33b420dfef..f8c8fff1ebd 100644
--- a/graphics/MesaLib/patches/patch-src_mesa_drivers_dri_Makefile.in
+++ b/graphics/MesaLib/patches/patch-src_mesa_drivers_dri_Makefile.in
@@ -1,12 +1,12 @@
-$NetBSD: patch-src_mesa_drivers_dri_Makefile.in,v 1.1 2015/04/25 11:19:18 tnn Exp $
+$NetBSD: patch-src_mesa_drivers_dri_Makefile.in,v 1.2 2015/09/11 00:03:36 tnn Exp $
DRI drivers need explicit linkage to glapi. FDO bug 57702. We only need to do
this for the "mega" drivers since that's where final linking takes place.
---- src/mesa/drivers/dri/Makefile.in.orig 2015-03-28 18:43:41.000000000 +0000
+--- src/mesa/drivers/dri/Makefile.in.orig 2015-07-04 11:11:08.000000000 +0000
+++ src/mesa/drivers/dri/Makefile.in
-@@ -581,6 +581,7 @@ mesa_dri_drivers_la_LIBADD = \
- common/libdricommon.la \
+@@ -583,6 +583,7 @@ mesa_dri_drivers_la_LIBADD = \
+ common/libxmlconfig.la \
$(MEGADRIVERS_DEPS) \
$(DRI_LIB_DEPS) \
+ $(top_srcdir)/src/mapi/shared-glapi/libglapi.la \
diff --git a/graphics/MesaLib/patches/patch-src_mesa_drivers_dri_common_xmlconfig.c b/graphics/MesaLib/patches/patch-src_mesa_drivers_dri_common_xmlconfig.c
index a5f8918d14a..fbd0c9d895d 100644
--- a/graphics/MesaLib/patches/patch-src_mesa_drivers_dri_common_xmlconfig.c
+++ b/graphics/MesaLib/patches/patch-src_mesa_drivers_dri_common_xmlconfig.c
@@ -1,15 +1,24 @@
-$NetBSD: patch-src_mesa_drivers_dri_common_xmlconfig.c,v 1.1 2015/04/25 11:19:18 tnn Exp $
+$NetBSD: patch-src_mesa_drivers_dri_common_xmlconfig.c,v 1.2 2015/09/11 00:03:36 tnn Exp $
-Fix broken ifdef.
+PR pkg/50202.
---- src/mesa/drivers/dri/common/xmlconfig.c.orig 2015-03-28 18:20:39.000000000 +0000
+--- src/mesa/drivers/dri/common/xmlconfig.c.orig 2015-07-14 18:10:47.000000000 +0000
+++ src/mesa/drivers/dri/common/xmlconfig.c
-@@ -53,7 +53,7 @@ extern char *program_invocation_name, *p
+@@ -50,12 +50,17 @@ extern char *program_invocation_name, *p
+ # define GET_PROGRAM_NAME() program_invocation_short_name
+ #elif defined(__CYGWIN__)
+ # define GET_PROGRAM_NAME() program_invocation_short_name
++/*
+ #elif defined(__FreeBSD__) && (__FreeBSD__ >= 2)
+ # include <osreldate.h>
+ # if (__FreeBSD_version >= 440000)
# include <stdlib.h>
# define GET_PROGRAM_NAME() getprogname()
# endif
--#elif defined(__NetBSD__) && defined(__NetBSD_Version) && (__NetBSD_Version >= 106000100)
-+#elif defined(__NetBSD__) && defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106000100)
++*/
++#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
++# include <stdlib.h>
++# define GET_PROGRAM_NAME() getprogname()
+ #elif defined(__NetBSD__) && defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106000100)
# include <stdlib.h>
# define GET_PROGRAM_NAME() getprogname()
- #elif defined(__APPLE__)
diff --git a/graphics/MesaLib/patches/patch-src_mesa_main_compiler.h b/graphics/MesaLib/patches/patch-src_mesa_main_compiler.h
deleted file mode 100644
index b7e6cf6696b..00000000000
--- a/graphics/MesaLib/patches/patch-src_mesa_main_compiler.h
+++ /dev/null
@@ -1,20 +0,0 @@
-$NetBSD: patch-src_mesa_main_compiler.h,v 1.4 2015/04/25 11:19:18 tnn Exp $
-
-i386 FPU control word defaults.
-
---- src/mesa/main/compiler.h.orig 2015-03-28 18:20:39.000000000 +0000
-+++ src/mesa/main/compiler.h
-@@ -285,7 +285,13 @@ static inline GLuint CPU_TO_LE32(GLuint
- /* Hardware default: All exceptions masked, extended double precision,
- * round to nearest (IEEE compliant):
- */
-+#if defined(__NetBSD__)
-+#define DEFAULT_X86_FPU 0x127f /* __NetBSD_NPXCW__ */
-+#elif defined(__FreeBSD__)
-+#define DEFAULT_X86_FPU 0x1272 /* __FreeBSD_NPXCW__ */
-+#else
- #define DEFAULT_X86_FPU 0x037f
-+#endif
- /* All exceptions masked, single precision, round to nearest:
- */
- #define FAST_X86_FPU 0x003f
diff --git a/graphics/MesaLib/patches/patch-src_mesa_tnl_t__pipeline.c b/graphics/MesaLib/patches/patch-src_mesa_tnl_t__pipeline.c
new file mode 100644
index 00000000000..a089340ba7f
--- /dev/null
+++ b/graphics/MesaLib/patches/patch-src_mesa_tnl_t__pipeline.c
@@ -0,0 +1,20 @@
+$NetBSD: patch-src_mesa_tnl_t__pipeline.c,v 1.1 2015/09/11 00:03:36 tnn Exp $
+
+i386 FPU control word defaults.
+
+--- src/mesa/tnl/t_pipeline.c.orig 2015-09-09 17:55:36.000000000 +0000
++++ src/mesa/tnl/t_pipeline.c
+@@ -132,7 +132,13 @@ static GLuint check_output_changes( stru
+ /* Hardware default: All exceptions masked, extended double precision,
+ * round to nearest (IEEE compliant):
+ */
++#if defined(__NetBSD__)
++#define DEFAULT_X86_FPU 0x127f /* __NetBSD_NPXCW__ */
++#elif defined(__FreeBSD__)
++#define DEFAULT_X86_FPU 0x1272 /* __FreeBSD_NPXCW__ */
++#else
+ #define DEFAULT_X86_FPU 0x037f
++#endif
+ /* All exceptions masked, single precision, round to nearest:
+ */
+ #define FAST_X86_FPU 0x003f
diff --git a/graphics/MesaLib/patches/patch-src_mesa_x86_common__x86.c b/graphics/MesaLib/patches/patch-src_mesa_x86_common__x86.c
index 6719b246000..49217fd3b95 100644
--- a/graphics/MesaLib/patches/patch-src_mesa_x86_common__x86.c
+++ b/graphics/MesaLib/patches/patch-src_mesa_x86_common__x86.c
@@ -1,15 +1,24 @@
-$NetBSD: patch-src_mesa_x86_common__x86.c,v 1.1 2015/04/25 11:19:18 tnn Exp $
+$NetBSD: patch-src_mesa_x86_common__x86.c,v 1.2 2015/09/11 00:03:36 tnn Exp $
-Treat NetBSD like OpenBSD.
+DragonFly support.
---- src/mesa/x86/common_x86.c.orig 2015-03-28 18:20:39.000000000 +0000
+--- src/mesa/x86/common_x86.c.orig 2015-07-14 18:10:47.000000000 +0000
+++ src/mesa/x86/common_x86.c
-@@ -42,7 +42,7 @@
+@@ -38,7 +38,7 @@
+ #if defined(USE_SSE_ASM) && defined(__linux__)
+ #include <linux/version.h>
+ #endif
+-#if defined(USE_SSE_ASM) && defined(__FreeBSD__)
++#if defined(USE_SSE_ASM) && (defined(__FreeBSD__) || defined(__DragonFly__))
#include <sys/types.h>
#include <sys/sysctl.h>
#endif
--#if defined(USE_SSE_ASM) && defined(__OpenBSD__)
-+#if defined(USE_SSE_ASM) && (defined(__OpenBSD__) || defined(__NetBSD__))
- #include <sys/param.h>
- #include <sys/sysctl.h>
- #include <machine/cpu.h>
+@@ -128,7 +128,7 @@ static LONG WINAPI ExceptionFilter(LPEXC
+ */
+ void _mesa_check_os_sse_support( void )
+ {
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__DragonFly__)
+ {
+ int ret, enabled;
+ unsigned int len;