pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/graphics/MesaLib18



Module Name:    pkgsrc
Committed By:   tnn
Date:           Thu Jan 10 22:30:11 UTC 2019

Modified Files:
        pkgsrc/graphics/MesaLib18: Makefile PLIST distinfo
        pkgsrc/graphics/MesaLib18/files: patch-manual_fdo90311
        pkgsrc/graphics/MesaLib18/patches: patch-configure.ac
            patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c
            patch-src_util_u__queue.c
Added Files:
        pkgsrc/graphics/MesaLib18/patches:
            patch-src_gallium_auxiliary_util_u__helpers.c
            patch-src_intel_tools_aub__mem.c
            patch-src_intel_vulkan_anv__gem__stubs.c
            patch-src_mesa_drivers_dri_i965_brw__oa__metrics.c
            patch-src_util_Makefile.am patch-src_util_u__thread.h
Removed Files:
        pkgsrc/graphics/MesaLib18/patches: patch-configure
            patch-src_gbm_Makefile.in patch-src_intel_Makefile.in
            patch-src_intel_tools_aubinator.c

Log Message:
MesaLib18: update to 18.3.1

pkgsrc changes:

- Give up patching both .am/.ac and .in files. It is too complex to maintain.
  Capitulate and depend on autotools.
- more copypasta patches to handle NetBSD-style pthread_setaffinity_np()
- handle PKG_SYSCONFDIR properly
- patch-manual_fdo90311: regened (but untested)
- more to come but the diff is big enough already

New features:
    GL_AMD_depth_clamp_separate on r600, radeonsi.
    GL_AMD_framebuffer_multisample_advanced on radeonsi.
    GL_AMD_gpu_shader_int64 on i965, nvc0, radeonsi.
    GL_AMD_multi_draw_indirect on all GL 4.x drivers.
    GL_AMD_query_buffer_object on i965, nvc0, r600, radeonsi.
    GL_EXT_disjoint_timer_query on radeonsi and most other Gallium drivers (ES extension)
    GL_EXT_texture_compression_s3tc on all drivers (ES extension)
    GL_EXT_vertex_attrib_64bit on i965, nvc0, radeonsi.
    GL_EXT_window_rectangles on radeonsi.
    GL_KHR_texture_compression_astc_sliced_3d on radeonsi.
    GL_NV_fragment_shader_interlock on i965.
    EGL_EXT_device_base for all drivers.
    EGL_EXT_device_drm for all drivers.
    EGL_MESA_device_software for all drivers.

Bugfixes:

Too many to list


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 pkgsrc/graphics/MesaLib18/Makefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/graphics/MesaLib18/PLIST
cvs rdiff -u -r1.6 -r1.7 pkgsrc/graphics/MesaLib18/distinfo
cvs rdiff -u -r1.1 -r1.2 \
    pkgsrc/graphics/MesaLib18/files/patch-manual_fdo90311
cvs rdiff -u -r1.3 -r0 pkgsrc/graphics/MesaLib18/patches/patch-configure
cvs rdiff -u -r1.3 -r1.4 pkgsrc/graphics/MesaLib18/patches/patch-configure.ac
cvs rdiff -u -r1.1 -r1.2 \
    pkgsrc/graphics/MesaLib18/patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c \
    pkgsrc/graphics/MesaLib18/patches/patch-src_util_u__queue.c
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/graphics/MesaLib18/patches/patch-src_gallium_auxiliary_util_u__helpers.c \
    pkgsrc/graphics/MesaLib18/patches/patch-src_intel_tools_aub__mem.c \
    pkgsrc/graphics/MesaLib18/patches/patch-src_intel_vulkan_anv__gem__stubs.c \
    pkgsrc/graphics/MesaLib18/patches/patch-src_mesa_drivers_dri_i965_brw__oa__metrics.c \
    pkgsrc/graphics/MesaLib18/patches/patch-src_util_Makefile.am \
    pkgsrc/graphics/MesaLib18/patches/patch-src_util_u__thread.h
cvs rdiff -u -r1.1 -r0 \
    pkgsrc/graphics/MesaLib18/patches/patch-src_gbm_Makefile.in \
    pkgsrc/graphics/MesaLib18/patches/patch-src_intel_Makefile.in \
    pkgsrc/graphics/MesaLib18/patches/patch-src_intel_tools_aubinator.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/graphics/MesaLib18/Makefile
diff -u pkgsrc/graphics/MesaLib18/Makefile:1.7 pkgsrc/graphics/MesaLib18/Makefile:1.8
--- pkgsrc/graphics/MesaLib18/Makefile:1.7      Mon Dec  3 11:07:57 2018
+++ pkgsrc/graphics/MesaLib18/Makefile  Thu Jan 10 22:30:10 2019
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.7 2018/12/03 11:07:57 wiz Exp $
+# $NetBSD: Makefile,v 1.8 2019/01/10 22:30:10 tnn Exp $
 
-DISTNAME=      mesa-18.2.6
+DISTNAME=      mesa-18.3.1
 PKGNAME=       ${DISTNAME:S/mesa/MesaLib/}
 CATEGORIES=    graphics x11
 MASTER_SITES=  ftp://ftp.freedesktop.org/pub/mesa/
@@ -13,7 +13,7 @@ COMMENT=      The Mesa 3D Graphics Library
 LICENSE=       mit
 
 GNU_CONFIGURE= yes
-USE_TOOLS+=    bison pkg-config gmake flex
+USE_TOOLS+=    autoconf automake autoreconf bison pkg-config gmake flex
 USE_LANGUAGES= c99 c++
 USE_LIBTOOL=   yes
 
@@ -22,6 +22,7 @@ PKGCONFIG_OVERRIDE+=  src/gallium/targets
 PKGCONFIG_OVERRIDE+=   src/gallium/targets/osmesa/osmesa.pc.in
 PKGCONFIG_OVERRIDE+=   src/gallium/targets/xa/xatracker.pc.in
 PKGCONFIG_OVERRIDE+=   src/gbm/main/gbm.pc.in
+PKGCONFIG_OVERRIDE+=   src/glx/windows/windowsdriproto.pc.in
 PKGCONFIG_OVERRIDE+=   src/mapi/es1api/glesv1_cm.pc.in
 PKGCONFIG_OVERRIDE+=   src/mapi/es2api/glesv2.pc.in
 PKGCONFIG_OVERRIDE+=   src/mesa/drivers/dri/dri.pc.in
@@ -35,20 +36,24 @@ CONFIGURE_ARGS+=            --enable-shared-glapi
 # archives named libglapi.la but in different directories, bad things happen.
 SUBST_CLASSES+=                        wrapper-bug
 SUBST_STAGE.wrapper-bug=       pre-configure
