From 316944e73fa1a52662cb684c04a2feec9a2a5722 Mon Sep 17 00:00:00 2001 From: maya Date: Fri, 24 Feb 2017 03:25:36 +0000 Subject: libva: put a temp bandaid on the giant mess I created (sorry) a circular dependency of MesaLib - now libva will not depend on it, this breaks stuff but unbreaks the tree ASAP add a patch so va_trace.c should compile on freebsd, dragonflybsd, linux and netbsd -- excluding it is a bad idea (undefined references, oops) indirectly put openbsd as a broken platform for now still fails at runtime with mpv. bump PKGREVISION. --- multimedia/libva/Makefile | 11 ++-- multimedia/libva/PLIST | 10 +-- multimedia/libva/available.mk | 8 ++- multimedia/libva/distinfo | 4 +- multimedia/libva/patches/patch-ad | 15 ----- multimedia/libva/patches/patch-va_va__trace.c | 90 +++++++++++++++++++++++++++ 6 files changed, 105 insertions(+), 33 deletions(-) delete mode 100644 multimedia/libva/patches/patch-ad create mode 100644 multimedia/libva/patches/patch-va_va__trace.c (limited to 'multimedia') diff --git a/multimedia/libva/Makefile b/multimedia/libva/Makefile index 1fe33e3cd2c..0b9f621335e 100644 --- a/multimedia/libva/Makefile +++ b/multimedia/libva/Makefile @@ -1,7 +1,8 @@ -# $NetBSD: Makefile,v 1.10 2017/02/24 00:10:04 maya Exp $ +# $NetBSD: Makefile,v 1.11 2017/02/24 03:25:36 maya Exp $ # DISTNAME= libva-1.7.3 +PKGREVISION= 1 CATEGORIES= multimedia MASTER_SITES= http://www.freedesktop.org/software/vaapi/releases/libva/ EXTRACT_SUFX= .tar.bz2 @@ -37,10 +38,10 @@ PLIST_VARS+= egl pre-configure: cd ${WRKSRC} && autoreconf -i -.include "../../graphics/MesaLib/buildlink3.mk" -.if !empty(MESALIB_SUPPORTS_EGL:Myes) -PLIST.egl= yes -.endif +#.include "../../graphics/MesaLib/buildlink3.mk" +#.if !empty(MESALIB_SUPPORTS_EGL:Myes) +#PLIST.egl= yes +#.endif .include "../../x11/libXfixes/buildlink3.mk" .include "../../x11/libXext/buildlink3.mk" .include "../../x11/libX11/buildlink3.mk" diff --git a/multimedia/libva/PLIST b/multimedia/libva/PLIST index f55d9420ed9..1f792ab33ed 100644 --- a/multimedia/libva/PLIST +++ b/multimedia/libva/PLIST @@ -1,8 +1,6 @@ -@comment $NetBSD: PLIST,v 1.5 2017/02/24 00:10:04 maya Exp $ +@comment $NetBSD: PLIST,v 1.6 2017/02/24 03:25:36 maya Exp $ include/va/va.h include/va/va_backend.h -${PLIST.egl}include/va/va_backend_egl.h -include/va/va_backend_glx.h include/va/va_backend_tpi.h include/va/va_backend_vpp.h include/va/va_compat.h @@ -14,27 +12,21 @@ include/va/va_dri2.h include/va/va_dricommon.h include/va/va_drm.h include/va/va_drmcommon.h -${PLIST.egl}include/va/va_egl.h include/va/va_enc_h264.h include/va/va_enc_hevc.h include/va/va_enc_jpeg.h include/va/va_enc_mpeg2.h include/va/va_enc_vp8.h include/va/va_enc_vp9.h -include/va/va_glx.h include/va/va_tpi.h include/va/va_version.h include/va/va_vpp.h include/va/va_x11.h lib/libva-drm.la -${PLIST.egl}lib/libva-egl.la -lib/libva-glx.la lib/libva-tpi.la lib/libva-x11.la lib/libva.la lib/pkgconfig/libva-drm.pc -${PLIST.egl}lib/pkgconfig/libva-egl.pc -lib/pkgconfig/libva-glx.pc lib/pkgconfig/libva-tpi.pc lib/pkgconfig/libva-x11.pc lib/pkgconfig/libva.pc diff --git a/multimedia/libva/available.mk b/multimedia/libva/available.mk index f8b30b4cb6d..a902edd56bc 100644 --- a/multimedia/libva/available.mk +++ b/multimedia/libva/available.mk @@ -1,4 +1,4 @@ -# $NetBSD: available.mk,v 1.5 2017/02/24 00:10:04 maya Exp $ +# $NetBSD: available.mk,v 1.6 2017/02/24 03:25:36 maya Exp $ .include "../../mk/bsd.prefs.mk" @@ -7,7 +7,11 @@ # i.e. in mplayer, xine, xbmc etc. Have a look at buildlink3.mk too. # The following should be kept up-to-date! -.if ${OPSYS} != "Darwin" +.if ${OPSYS} == "FreeBSD" +VAAPI_AVAILABLE= yes +.elif ${OPSYS} == "NetBSD" +VAAPI_AVAILABLE= yes +.elif ${OPSYS} == "Linux" VAAPI_AVAILABLE= yes .else VAAPI_AVAILABLE= no diff --git a/multimedia/libva/distinfo b/multimedia/libva/distinfo index 82d5de55509..24375933dda 100644 --- a/multimedia/libva/distinfo +++ b/multimedia/libva/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.5 2017/02/24 00:10:04 maya Exp $ +$NetBSD: distinfo,v 1.6 2017/02/24 03:25:36 maya Exp $ SHA1 (libva-1.7.3.tar.bz2) = 18e46f3d5a0e971eb0ec9fe14bc021e69eb13fb8 RMD160 (libva-1.7.3.tar.bz2) = d29e432f666df9df8b312c45cd7d9ec2f6ef6e3c @@ -6,5 +6,5 @@ SHA512 (libva-1.7.3.tar.bz2) = ecc1ba17e2afea2efe4d36e8d9358d420015b3ad9d2a510ee Size (libva-1.7.3.tar.bz2) = 824490 bytes SHA1 (patch-aa) = 3e4966037c46fada25cc869b672a7e78dda5b04b SHA1 (patch-ac) = 776cd2f381ec974bf25054b949912a713d832ae3 -SHA1 (patch-ad) = d19b14007a7b031a6b8d2ec2607057b2dea839c9 SHA1 (patch-va_glx_va__glx__private.h) = daf6552189295a86f1f073ef107b7449e4098251 +SHA1 (patch-va_va__trace.c) = 874c1ec2abd16368fb0df7de57ba17521d08b3c2 diff --git a/multimedia/libva/patches/patch-ad b/multimedia/libva/patches/patch-ad deleted file mode 100644 index 5a7c8dd779d..00000000000 --- a/multimedia/libva/patches/patch-ad +++ /dev/null @@ -1,15 +0,0 @@ -$NetBSD: patch-ad,v 1.3 2017/02/24 00:10:05 maya Exp $ - -Don't build va_trace.c - it requires linux-specific stuff, -and is used for tracing (and doesn't seem necessary). - ---- va/Makefile.am.orig 2016-11-10 00:34:35.000000000 +0000 -+++ va/Makefile.am -@@ -33,7 +33,6 @@ libva_source_c = \ - va.c \ - va_compat.c \ - va_fool.c \ -- va_trace.c \ - $(NULL) - - libva_source_h = \ diff --git a/multimedia/libva/patches/patch-va_va__trace.c b/multimedia/libva/patches/patch-va_va__trace.c new file mode 100644 index 00000000000..9d329ed736d --- /dev/null +++ b/multimedia/libva/patches/patch-va_va__trace.c @@ -0,0 +1,90 @@ +$NetBSD: patch-va_va__trace.c,v 1.1 2017/02/24 03:25:36 maya Exp $ + +attempt to provide syscall(__NR_gettid) for most +systems. inspired by lldb Host.cpp + +--- va/va_trace.c.orig 2016-11-10 00:34:35.000000000 +0000 ++++ va/va_trace.c +@@ -48,6 +48,12 @@ + #include + #include + #include ++#if defined(__FreeBSD__) || defined(__DragonFly__) ++#include ++#endif ++#if defined(__NetBSD__) ++#include ++#endif + #include + #include + #include +@@ -294,7 +300,13 @@ static void add_trace_config_info( + { + struct trace_config_info *pconfig_info; + int idx = 0; ++#if defined(__linux__) + pid_t thd_id = syscall(__NR_gettid); ++#elif defined(__NetBSD__) ++ pid_t thd_id = _lwp_self(); ++#elif defined(__FreeBSD__) || defined(__DragonFly__) ++ pid_t thd_id = pthread_getthreadid_np(); ++#endif + + LOCK_RESOURCE(pva_trace); + +@@ -318,7 +330,13 @@ static void delete_trace_config_info( + { + struct trace_config_info *pconfig_info; + int idx = 0; ++#if defined(__linux__) + pid_t thd_id = syscall(__NR_gettid); ++#elif defined(__NetBSD__) ++ pid_t thd_id = _lwp_self(); ++#elif defined(__FreeBSD__) || defined(__DragonFly__) ++ pid_t thd_id = pthread_getthreadid_np(); ++#endif + + LOCK_RESOURCE(pva_trace); + +@@ -665,7 +683,13 @@ static struct trace_log_file *start_trac + { + struct trace_log_files_manager *plog_files_mgr = NULL; + struct trace_log_file *plog_file = NULL; ++#if defined(__linux__) + pid_t thd_id = syscall(__NR_gettid); ++#elif defined(__NetBSD__) ++ pid_t thd_id = _lwp_self(); ++#elif defined(__FreeBSD__) || defined(__DragonFly__) ++ pid_t thd_id = pthread_getthreadid_np(); ++#endif + int i = 0; + + LOCK_RESOURCE(pva_trace); +@@ -704,7 +728,13 @@ static void refresh_log_file( + struct trace_context *ptra_ctx) + { + struct trace_log_file *plog_file = NULL; ++#if defined(__linux__) + pid_t thd_id = syscall(__NR_gettid); ++#elif defined(__NetBSD__) ++ pid_t thd_id = _lwp_self(); ++#elif defined(__FreeBSD__) || defined(__DragonFly__) ++ pid_t thd_id = pthread_getthreadid_np(); ++#endif + int i = 0; + + plog_file = ptra_ctx->plog_file; +@@ -1226,7 +1256,13 @@ static void internal_TraceUpdateContext + { + struct trace_context *trace_ctx = NULL; + int i = 0, delete = 1; ++#if defined(__linux__) + pid_t thd_id = syscall(__NR_gettid); ++#elif defined(__NetBSD__) ++ pid_t thd_id = _lwp_self(); ++#elif defined(__FreeBSD__) || defined(__DragonFly__) ++ pid_t thd_id = pthread_getthreadid_np(); ++#endif + + if(tra_ctx_idx >= MAX_TRACE_CTX_NUM) + return; -- cgit v1.2.3