diff options
author | maya <maya@pkgsrc.org> | 2017-02-24 16:44:03 +0000 |
---|---|---|
committer | maya <maya@pkgsrc.org> | 2017-02-24 16:44:03 +0000 |
commit | 3a94502df3b4336b99c77787b5b5a27af9a9ab74 (patch) | |
tree | 508bac000bd0f675465007e52797d62ce3181461 /multimedia | |
parent | 4970c8fa3c2a09e50ba4c5ac5b6109969bd54fb4 (diff) | |
download | pkgsrc-3a94502df3b4336b99c77787b5b5a27af9a9ab74.tar.gz |
libva: clean up va_trace.c patch, hard-code gallium, appease libtool.
have an else case for the va_trace.c else patch, it seems to work
fine. not sure if the thread id needs to exist for anything, but
provide it anyway.
if we don't hard-code galilum, in the case of nouveau, it'll attempt
to use nouveau - which doesn't define __vaDriverInit_0_39. only gallium
does, so force it.
this way it works without specifying env LIBVA_DRIVER_NAME.
don't use -ldl in the makefile, it makes libtool angry (restoring
old patch-ad), although I haven't checked whether it works without
the patch.
the available.mk file is probably bogus, and I'd really like to only
rule out platforms if a problem shows up (rather than assume one exists),
but I won't change the world order.
tested with mpv --vo=vaapi (after adding libva as a dependency),
nvidia GTX 770 (nouveau) on NetBSD. it claims to be using vaapi and
plays a video fine.
bump PKGREVISION.
Diffstat (limited to 'multimedia')
-rw-r--r-- | multimedia/libva/Makefile | 11 | ||||
-rw-r--r-- | multimedia/libva/PLIST | 4 | ||||
-rw-r--r-- | multimedia/libva/available.mk | 4 | ||||
-rw-r--r-- | multimedia/libva/distinfo | 6 | ||||
-rw-r--r-- | multimedia/libva/patches/patch-va_Makefile.am | 67 | ||||
-rw-r--r-- | multimedia/libva/patches/patch-va_va.c | 29 | ||||
-rw-r--r-- | multimedia/libva/patches/patch-va_va__trace.c | 77 |
7 files changed, 149 insertions, 49 deletions
diff --git a/multimedia/libva/Makefile b/multimedia/libva/Makefile index 0b9f621335e..62c654bb219 100644 --- a/multimedia/libva/Makefile +++ b/multimedia/libva/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.11 2017/02/24 03:25:36 maya Exp $ +# $NetBSD: Makefile,v 1.12 2017/02/24 16:44:03 maya Exp $ # DISTNAME= libva-1.7.3 -PKGREVISION= 1 +PKGREVISION= 2 CATEGORIES= multimedia MASTER_SITES= http://www.freedesktop.org/software/vaapi/releases/libva/ EXTRACT_SUFX= .tar.bz2 @@ -18,7 +18,7 @@ USE_TOOLS+= autoreconf autoconf automake gmake pkg-config .include "../../mk/bsd.prefs.mk" -DRIVER_SEARCH_PATH= ${PREFIX}/lib/xorg/modules/dri +DRIVER_SEARCH_PATH= ${X11BASE}/lib/dri CONFIGURE_ARGS+= --enable-i965-driver CONFIGURE_ARGS+= --enable-shared @@ -33,11 +33,14 @@ PKGCONFIG_OVERRIDE+= libva-tpi.pc.in PKGCONFIG_OVERRIDE+= libva-x11.pc.in PKGCONFIG_OVERRIDE+= libva.pc.in -PLIST_VARS+= egl pre-configure: cd ${WRKSRC} && autoreconf -i +# XXX introduces a circular dependency if this package +# is a dependency to MesaLib, but seems to work anyway +# worth checking if it's necessary for anything +#PLIST_VARS+= egl #.include "../../graphics/MesaLib/buildlink3.mk" #.if !empty(MESALIB_SUPPORTS_EGL:Myes) #PLIST.egl= yes diff --git a/multimedia/libva/PLIST b/multimedia/libva/PLIST index 1f792ab33ed..dd493bc9aac 100644 --- a/multimedia/libva/PLIST +++ b/multimedia/libva/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.6 2017/02/24 03:25:36 maya Exp $ +@comment $NetBSD: PLIST,v 1.7 2017/02/24 16:44:03 maya Exp $ include/va/va.h include/va/va_backend.h include/va/va_backend_tpi.h @@ -22,6 +22,7 @@ include/va/va_tpi.h include/va/va_version.h include/va/va_vpp.h include/va/va_x11.h +lib/dri/dummy_drv_video.la lib/libva-drm.la lib/libva-tpi.la lib/libva-x11.la @@ -30,4 +31,3 @@ lib/pkgconfig/libva-drm.pc lib/pkgconfig/libva-tpi.pc lib/pkgconfig/libva-x11.pc lib/pkgconfig/libva.pc -lib/xorg/modules/dri/dummy_drv_video.la diff --git a/multimedia/libva/available.mk b/multimedia/libva/available.mk index a902edd56bc..e63f428cd29 100644 --- a/multimedia/libva/available.mk +++ b/multimedia/libva/available.mk @@ -1,4 +1,4 @@ -# $NetBSD: available.mk,v 1.6 2017/02/24 03:25:36 maya Exp $ +# $NetBSD: available.mk,v 1.7 2017/02/24 16:44:03 maya Exp $ .include "../../mk/bsd.prefs.mk" @@ -7,6 +7,8 @@ # i.e. in mplayer, xine, xbmc etc. Have a look at buildlink3.mk too. # The following should be kept up-to-date! +.if ${OPSYS} == "DragonFly" +VAAPI_AVAILABLE= yes .if ${OPSYS} == "FreeBSD" VAAPI_AVAILABLE= yes .elif ${OPSYS} == "NetBSD" diff --git a/multimedia/libva/distinfo b/multimedia/libva/distinfo index 24375933dda..f117d8c54f6 100644 --- a/multimedia/libva/distinfo +++ b/multimedia/libva/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.6 2017/02/24 03:25:36 maya Exp $ +$NetBSD: distinfo,v 1.7 2017/02/24 16:44:03 maya Exp $ SHA1 (libva-1.7.3.tar.bz2) = 18e46f3d5a0e971eb0ec9fe14bc021e69eb13fb8 RMD160 (libva-1.7.3.tar.bz2) = d29e432f666df9df8b312c45cd7d9ec2f6ef6e3c @@ -6,5 +6,7 @@ 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-va_Makefile.am) = 0bf9bb930bce79994ef060e6ad44cb1bf9eb0773 SHA1 (patch-va_glx_va__glx__private.h) = daf6552189295a86f1f073ef107b7449e4098251 -SHA1 (patch-va_va__trace.c) = 874c1ec2abd16368fb0df7de57ba17521d08b3c2 +SHA1 (patch-va_va.c) = 6987c93b7be0d2c9fda780b73e48894faaed60f1 +SHA1 (patch-va_va__trace.c) = 4dfdc200e9e34625929612e594d880cff1f6271d diff --git a/multimedia/libva/patches/patch-va_Makefile.am b/multimedia/libva/patches/patch-va_Makefile.am new file mode 100644 index 00000000000..913bfe2dd22 --- /dev/null +++ b/multimedia/libva/patches/patch-va_Makefile.am @@ -0,0 +1,67 @@ +$NetBSD: patch-va_Makefile.am,v 1.1 2017/02/24 16:44:03 maya Exp $ + +Don't hardcore -ldl + +--- va/Makefile.am.orig 2016-11-10 00:34:35.000000000 +0000 ++++ va/Makefile.am +@@ -76,13 +76,13 @@ noinst_HEADERS = $(libva_source_h_priv + libva_la_SOURCES = $(libva_source_c) + libva_la_LDFLAGS = $(libva_ldflags) + libva_la_DEPENDENCIES = libva.syms +-libva_la_LIBADD = $(LIBVA_LIBS) -ldl ++libva_la_LIBADD = $(LIBVA_LIBS) + + lib_LTLIBRARIES += libva-tpi.la + libva_tpi_la_SOURCES = va_tpi.c + libva_tpi_la_LDFLAGS = $(LDADD) -no-undefined + libva_tpi_la_DEPENDENCIES = libva.la +-libva_tpi_la_LIBADD = libva.la -ldl ++libva_tpi_la_LIBADD = libva.la + + if USE_DRM + SUBDIRS += drm +@@ -91,7 +91,7 @@ libva_drm_la_SOURCES = + libva_drm_la_LDFLAGS = $(LDADD) + libva_drm_la_DEPENDENCIES = libva.la drm/libva_drm.la + libva_drm_la_LIBADD = libva.la drm/libva_drm.la \ +- $(LIBVA_LIBS) $(DRM_LIBS) -ldl ++ $(LIBVA_LIBS) $(DRM_LIBS) + endif + + if USE_X11 +@@ -102,7 +102,7 @@ libva_x11_la_SOURCES = + libva_x11_la_LDFLAGS = $(LDADD) + libva_x11_la_DEPENDENCIES = libva.la x11/libva_x11.la + libva_x11_la_LIBADD = libva.la x11/libva_x11.la \ +- $(LIBVA_LIBS) $(X11_LIBS) $(XEXT_LIBS) $(XFIXES_LIBS) $(DRM_LIBS) -ldl ++ $(LIBVA_LIBS) $(X11_LIBS) $(XEXT_LIBS) $(XFIXES_LIBS) $(DRM_LIBS) + endif + + if USE_GLX +@@ -112,7 +112,7 @@ libva_glx_la_SOURCES = + libva_glx_la_LDFLAGS = $(LDADD) + libva_glx_la_DEPENDENCIES = libva.la glx/libva_glx.la libva-x11.la + libva_glx_la_LIBADD = libva.la glx/libva_glx.la libva-x11.la \ +- $(GLX_LIBS) -ldl ++ $(GLX_LIBS) + endif + + if USE_EGL +@@ -122,7 +122,7 @@ libva_egl_la_SOURCES = + libva_egl_la_LDFLAGS = $(LDADD) + libva_egl_la_DEPENDENCIES = libva.la egl/libva_egl.la + libva_egl_la_LIBADD = libva.la egl/libva_egl.la \ +- $(EGL_LIBS) -ldl ++ $(EGL_LIBS) + endif + + if USE_WAYLAND +@@ -132,7 +132,7 @@ libva_wayland_la_SOURCES = + libva_wayland_la_LDFLAGS = $(LDADD) + libva_wayland_la_DEPENDENCIES = libva.la wayland/libva_wayland.la + libva_wayland_la_LIBADD = libva.la wayland/libva_wayland.la \ +- $(WAYLAND_LIBS) $(DRM_LIBS) -ldl ++ $(WAYLAND_LIBS) $(DRM_LIBS) + endif + + DIST_SUBDIRS = x11 glx egl drm wayland diff --git a/multimedia/libva/patches/patch-va_va.c b/multimedia/libva/patches/patch-va_va.c new file mode 100644 index 00000000000..976f8ef8b2b --- /dev/null +++ b/multimedia/libva/patches/patch-va_va.c @@ -0,0 +1,29 @@ +$NetBSD: patch-va_va.c,v 1.1 2017/02/24 16:44:03 maya Exp $ + +libva can currently (201702) only use gallium, having tested +for the definition of __vaDriverInit in libraries in DRIVER_SEARCH_PATH +(see package Makefile). + +however, it doesn't guess the right driver name for nouveau, so force +it to use gallium. + +--- va/va.c.orig 2016-11-10 01:04:28.000000000 +0000 ++++ va/va.c +@@ -557,6 +557,17 @@ VAStatus vaInitialize ( + driver_name = strdup(driver_name_env); + vaStatus = VA_STATUS_SUCCESS; + va_infoMessage("User requested driver '%s'\n", driver_name); ++ } else { ++ /* ++ * XXX 201702 only gallium works (provides the required __vaDriverInit) ++ * XXX but the correct name is not guessed, so force it. ++ */ ++ if (driver_name) /* memory is allocated in va_getDriverName */ ++ free(driver_name); ++ ++ driver_name = strdup("gallium"); ++ vaStatus = VA_STATUS_SUCCESS; ++ va_infoMessage("Using hard-coded gallium driver\n"); + } + + if ((VA_STATUS_SUCCESS == vaStatus) && (driver_name != NULL)) { diff --git a/multimedia/libva/patches/patch-va_va__trace.c b/multimedia/libva/patches/patch-va_va__trace.c index 9d329ed736d..4251f5d8a2a 100644 --- a/multimedia/libva/patches/patch-va_va__trace.c +++ b/multimedia/libva/patches/patch-va_va__trace.c @@ -1,4 +1,4 @@ -$NetBSD: patch-va_va__trace.c,v 1.1 2017/02/24 03:25:36 maya Exp $ +$NetBSD: patch-va_va__trace.c,v 1.2 2017/02/24 16:44:03 maya Exp $ attempt to provide syscall(__NR_gettid) for most systems. inspired by lldb Host.cpp @@ -18,73 +18,70 @@ systems. inspired by lldb Host.cpp #include <unistd.h> #include <time.h> #include <errno.h> -@@ -294,7 +300,13 @@ static void add_trace_config_info( - { - struct trace_config_info *pconfig_info; - int idx = 0; +@@ -235,6 +241,21 @@ struct va_trace { + + /* Prototype declarations (functions defined in va.c) */ + ++pid_t get_tid() { +#if defined(__linux__) - pid_t thd_id = syscall(__NR_gettid); ++ return syscall(__NR_gettid); +#elif defined(__NetBSD__) -+ pid_t thd_id = _lwp_self(); ++ return _lwp_self(); +#elif defined(__FreeBSD__) || defined(__DragonFly__) -+ pid_t thd_id = pthread_getthreadid_np(); ++ return pthread_getthreadid_np(); ++#elif defined(__OpenBSD__) ++ return syscall(SYS_getthrid); ++#else ++#warning "Don't know how to get thread id" ++ return 0; +#endif ++} ++ + void va_errorMessage(const char *msg, ...); + void va_infoMessage(const char *msg, ...); + +@@ -294,7 +315,7 @@ static void add_trace_config_info( + { + struct trace_config_info *pconfig_info; + int idx = 0; +- pid_t thd_id = syscall(__NR_gettid); ++ pid_t thd_id = get_tid(); LOCK_RESOURCE(pva_trace); -@@ -318,7 +330,13 @@ static void delete_trace_config_info( +@@ -318,7 +339,7 @@ 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 +- pid_t thd_id = syscall(__NR_gettid); ++ pid_t thd_id = get_tid(); LOCK_RESOURCE(pva_trace); -@@ -665,7 +683,13 @@ static struct trace_log_file *start_trac +@@ -665,7 +686,7 @@ 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 +- pid_t thd_id = syscall(__NR_gettid); ++ pid_t thd_id = get_tid(); int i = 0; LOCK_RESOURCE(pva_trace); -@@ -704,7 +728,13 @@ static void refresh_log_file( +@@ -704,7 +725,7 @@ 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 +- pid_t thd_id = syscall(__NR_gettid); ++ pid_t thd_id = get_tid(); int i = 0; plog_file = ptra_ctx->plog_file; -@@ -1226,7 +1256,13 @@ static void internal_TraceUpdateContext +@@ -1226,7 +1247,7 @@ 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 +- pid_t thd_id = syscall(__NR_gettid); ++ pid_t thd_id = get_tid(); if(tra_ctx_idx >= MAX_TRACE_CTX_NUM) return; |