-SUBST_MESSAGE.wrapper-bug=     Renaming glapi-shared/libglapi in Makefiles
-SUBST_FILES.wrapper-bug=       src/gbm/Makefile.in
-SUBST_FILES.wrapper-bug+=      src/glx/Makefile.in
-SUBST_FILES.wrapper-bug+=      src/mapi/Makefile.in
-SUBST_FILES.wrapper-bug+=      src/mesa/drivers/x11/Makefile.in
-SUBST_FILES.wrapper-bug+=      src/mesa/drivers/osmesa/Makefile.in
-SUBST_SED.wrapper-bug=         -e 's,shared-glapi/libglapi.la,shared-glapi/libglapi_tmp_rename.la,g'
-SUBST_SED.wrapper-bug+=                -e 's,libglapi.la,libglapi_impl.la,g'
-SUBST_SED.wrapper-bug+=                -e 's,libglapi_tmp_rename.la,libglapi.la,g'
+SUBST_MESSAGE.wrapper-bug=     Renaming non-shared libglapi.la in Makefiles
+SUBST_FILES.wrapper-bug=       src/gallium/targets/libgl-xlib/Makefile.am
+SUBST_FILES.wrapper-bug+=      src/gallium/targets/osmesa/Makefile.am
+SUBST_FILES.wrapper-bug+=      src/glx/Makefile.am
+SUBST_FILES.wrapper-bug+=      src/mapi/Makefile.am
+SUBST_FILES.wrapper-bug+=      src/mesa/drivers/osmesa/Makefile.am
+SUBST_FILES.wrapper-bug+=      src/mesa/drivers/x11/Makefile.am
+SUBST_SED.wrapper-bug=         -e 's,shared-glapi/libglapi\.la,shared-glapi/libglapi_tmp_rename.la,g'
+SUBST_SED.wrapper-bug+=                -e 's,shared_glapi_libglapi_la,shared_glapi_libglapi_tmp_rename_la,g'
+SUBST_SED.wrapper-bug+=                -e 's,libglapi\.la,libglapi_impl.la,g'
+SUBST_SED.wrapper-bug+=                -e 's,libglapi_la,libglapi_impl_la,g'
+SUBST_SED.wrapper-bug+=                -e 's,libglapi_tmp_rename\.la,libglapi.la,g'
+SUBST_SED.wrapper-bug+=                -e 's,libglapi_tmp_rename_la,libglapi_la,g'
 
-# Replace /etc/drirc with ${PREFIX}/etc/drirc
+# Replace /etc/drirc.d with ${PREFIX}/etc/drirc.d
 SUBST_CLASSES+=                        drirc
 SUBST_STAGE.drirc=             pre-configure
-SUBST_MESSAGE.drirc=           Fixing hardcoded /etc/drirc references
+SUBST_MESSAGE.drirc=           Fixing hardcoded /etc/drirc.d references
 SUBST_FILES.drirc+=            src/util/xmlconfig.c
 SUBST_SED.drirc+=               -e 's|/etc|${PREFIX}/etc|g'
 
@@ -76,19 +81,27 @@ CPPFLAGS+=  -Dexp2\(x\)=exp\(\(x\)\*M_LN2
 CPPFLAGS+=     -Dexp2f\(x\)=expf\(\(x\)\*M_LN2\)
 .endif
 
+pre-configure:
+       cd ${WRKSRC} && autoreconf -vif
 # Manual patch for FDO bug 90311. Don't apply if not on Darwin as there could
 # be side effects.
 .if ${OPSYS} == "Darwin"
 pre-configure: ${WRKDIR}/.manual_patch_done
 ${WRKDIR}/.manual_patch_done:
        cd ${WRKSRC} && ${TOOLS_PATCH} -z .manual -p0 < ${FILESDIR}/patch-manual_fdo90311
+       touch ${WRKSRC}/src/glx/dummy.cpp
        touch ${.TARGET}
 .endif
 
-INSTALLATION_DIRS+=    share/examples/MesaLib
+DRIRC_DIR=             ${PKG_SYSCONFDIR}/drirc.d
+EGDIR=                 ${PREFIX}/share/examples/mesa
+OWN_DIRS+=             ${DRIRC_DIR}
+INSTALLATION_DIRS+=    ${EGDIR}
+CONF_FILES+=           ${EGDIR}/00-mesa-defaults.conf  \
+       ${DRIRC_DIR}/00-mesa-defaults.conf
 
 post-install:
-       ${INSTALL_DATA} ${WRKSRC}/src/util/drirc ${DESTDIR}${PREFIX}/share/examples/MesaLib
+       ${INSTALL_DATA} ${WRKSRC}/src/util/00-mesa-defaults.conf ${DESTDIR}${EGDIR}
 
 .include "../../devel/zlib/buildlink3.mk"
 .include "../../x11/libXrandr/buildlink3.mk"

Index: pkgsrc/graphics/MesaLib18/PLIST
diff -u pkgsrc/graphics/MesaLib18/PLIST:1.1 pkgsrc/graphics/MesaLib18/PLIST:1.2
--- pkgsrc/graphics/MesaLib18/PLIST:1.1 Sun Oct  7 23:49:31 2018
+++ pkgsrc/graphics/MesaLib18/PLIST     Thu Jan 10 22:30:10 2019
@@ -1,5 +1,4 @@
-@comment $NetBSD: PLIST,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-etc/drirc
+@comment $NetBSD: PLIST,v 1.2 2019/01/10 22:30:10 tnn Exp $
 ${PLIST.dri}include/EGL/egl.h
 ${PLIST.dri}include/EGL/eglext.h
 ${PLIST.dri}include/EGL/eglextchromium.h
@@ -97,4 +96,4 @@ ${PLIST.nouveau}${PLIST.vaapi}lib/dri/no
 ${PLIST.vaapi}lib/dri/r600_drv_video.so
 @comment ${PLIST.vdpau}lib/dri/radeonsi_drv_video.la
 ${PLIST.vaapi}lib/dri/radeonsi_drv_video.so
-share/examples/MesaLib/drirc
+share/examples/mesa/00-mesa-defaults.conf

Index: pkgsrc/graphics/MesaLib18/distinfo
diff -u pkgsrc/graphics/MesaLib18/distinfo:1.6 pkgsrc/graphics/MesaLib18/distinfo:1.7
--- pkgsrc/graphics/MesaLib18/distinfo:1.6      Mon Dec 24 16:34:00 2018
+++ pkgsrc/graphics/MesaLib18/distinfo  Thu Jan 10 22:30:10 2019
@@ -1,11 +1,10 @@
-$NetBSD: distinfo,v 1.6 2018/12/24 16:34:00 sevan Exp $
+$NetBSD: distinfo,v 1.7 2019/01/10 22:30:10 tnn Exp $
 
-SHA1 (mesa-18.2.6.tar.xz) = 435affd7a2c35782b21533ed2c65c487e40abcf8
-RMD160 (mesa-18.2.6.tar.xz) = 80e918806d0e3bab668a05caf2df117bf8e3ee63
-SHA512 (mesa-18.2.6.tar.xz) = a7dd02f67384bb800dff70a0672a968ced96bb438605cdb39bde3e468d4dcf6162414a44e5da1abe7a1831fceb6f23e6c850eb5f80cfc5ee3861c14924c10ed4
-Size (mesa-18.2.6.tar.xz) = 11384440 bytes
-SHA1 (patch-configure) = 12baf1dc7070a8a7e76e4d21cb9b7c0e9a07fab5
-SHA1 (patch-configure.ac) = 8ef8f1d91e905f2b7ee976c8552c03b712bfb139
+SHA1 (mesa-18.3.1.tar.xz) = 50ba2d37647fea77ea19416e8a6ffed34c313330
+RMD160 (mesa-18.3.1.tar.xz) = 2d6dff2d0357687c164b2b87760301b97fd63653
+SHA512 (mesa-18.3.1.tar.xz) = a68d39158cf1e868d70730d0641a0cfe4c6e5b3cd1bc0c47f54022402aca03503933084f6ddc722bf88c9b6d1281ba5c847ec4fed8092a9b33f90527d08e12db
+Size (mesa-18.3.1.tar.xz) = 11865960 bytes
+SHA1 (patch-configure.ac) = 355b04270d2036fa879215d3f58278d5d32d22da
 SHA1 (patch-include_GL_internal_dri__interface.h) = 146d2f3f3e50fc1947e8941301d9cf9d90a035e2
 SHA1 (patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c) = 1fe81a7b16e36dc9125400c20543271216a33a45
 SHA1 (patch-src_compiler_builtin__type__macros.h) = 857bca0c0f55ec8d7a20b3807c7a5d7bd06bdfbf
@@ -14,8 +13,9 @@ SHA1 (patch-src_egl_drivers_dri2_platfor
 SHA1 (patch-src_egl_drivers_dri2_platform__x11.c) = 49e48c31eacb79d1da357fe70eaffd2926b5280e
 SHA1 (patch-src_egl_main_eglglobals.c) = 0d52014f52e62fc5fa6650336ddb0011ecf331e6
 SHA1 (patch-src_gallium_auxiliary_drivers_trace_tr__dump.c) = 360e1608508a7bbb41acecd58930781038e2309e
-SHA1 (patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c) = b8fd5e0d1bab1fa7ae965cae382a1cd1ffbf1fc4
+SHA1 (patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c) = f913b779404e6bd8ae707a4fd66eb7c1dca9b311
 SHA1 (patch-src_gallium_auxiliary_util_u__format__tests.c) = 4d5e4677c2825778c43440ab131b8807f6840975
+SHA1 (patch-src_gallium_auxiliary_util_u__helpers.c) = 636fb98c4cbf70a5d8a6d94c24e75d2b05968b3c
 SHA1 (patch-src_gallium_drivers_nouveau_nouveau__vp3__video.c) = 04f95784c3270c9bb7e95377982e217962481525
 SHA1 (patch-src_gallium_drivers_nouveau_nv50_nv84__video.c) = 1b4239fe053523835ecac006894bdb0cde0ee626
 SHA1 (patch-src_gallium_drivers_vc4_vc4__bufmgr.c) = 1d591d346486fdf58893f69ab92a272e6a31a987
@@ -24,20 +24,19 @@ SHA1 (patch-src_gallium_state__trackers_
 SHA1 (patch-src_gallium_state__trackers_clover_llvm_metadata.hpp) = c97d38098ea03658bc193a50e445b87f1c020839
 SHA1 (patch-src_gallium_state__trackers_clover_util_range.hpp) = cdc78067986c1b92818472c4201c58ef1b42c4f4
 SHA1 (patch-src_gbm_Makefile.am) = 5f3107afbf64b97f7d21ce427cecc4fb78974db3
-SHA1 (patch-src_gbm_Makefile.in) = 5855f4d2907a0d9c3b9a5334177a037591b51d6a
 SHA1 (patch-src_glx_apple_apple__glapi.c) = c4eea8dabf74eb03d22da4eb834b18ae3384c63b
 SHA1 (patch-src_glx_dri__glx.c) = 8fd48776e9953b18bd17ba130d90ae2935e67242
 SHA1 (patch-src_glx_glxclient.h) = f0358179ae397bc8677597b0ccb9a471f40f15de
 SHA1 (patch-src_glx_glxcurrent.c) = 8b8e949eded13491c5865601253c6e7d4b06e228
 SHA1 (patch-src_glx_glxext.c) = 15c2c5e0c6b5095ce849fb86ad148aa05d7d907a
-SHA1 (patch-src_intel_Makefile.in) = 821c385e07e41ec693e6ada9db73b88e6e8dc70b
 SHA1 (patch-src_intel_Makefile.tools.am) = 5253d5972b48ae3bc8d648bb9f479dcf6cbd3fab
 SHA1 (patch-src_intel_compiler_brw__fs__bank__conflicts.cpp) = 6276d2c6846bb4dd08699921bec4e20202a17478
-SHA1 (patch-src_intel_tools_aubinator.c) = a468cf9f1ac88e883ad33400afaf8df690086e72
+SHA1 (patch-src_intel_tools_aub__mem.c) = 8709def06ea0ac225af9ae38374c33944e560076
 SHA1 (patch-src_intel_tools_aubinator__error__decode.c) = d8f636e3c3e76763a505a1dce23de0b198ad62fa
 SHA1 (patch-src_intel_vulkan_anv__allocator.c) = 5dd27eea9811d739558c5b488c57a3d7ae539d87
 SHA1 (patch-src_intel_vulkan_anv__device.c) = 5d581dcd9695c869855f200c575cf98b7165c1ba
 SHA1 (patch-src_intel_vulkan_anv__gem.c) = b8eb487fa704151e7c3c3b1d23973b2b0aa5922e
+SHA1 (patch-src_intel_vulkan_anv__gem__stubs.c) = 7f0a25e96624815ef0912024b52bbb512d4fa42f
 SHA1 (patch-src_intel_vulkan_anv__queue.c) = 2dbf7dfd0c77f74f510032bf8d12109f58c50a30
 SHA1 (patch-src_mapi_entry__x86-64__tls.h) = 11b7ef1da435fa17fc7025a46a123d447d6a7d07
 SHA1 (patch-src_mapi_entry__x86__tls.h) = 11c0f5302d305a77f3a1780d44a2c61f48a66273
@@ -45,6 +44,7 @@ SHA1 (patch-src_mapi_glapi_gen_gl__genta
 SHA1 (patch-src_mapi_u__current.c) = 38d324fcd1c28d155106ccd248edb5eb1aa9ffac
 SHA1 (patch-src_mapi_u__current.h) = 465a992bd34057e9521f0a33e6f2e25cefc145ca
 SHA1 (patch-src_mesa_drivers_dri_i915_intel__screen.c) = e33f51b3502e8c52ff7283aeb807996717f79f4f
+SHA1 (patch-src_mesa_drivers_dri_i965_brw__oa__metrics.c) = bb7ca6a8b9e42c1dc4e59a3cf78d063699f7b66e
 SHA1 (patch-src_mesa_drivers_dri_i965_brw__performance__query.c) = 1250b3477c4b8013b928772b7dc7f24e8c4b67aa
 SHA1 (patch-src_mesa_drivers_dri_i965_intel__screen.c) = 795b17970e95347222514bacc0701aa86fa1ff02
 SHA1 (patch-src_mesa_drivers_dri_i965_intel__tiled__memcpy.c) = 5b940f9a56c694ffaf8a4383c3a2eae25cfd35a6
@@ -55,11 +55,13 @@ SHA1 (patch-src_mesa_main_macros.h) = c5
 SHA1 (patch-src_mesa_main_shader__query.cpp) = 3f9c31645d87855759def11344dee16af23c7be3
 SHA1 (patch-src_mesa_tnl_t__pipeline.c) = e6abcdb24019ca57527d25c5cd86737332db98e3
 SHA1 (patch-src_mesa_x86_common__x86.c) = f8c4b93443ef66d017f6aa114b877565b30f2598
+SHA1 (patch-src_util_Makefile.am) = e390cd47b784ad08987b81fdbce537968ad4a624
 SHA1 (patch-src_util_build__id.c) = 7a9547bbda9d2fb9f0018ccf27b70b59e497aa2c
 SHA1 (patch-src_util_disk__cache.c) = cc0b29780dba5d5b5e43c0798336f16a1f0008de
 SHA1 (patch-src_util_futex.h) = 35097c3b8baf8b969c6ec5ec1feb6f4e0a48237e
 SHA1 (patch-src_util_ralloc.c) = d311bfd9ed7e673d72e050668d351c1e6552cdc8
 SHA1 (patch-src_util_strndup.h) = 73f49694ca48ad6b9a9d8346c5b84fddec2463bd
 SHA1 (patch-src_util_u__atomic.h) = 31d4514538ef5ee53012695eb5c66134aaec981e
-SHA1 (patch-src_util_u__queue.c) = 1ea1c2f8e2971235aa98be96bfd6b2b68f876072
+SHA1 (patch-src_util_u__queue.c) = ed1ea3f6fc37e9a64894a3e865c48691b6e01b2c
+SHA1 (patch-src_util_u__thread.h) = 57bbf209575da7fd89f7ed6ac56a2ea19aec71d1
 SHA1 (patch-src_util_xmlconfig.c) = ad5619e067957b120a70c1c63421c92b356e16ac

Index: pkgsrc/graphics/MesaLib18/files/patch-manual_fdo90311
diff -u pkgsrc/graphics/MesaLib18/files/patch-manual_fdo90311:1.1 pkgsrc/graphics/MesaLib18/files/patch-manual_fdo90311:1.2
--- pkgsrc/graphics/MesaLib18/files/patch-manual_fdo90311:1.1   Sun Oct  7 23:49:31 2018
+++ pkgsrc/graphics/MesaLib18/files/patch-manual_fdo90311       Thu Jan 10 22:30:11 2019
@@ -1,111 +1,15 @@
-$NetBSD: patch-manual_fdo90311,v 1.1 2018/10/07 23:49:31 ryoon Exp $
+$NetBSD: patch-manual_fdo90311,v 1.2 2019/01/10 22:30:11 tnn Exp $
 
 https://bugs.freedesktop.org/show_bug.cgi?id=90311
 
-Regenerated with autoconf to link with C++ linker using this addition:
-
-libglx_la_LIBADD += $(builddir)/apple/libappleglx.la + $(top_builddir)/src/mesa/libmesa.la
-nodist_EXTRA_lib@GL_LIB@_la_SOURCES = dummy.cpp
-
-and then dummy.cpp manuallly edited out.
-
---- src/glx/Makefile.in.orig   2015-12-15 14:52:32.000000000 +0000
-+++ src/glx/Makefile.in
-@@ -143,7 +143,7 @@ target_triplet = @target@
- @HAVE_APPLEDRI_TRUE@  applegl_glx.c
- 
- @HAVE_APPLEDRI_TRUE@am__append_7 = apple
--@HAVE_APPLEDRI_TRUE@am__append_8 = $(builddir)/apple/libappleglx.la
-+@HAVE_APPLEDRI_TRUE@am__append_8 = $(builddir)/apple/libappleglx.la $(top_builddir)/src/mesa/libmesa.la
- subdir = src/glx
- ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
- am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_gnu_make.m4 \
-@@ -202,10 +202,10 @@ AM_V_lt = $(am__v_lt_@AM_V@)
- am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
- am__v_lt_0 = --silent
- am__v_lt_1 = 
--lib@GL_LIB@_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
--      $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
--      $(AM_CFLAGS) $(CFLAGS) $(lib@GL_LIB@_la_LDFLAGS) $(LDFLAGS) -o \
--      $@
-+lib@GL_LIB@_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
-+      $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
-+      $(AM_CXXFLAGS) $(CXXFLAGS) $(lib@GL_LIB@_la_LDFLAGS) \
-+      $(LDFLAGS) -o $@
- libglx_la_DEPENDENCIES = $(top_builddir)/src/loader/libloader.la \
-       $(am__append_5) $(am__append_8)
- am__libglx_la_SOURCES_DIST = clientattrib.c clientinfo.c compsize.c \
-@@ -276,6 +276,24 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
- am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
- am__v_CCLD_0 = @echo "  CCLD    " $@;
- am__v_CCLD_1 = 
-+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-+      $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-+LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
-+      $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
-+      $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-+      $(AM_CXXFLAGS) $(CXXFLAGS)
-+AM_V_CXX = $(am__v_CXX_@AM_V@)
-+am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
-+am__v_CXX_0 = @echo "  CXX     " $@;
-+am__v_CXX_1 = 
-+CXXLD = $(CXX)
-+CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
-+      $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
-+      $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-+AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
-+am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
-+am__v_CXXLD_0 = @echo "  CXXLD   " $@;
-+am__v_CXXLD_1 = 
- SOURCES = $(lib@GL_LIB@_la_SOURCES) $(libglx_la_SOURCES)
- DIST_SOURCES = $(lib@GL_LIB@_la_SOURCES) $(am__libglx_la_SOURCES_DIST)
- RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
-@@ -696,7 +714,7 @@ lib@GL_LIB@_la_LDFLAGS = $(GL_LDFLAGS)
- all: all-recursive
- 
- .SUFFIXES:
--.SUFFIXES: .c .lo .o .obj
-+.SUFFIXES: .c .cpp .lo .o .obj
- $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/install-lib-links.mk $(am__configure_deps)
-       @for dep in $?; do \
-         case '$(am__configure_deps)' in \
-@@ -775,7 +793,7 @@ clean-noinstLTLIBRARIES:
-       }
- 
- lib@GL_LIB@.la: $(lib@GL_LIB@_la_OBJECTS) $(lib@GL_LIB@_la_DEPENDENCIES) $(EXTRA_lib@GL_LIB@_la_DEPENDENCIES) 
--      $(AM_V_CCLD)$(lib@GL_LIB@_la_LINK) -rpath $(libdir) $(lib@GL_LIB@_la_OBJECTS) $(lib@GL_LIB@_la_LIBADD) $(LIBS)
-+      $(AM_V_CXXLD)$(lib@GL_LIB@_la_LINK) -rpath $(libdir) $(lib@GL_LIB@_la_OBJECTS) $(lib@GL_LIB@_la_LIBADD) $(LIBS)
- 
- libglx.la: $(libglx_la_OBJECTS) $(libglx_la_DEPENDENCIES) $(EXTRA_libglx_la_DEPENDENCIES) 
-       $(AM_V_CCLD)$(LINK)  $(libglx_la_OBJECTS) $(libglx_la_LIBADD) $(LIBS)
-@@ -852,6 +870,30 @@ distclean-compile:
- @AMDEP_TRUE@@am__fastdepCC_FALSE@     DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
- 
-+.cpp.o:
-+@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
-+@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-+@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
-+@AMDEP_TRUE@@am__fastdepCXX_FALSE@    $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-+@AMDEP_TRUE@@am__fastdepCXX_FALSE@    DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-+@am__fastdepCXX_FALSE@        $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
-+
-+.cpp.obj:
-+@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
-+@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
-+@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
-+@AMDEP_TRUE@@am__fastdepCXX_FALSE@    $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-+@AMDEP_TRUE@@am__fastdepCXX_FALSE@    DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-+@am__fastdepCXX_FALSE@        $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-+
-+.cpp.lo:
-+@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
-+@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-+@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
-+@AMDEP_TRUE@@am__fastdepCXX_FALSE@    $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-+@AMDEP_TRUE@@am__fastdepCXX_FALSE@    DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-+@am__fastdepCXX_FALSE@        $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
-+
- mostlyclean-libtool:
-       -rm -f *.lo
+--- src/glx/Makefile.am.orig   2018-12-11 21:13:57.000000000 +0000
++++ src/glx/Makefile.am
+@@ -136,6 +136,8 @@ libglx_la_SOURCES += \
+ 
+ SUBDIRS += apple
+ libglx_la_LIBADD += $(builddir)/apple/libappleglx.la
++libglx_la_LIBADD += $(top_builddir)/src/mesa/libmesa.la
++nodist_EXTRA_lib@GL_LIB@_la_SOURCES = dummy.cpp
+ endif
  
+ if HAVE_WINDOWSDRI

Index: pkgsrc/graphics/MesaLib18/patches/patch-configure.ac
diff -u pkgsrc/graphics/MesaLib18/patches/patch-configure.ac:1.3 pkgsrc/graphics/MesaLib18/patches/patch-configure.ac:1.4
--- pkgsrc/graphics/MesaLib18/patches/patch-configure.ac:1.3    Tue Oct 16 15:21:20 2018
+++ pkgsrc/graphics/MesaLib18/patches/patch-configure.ac        Thu Jan 10 22:30:11 2019
@@ -1,4 +1,4 @@
-$NetBSD: patch-configure.ac,v 1.3 2018/10/16 15:21:20 jperkin Exp $
+$NetBSD: patch-configure.ac,v 1.4 2019/01/10 22:30:11 tnn Exp $
 
 Don't check for pthread stubs anywhere, as we don't provide it.
 
@@ -21,9 +21,9 @@ This change was made to work around a pr
 which fails to fall back to using DRI2 when run on a system
 without DRI3 support.
 
---- configure.ac.orig  2018-09-07 21:18:07.000000000 +0000
+--- configure.ac.orig  2018-12-11 21:13:57.000000000 +0000
 +++ configure.ac
-@@ -713,7 +713,7 @@ dnl
+@@ -726,7 +726,7 @@ dnl
  dnl OSX linker does not support build-id
  dnl
  case "$host_os" in
@@ -32,7 +32,7 @@ without DRI3 support.
      LD_BUILD_ID=""
      ;;
  *)
-@@ -918,7 +918,7 @@ case "$host_os" in
+@@ -931,7 +931,7 @@ case "$host_os" in
  darwin*)
      ;;
  *)
@@ -41,7 +41,7 @@ without DRI3 support.
                     [AC_CHECK_LIB([rt], [clock_gettime], [CLOCK_LIB=-lrt],
                                   [AC_MSG_ERROR([Could not find clock_gettime])])])
      AC_SUBST([CLOCK_LIB])
-@@ -953,7 +953,7 @@ PTHREAD_LIBS="$PTHREAD_LIBS -pthread"
+@@ -966,7 +966,7 @@ PTHREAD_LIBS="$PTHREAD_LIBS -pthread"
  dnl pthread-stubs is mandatory on some BSD platforms, due to the nature of the
  dnl project. Even then there's a notable issue as described in the project README
  case "$host_os" in
@@ -50,8 +50,8 @@ without DRI3 support.
      pthread_stubs_possible="no"
      ;;
  * )
-@@ -966,7 +966,10 @@ if test "x$pthread_stubs_possible" = xye
- fi
+@@ -995,7 +995,10 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([[
+ LIBS="$save_LIBS"
  
  dnl Check for futex for fast inline simple_mtx_t.
 -AC_CHECK_HEADER([linux/futex.h], [DEFINES="$DEFINES -DHAVE_LINUX_FUTEX_H"])
@@ -62,7 +62,7 @@ without DRI3 support.
  
  dnl SELinux awareness.
  AC_ARG_ENABLE([selinux],
-@@ -1249,7 +1252,7 @@ fi
+@@ -1278,7 +1281,7 @@ fi
  AC_SUBST(LIBSENSORS_LIBS)
  
  case "$host_os" in
@@ -71,7 +71,16 @@ without DRI3 support.
      dri3_default=yes
      ;;
  *)
-@@ -2481,8 +2484,6 @@ if test "x$enable_opencl" = xyes; then
+@@ -1908,7 +1911,7 @@ if test x"$enable_dri3" = xyes; then
+     dri3_modifier_modules="xcb-dri3 >= $XCBDRI3_MODIFIERS_REQUIRED xcb-present >= $XCBPRESENT_MODIFIERS_REQUIRED"
+     PKG_CHECK_MODULES([XCB_DRI3_MODIFIERS], [$dri3_modifier_modules], [have_dri3_modifiers=yes], [have_dri3_modifiers=no])
+ 
+-    if test "x$have_dri3_modifiers" == xyes; then
++    if test "x$have_dri3_modifiers" = xyes; then
+         DEFINES="$DEFINES -DHAVE_DRI3_MODIFIERS"
+     fi
+ fi
+@@ -2505,8 +2508,6 @@ if test "x$enable_opencl" = xyes; then
          CLANG_LIBDIR=${LLVM_LIBDIR}
      fi
      CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
@@ -80,3 +89,12 @@ without DRI3 support.
  fi
  AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes)
  AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes)
+@@ -2941,7 +2942,7 @@ if test "x$enable_llvm" = xyes; then
+     dnl the LLVM library propagated in the Libs.private of the respective .pc
+     dnl file which ensures complete dependency information when statically
+     dnl linking.
+-    if test "x$enable_glx" == xgallium-xlib; then
++    if test "x$enable_glx" = xgallium-xlib; then
+         GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $LLVM_LIBS"
+     fi
+     if test "x$enable_gallium_osmesa" = xyes; then

Index: pkgsrc/graphics/MesaLib18/patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c
diff -u pkgsrc/graphics/MesaLib18/patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c:1.1 
pkgsrc/graphics/MesaLib18/patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c:1.2
--- pkgsrc/graphics/MesaLib18/patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c:1.1   Sun Oct  7 23:49:31 2018
+++ pkgsrc/graphics/MesaLib18/patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c       Thu Jan 10 22:30:11 2019
@@ -1,4 +1,4 @@
-$NetBSD: patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
+$NetBSD: patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c,v 1.2 2019/01/10 22:30:11 tnn Exp $
 
 * From FreeBSD ports / DragonFly dports graphics/mesa-dri
 
@@ -25,12 +25,12 @@ v2: Clarify the linking topic in the com
 
 * Extended for NetBSD.
 
---- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c.orig   2017-02-06 13:49:09.000000000 +0000
+--- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c.orig   2018-12-11 21:13:57.000000000 +0000
 +++ src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
-@@ -224,6 +224,16 @@ pipe_loader_drm_probe_fd(struct pipe_loa
-    return false;
+@@ -229,6 +229,16 @@ pipe_loader_drm_probe_fd(struct pipe_loa
+    return ret;
  }
-
+ 
 +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__NetBSD__)
 +static int
 +open_drm_minor(int minor)
@@ -44,7 +44,7 @@ v2: Clarify the linking topic in the com
  static int
  open_drm_render_node_minor(int minor)
  {
-@@ -236,7 +246,19 @@ open_drm_render_node_minor(int minor)
+@@ -241,7 +251,19 @@ open_drm_render_node_minor(int minor)
  int
  pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev)
  {
@@ -64,10 +64,10 @@ v2: Clarify the linking topic in the com
  
     for (i = DRM_RENDER_NODE_MIN_MINOR, j = 0;
          i <= DRM_RENDER_NODE_MAX_MINOR; i++) {
-@@ -251,6 +273,11 @@ pipe_loader_drm_probe(struct pipe_loader
+@@ -256,6 +278,11 @@ pipe_loader_drm_probe(struct pipe_loader
           continue;
        }
-
+ 
 +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__NetBSD__)
 +      render_node_devs[j].vendor_id = dev->u.pci.vendor_id;
 +      render_node_devs[j].chip_id = dev->u.pci.chip_id;
@@ -76,10 +76,10 @@ v2: Clarify the linking topic in the com
        if (j < ndev) {
           devs[j] = dev;
        } else {
-@@ -260,6 +287,48 @@ pipe_loader_drm_probe(struct pipe_loader
+@@ -265,6 +292,48 @@ pipe_loader_drm_probe(struct pipe_loader
        j++;
     }
-
+ 
 +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__NetBSD__)
 +   num_render_node_devs = j;
 +
Index: pkgsrc/graphics/MesaLib18/patches/patch-src_util_u__queue.c
diff -u pkgsrc/graphics/MesaLib18/patches/patch-src_util_u__queue.c:1.1 pkgsrc/graphics/MesaLib18/patches/patch-src_util_u__queue.c:1.2
--- pkgsrc/graphics/MesaLib18/patches/patch-src_util_u__queue.c:1.1     Sun Oct  7 23:49:31 2018
+++ pkgsrc/graphics/MesaLib18/patches/patch-src_util_u__queue.c Thu Jan 10 22:30:11 2019
@@ -1,13 +1,13 @@
-$NetBSD: patch-src_util_u__queue.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
+$NetBSD: patch-src_util_u__queue.c,v 1.2 2019/01/10 22:30:11 tnn Exp $
 
 atexit() is not a good idea in shared libraries.
 
 FreeBSD reported atexit bug for 10.6:
 https://bugs.freedesktop.org/show_bug.cgi?id=91869
 
---- src/util/u_queue.c.orig    2018-01-09 16:03:44.000000000 +0000
+--- src/util/u_queue.c.orig    2018-12-11 21:13:57.000000000 +0000
 +++ src/util/u_queue.c
-@@ -40,11 +40,22 @@ static once_flag atexit_once_flag = ONCE
+@@ -46,11 +46,22 @@ static once_flag atexit_once_flag = ONCE
  static struct list_head queue_list;
  static mtx_t exit_mutex = _MTX_INITIALIZER_NP;
  
@@ -30,7 +30,7 @@ https://bugs.freedesktop.org/show_bug.cg
     mtx_lock(&exit_mutex);
     /* Wait for all queues to assert idle. */
     LIST_FOR_EACH_ENTRY(iter, &queue_list, head) {
-@@ -57,7 +68,11 @@ static void
+@@ -63,7 +74,11 @@ static void
  global_init(void)
  {
     LIST_INITHEAD(&queue_list);
@@ -42,3 +42,29 @@ https://bugs.freedesktop.org/show_bug.cg
  }
  
  static void
+@@ -244,12 +259,25 @@ util_queue_thread_func(void *input)
+       /* Don't inherit the thread affinity from the parent thread.
+        * Set the full mask.
+        */
++#if defined(__NetBSD__)
++      cpuset_t *cpuset;
++      cpuset = cpuset_create();
++      if (cpuset != NULL) {
++         cpuset_zero(cpuset);
++         for (unsigned i = 0; i < cpuset_size(cpuset); i++)
++            cpuset_set(i, cpuset);
++
++         pthread_setaffinity_np(pthread_self(), cpuset_size(cpuset), cpuset);
++         cpuset_destroy(cpuset);
++      }
++#else
+       cpu_set_t cpuset;
+       CPU_ZERO(&cpuset);
+       for (unsigned i = 0; i < CPU_SETSIZE; i++)
+          CPU_SET(i, &cpuset);
+ 
+       pthread_setaffinity_np(pthread_self(), sizeof(cpuset), &cpuset);
++#endif
+    }
+ #endif
+ 

Added files:

Index: pkgsrc/graphics/MesaLib18/patches/patch-src_gallium_auxiliary_util_u__helpers.c
diff -u /dev/null pkgsrc/graphics/MesaLib18/patches/patch-src_gallium_auxiliary_util_u__helpers.c:1.1
--- /dev/null   Thu Jan 10 22:30:11 2019
+++ pkgsrc/graphics/MesaLib18/patches/patch-src_gallium_auxiliary_util_u__helpers.c     Thu Jan 10 22:30:11 2019
@@ -0,0 +1,32 @@
+$NetBSD: patch-src_gallium_auxiliary_util_u__helpers.c,v 1.1 2019/01/10 22:30:11 tnn Exp $
+
+--- src/gallium/auxiliary/util/u_helpers.c.orig        2018-12-11 21:13:57.000000000 +0000
++++ src/gallium/auxiliary/util/u_helpers.c
+@@ -129,6 +129,19 @@ static once_flag thread_pinning_once_fla
+ static void
+ util_set_full_cpu_affinity(void)
+ {
++#if defined(__NetBSD__)
++   cpuset_t *cpuset;
++
++   cpuset = cpuset_create();
++   if (cpuset != NULL) {
++      cpuset_zero(cpuset);
++      for (unsigned i = 0; i < cpuset_size(cpuset); i++)
++         cpuset_set(i, cpuset);
++
++      pthread_setaffinity_np(pthread_self(), cpuset_size(cpuset), cpuset);
++      cpuset_destroy(cpuset);
++   }
++#else
+    cpu_set_t cpuset;
+ 
+    CPU_ZERO(&cpuset);
+@@ -136,6 +149,7 @@ util_set_full_cpu_affinity(void)
+       CPU_SET(i, &cpuset);
+ 
+    pthread_setaffinity_np(pthread_self(), sizeof(cpuset), &cpuset);
++#endif
+ }
+ 
+ static void
Index: pkgsrc/graphics/MesaLib18/patches/patch-src_intel_tools_aub__mem.c
diff -u /dev/null pkgsrc/graphics/MesaLib18/patches/patch-src_intel_tools_aub__mem.c:1.1
--- /dev/null   Thu Jan 10 22:30:11 2019
+++ pkgsrc/graphics/MesaLib18/patches/patch-src_intel_tools_aub__mem.c  Thu Jan 10 22:30:11 2019
@@ -0,0 +1,36 @@
+$NetBSD: patch-src_intel_tools_aub__mem.c,v 1.1 2019/01/10 22:30:11 tnn Exp $
+
+* Partially implement memfd_create() via mkostemp()
+
+--- src/intel/tools/aub_mem.c.orig     2018-12-11 21:13:57.000000000 +0000
++++ src/intel/tools/aub_mem.c
+@@ -34,7 +34,29 @@
+ static inline int
+ memfd_create(const char *name, unsigned int flags)
+ {
++#if defined(__linux__)
+    return syscall(SYS_memfd_create, name, flags);
++#elif defined(__FreeBSD__)
++   return shm_open(SHM_ANON, flags | O_RDWR | O_CREAT, 0600);
++#else /* DragonFly, NetBSD, OpenBSD, Solaris */
++   char template[] = "/tmp/shmfd-XXXXXX";
++#ifdef HAVE_MKOSTEMP
++   int fd = mkostemp(template, flags);
++#else
++   int fd = mkstemp(template);
++   if (flags & O_CLOEXEC) {
++      int flags = fcntl(fd, F_GETFD);
++      if (flags != -1) {
++         flags |= FD_CLOEXEC;
++         (void) fcntl(fd, F_SETFD, &flags);
++      }
++   }
++#endif /* HAVE_MKOSTEMP */
++   if (fd >= 0)
++      unlink(template);
++
++   return fd;
++#endif /* __linux__ */
+ }
+ #endif
+ 
Index: pkgsrc/graphics/MesaLib18/patches/patch-src_intel_vulkan_anv__gem__stubs.c
diff -u /dev/null pkgsrc/graphics/MesaLib18/patches/patch-src_intel_vulkan_anv__gem__stubs.c:1.1
--- /dev/null   Thu Jan 10 22:30:11 2019
+++ pkgsrc/graphics/MesaLib18/patches/patch-src_intel_vulkan_anv__gem__stubs.c  Thu Jan 10 22:30:11 2019
@@ -0,0 +1,36 @@
+$NetBSD: patch-src_intel_vulkan_anv__gem__stubs.c,v 1.1 2019/01/10 22:30:11 tnn Exp $
+
+* Partially implement memfd_create() via mkostemp()
+
+--- src/intel/vulkan/anv_gem_stubs.c.orig      2018-12-11 21:13:57.000000000 +0000
++++ src/intel/vulkan/anv_gem_stubs.c
+@@ -31,7 +31,29 @@
+ static inline int
+ memfd_create(const char *name, unsigned int flags)
+ {
++#if defined(__linux__)
+    return syscall(SYS_memfd_create, name, flags);
++#elif defined(__FreeBSD__)
++   return shm_open(SHM_ANON, flags | O_RDWR | O_CREAT, 0600);
++#else /* DragonFly, NetBSD, OpenBSD, Solaris */
++   char template[] = "/tmp/shmfd-XXXXXX";
++#ifdef HAVE_MKOSTEMP
++   int fd = mkostemp(template, flags);
++#else
++   int fd = mkstemp(template);
++   if (flags & O_CLOEXEC) {
++      int flags = fcntl(fd, F_GETFD);
++      if (flags != -1) {
++         flags |= FD_CLOEXEC;
++         (void) fcntl(fd, F_SETFD, &flags);
++      }
++   }
++#endif /* HAVE_MKOSTEMP */
++   if (fd >= 0)
++      unlink(template);
++
++   return fd;
++#endif /* __linux__ */
+ }
+ #endif
+ 
Index: pkgsrc/graphics/MesaLib18/patches/patch-src_mesa_drivers_dri_i965_brw__oa__metrics.c
diff -u /dev/null pkgsrc/graphics/MesaLib18/patches/patch-src_mesa_drivers_dri_i965_brw__oa__metrics.c:1.1
--- /dev/null   Thu Jan 10 22:30:11 2019
+++ pkgsrc/graphics/MesaLib18/patches/patch-src_mesa_drivers_dri_i965_brw__oa__metrics.c        Thu Jan 10 22:30:11 2019
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_mesa_drivers_dri_i965_brw__oa__metrics.c,v 1.1 2019/01/10 22:30:11 tnn Exp $
+
+XXX compilation takes forever with clang 7.0
+
+--- src/mesa/drivers/dri/i965/brw_oa_metrics.c.orig    2018-12-11 21:14:35.000000000 +0000
++++ src/mesa/drivers/dri/i965/brw_oa_metrics.c
+@@ -1,3 +1,6 @@
++#if defined(__clang__)
++#pragma clang optimize off
++#endif
+ /* Autogenerated file, DO NOT EDIT manually! generated by brw_oa.py
+  *
+  * Copyright (c) 2015 Intel Corporation
Index: pkgsrc/graphics/MesaLib18/patches/patch-src_util_Makefile.am
diff -u /dev/null pkgsrc/graphics/MesaLib18/patches/patch-src_util_Makefile.am:1.1
--- /dev/null   Thu Jan 10 22:30:11 2019
+++ pkgsrc/graphics/MesaLib18/patches/patch-src_util_Makefile.am        Thu Jan 10 22:30:11 2019
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_util_Makefile.am,v 1.1 2019/01/10 22:30:11 tnn Exp $
+
+handled with CONF_FILES
+
+--- src/util/Makefile.am.orig  2018-12-11 21:13:57.000000000 +0000
++++ src/util/Makefile.am
+@@ -75,7 +75,7 @@ libxmlconfig_la_CFLAGS = \
+ libxmlconfig_la_LIBADD = $(EXPAT_LIBS) -lm
+ 
+ drircdir = $(datadir)/drirc.d
+-drirc_DATA = 00-mesa-defaults.conf
++drirc_DATA = # 00-mesa-defaults.conf
+ 
+ u_atomic_test_LDADD = libmesautil.la
+ roundeven_test_LDADD = -lm
Index: pkgsrc/graphics/MesaLib18/patches/patch-src_util_u__thread.h
diff -u /dev/null pkgsrc/graphics/MesaLib18/patches/patch-src_util_u__thread.h:1.1
--- /dev/null   Thu Jan 10 22:30:11 2019
+++ pkgsrc/graphics/MesaLib18/patches/patch-src_util_u__thread.h        Thu Jan 10 22:30:11 2019
@@ -0,0 +1,74 @@
+$NetBSD: patch-src_util_u__thread.h,v 1.1 2019/01/10 22:30:11 tnn Exp $
+
+--- src/util/u_thread.h.orig   2018-12-11 21:13:57.000000000 +0000
++++ src/util/u_thread.h
+@@ -83,6 +83,17 @@ static inline void
+ util_pin_thread_to_L3(thrd_t thread, unsigned L3_index, unsigned cores_per_L3)
+ {
+ #if defined(HAVE_PTHREAD_SETAFFINITY)
++#if defined(__NetBSD__)
++   cpuset_t *cpuset;
++   cpuset = cpuset_create();
++   if (cpuset == NULL)
++      return;
++   cpuset_zero(cpuset);
++   for (unsigned i = 0; i < cores_per_L3; i++)
++      cpuset_set(L3_index * cores_per_L3 + i, cpuset);
++   pthread_setaffinity_np(thread, cpuset_size(cpuset), cpuset);
++   cpuset_destroy(cpuset);
++#else
+    cpu_set_t cpuset;
+ 
+    CPU_ZERO(&cpuset);
+@@ -90,6 +101,7 @@ util_pin_thread_to_L3(thrd_t thread, uns
+       CPU_SET(L3_index * cores_per_L3 + i, &cpuset);
+    pthread_setaffinity_np(thread, sizeof(cpuset), &cpuset);
+ #endif
++#endif
+ }
+ 
+ /**
+@@ -103,6 +115,35 @@ static inline int
+ util_get_L3_for_pinned_thread(thrd_t thread, unsigned cores_per_L3)
+ {
+ #if defined(HAVE_PTHREAD_SETAFFINITY)
++#if defined(__NetBSD__)
++   cpuset_t *cpuset;
++
++   cpuset = cpuset_create();
++   if (cpuset == NULL)
++      return -1;
++
++   if (pthread_getaffinity_np(thread, cpuset_size(cpuset), cpuset) == 0) {
++      int L3_index = -1;
++
++      for (unsigned i = 0; i < cpuset_size(cpuset); i++) {
++         if (cpuset_isset(i, cpuset)) {
++            int x = i / cores_per_L3;
++
++            if (L3_index != x) {
++               if (L3_index == -1)
++                  L3_index = x;
++               else {
++                  cpuset_destroy(cpuset);
++                  return -1; /* multiple L3s are set */
++               }
++            }
++         }
++      }
++      cpuset_destroy(cpuset);
++      return L3_index;
++   }
++   cpuset_destroy(cpuset);
++#else
+    cpu_set_t cpuset;
+ 
+    if (pthread_getaffinity_np(thread, sizeof(cpuset), &cpuset) == 0) {
+@@ -123,6 +164,7 @@ util_get_L3_for_pinned_thread(thrd_t thr
+       return L3_index;
+    }
+ #endif
++#endif
+    return -1;
+ }
+ 



Home | Main Index | Thread Index | Old Index