Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Jan 2019 23:54:42 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r490611 - in head/multimedia: libva libva-intel-driver libva-vdpau-driver/files libva/files
Message-ID:  <201901172354.x0HNsga6056894@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Thu Jan 17 23:54:42 2019
New Revision: 490611
URL: https://svnweb.freebsd.org/changeset/ports/490611

Log:
  multimedia/libva{,-intel-driver}: clean up
  
  - Add BUILD_DEPENDS to intel driver for wl_drm_interface fix
  - Rewrite gettid() to make it easier to maintain
  - Update description from upstream
  - Drop unused v4l_compat dependency
  - Drop unused USES=alias as <alloca.h> is gone
  - Drop libGL dependency as intel driver uses libEGL via dlopen on Wayland
  - Drop --program-prefix after vainfo moved to libva-utils
  - Drop fmake workaround as USES=gmake is used
  - Drop -ldl workaround for FreeBSD < 11.2
  - Drop RTLD_NODELETE workaround for FreeBSD < 8.0
  - Drop GLX_GLXEXT_VERSION workaround for Mesa < 7.8.1
  - Drop Created by as the port diverged a lot (even more with Meson)
  - Hint intel driver isn't actively developed (but still maintained)
  - Clarify libdrm dependency

Added:
  head/multimedia/libva-vdpau-driver/files/patch-src_vdpau__video.h   (contents, props changed)
Deleted:
  head/multimedia/libva/files/patch-va_glx_va__glx__private.h
  head/multimedia/libva/files/patch-va_va.c
Modified:
  head/multimedia/libva-intel-driver/Makefile   (contents, props changed)
  head/multimedia/libva/Makefile   (contents, props changed)
  head/multimedia/libva/files/patch-va_va__trace.c   (contents, props changed)
  head/multimedia/libva/pkg-descr   (contents, props changed)

Modified: head/multimedia/libva-intel-driver/Makefile
==============================================================================
--- head/multimedia/libva-intel-driver/Makefile	Thu Jan 17 23:29:30 2019	(r490610)
+++ head/multimedia/libva-intel-driver/Makefile	Thu Jan 17 23:54:42 2019	(r490611)
@@ -1,16 +1,15 @@
-# Created by: Manuel Creach <manuel.creach@me.com>
 # $FreeBSD$
 
 PORTNAME=	libva-intel-driver
 PORTVERSION=	2.3.0
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	multimedia
 
 PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
 PATCHFILES+=	f139dafa5917.patch:-p1 # for mesa-libs 18.3+
 
 MAINTAINER=	jbeich@FreeBSD.org
-COMMENT=	VAAPI driver for Intel GMA 4500 (Gen4) or newer
+COMMENT=	VAAPI legacy driver for Intel GMA 4500 (Gen4) or newer
 
 LICENSE=	MIT
 LICENSE_FILE=	${WRKSRC}/COPYING
@@ -18,14 +17,12 @@ LICENSE_FILE=	${WRKSRC}/COPYING
 ONLY_FOR_ARCHS=	amd64 i386
 ONLY_FOR_ARCHS_REASON=	Only Intel GPUs on x86 are supported
 
+BUILD_DEPENDS=	libva>=2.3.0_3:multimedia/libva
 LIB_DEPENDS=	libva.so:multimedia/libva \
-		libdrm.so:graphics/libdrm
-BUILD_DEPENDS=	${LOCALBASE}/include/linux/videodev2.h:multimedia/v4l_compat
+		libdrm_intel.so:graphics/libdrm
 
 GNU_CONFIGURE=	yes
-USES=		alias autoreconf compiler:c11 gmake libtool localbase \
-		pkgconfig tar:bzip2
-USE_GL=		gl
+USES=		autoreconf compiler:c11 gmake libtool pkgconfig tar:bzip2
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	intel
@@ -40,8 +37,6 @@ HYBRID_RUN_DEPENDS=	${LOCALBASE}/lib/dri/hybrid_drv_vi
 HYBRID_CONFIGURE_ENABLE=	hybrid-codec
 
 post-patch:	.SILENT
-	${REINPLACE_CMD} -e 's/-ldl//' \
-		${WRKSRC}/src/Makefile.am
 # XXX Remove va_api_version hack after 2.4.0 update
 	${REINPLACE_CMD} -e 's|driverdir|& --define-variable prefix=${PREFIX}|' \
 		-e '/va_api_version/s/1\.4\.0/1.1.0/' \

Added: head/multimedia/libva-vdpau-driver/files/patch-src_vdpau__video.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/libva-vdpau-driver/files/patch-src_vdpau__video.h	Thu Jan 17 23:54:42 2019	(r490611)
@@ -0,0 +1,36 @@
+In file included from vdpau_video.c:22:
+./vdpau_video.h:277:12: warning: declaration of 'struct v4l2_format' will not be visible outside of this function
+      [-Wvisibility]
+    struct v4l2_format *v4l2_fmt,
+           ^
+./vdpau_video.h:278:12: warning: declaration of 'struct v4l2_buffer' will not be visible outside of this function
+      [-Wvisibility]
+    struct v4l2_buffer *v4l2_buf,
+           ^
+vdpau_video.c:930:12: warning: declaration of 'struct v4l2_format' will not be visible outside of this function
+      [-Wvisibility]
+    struct v4l2_format *v4l2_fmt,
+           ^
+vdpau_video.c:931:12: warning: declaration of 'struct v4l2_buffer' will not be visible outside of this function
+      [-Wvisibility]
+    struct v4l2_buffer *v4l2_buf,
+           ^
+vdpau_video.c:927:1: error: conflicting types for 'vdpau_CreateSurfaceFromV4L2Buf'
+vdpau_CreateSurfaceFromV4L2Buf(
+^
+./vdpau_video.h:274:1: note: previous declaration is here
+vdpau_CreateSurfaceFromV4L2Buf(
+^
+4 warnings and 1 error generated.
+
+--- src/vdpau_video.h.orig	2012-10-05 15:02:58 UTC
++++ src/vdpau_video.h
+@@ -21,6 +21,8 @@
+ #ifndef VDPAU_VIDEO_H
+ #define VDPAU_VIDEO_H
+ 
++#include <linux/videodev2.h>
++
+ #include "vdpau_driver.h"
+ #include "vdpau_decode.h"
+ 

Modified: head/multimedia/libva/Makefile
==============================================================================
--- head/multimedia/libva/Makefile	Thu Jan 17 23:29:30 2019	(r490610)
+++ head/multimedia/libva/Makefile	Thu Jan 17 23:54:42 2019	(r490611)
@@ -2,7 +2,7 @@
 
 PORTNAME=	libva
 PORTVERSION=	2.3.0
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	multimedia
 
 PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
@@ -15,23 +15,18 @@ COMMENT=	VAAPI wrapper and dummy driver
 LICENSE=	MIT
 LICENSE_FILE=	${WRKSRC}/COPYING
 
-BUILD_DEPENDS=	${LOCALBASE}/include/linux/videodev2.h:multimedia/v4l_compat
-RUN_DEPENDS=	${LOCALBASE}/include/linux/videodev2.h:multimedia/v4l_compat
 LIB_DEPENDS=	libdrm.so:graphics/libdrm
 
-USES=		autoreconf gmake libtool localbase pkgconfig tar:bzip2
+USES=		autoreconf gmake libtool pkgconfig tar:bzip2
 USE_LDCONFIG=	yes
 
 GNU_CONFIGURE=	yes
-CONFIGURE_ARGS=	--program-prefix=va
 INSTALL_TARGET=	install-strip
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	intel
 
-LDFLAGS+=	-lpthread
-# prevent types conflict: videodev2.h vs. drm.h
-CFLAGS+=	-DHAVE_LINUX_INTEGER_TYPES
+LDFLAGS+=	-lpthread # for pthread_getthreadid_np
 
 OPTIONS_DEFINE=	DEBUG WAYLAND X11
 OPTIONS_DEFAULT=WAYLAND X11
@@ -51,8 +46,7 @@ post-patch:	.SILENT
 	${REINPLACE_CMD} -e 's|$${libdir}/\(pkgconfig\)|${PREFIX}/libdata/\1|' \
 		-e 's/"$$USE_X11:$$enable_glx" != "yes:no"/"$$USE_X11" != "no"/' \
 		${WRKSRC}/configure.ac
-	${REINPLACE_CMD} '/^export VA_HEADER_/d' \
-		${WRKSRC}/doc/Makefile.am
-	${REINPLACE_CMD} 's/-ldl//' ${WRKSRC}/va/Makefile.am
+# V4L2 is unused since http://github.com/intel/libva/commit/70074679333c
+	${REINPLACE_CMD} '/videodev2\.h/d' ${WRKSRC}/va/va_backend.h
 
 .include <bsd.port.mk>

Modified: head/multimedia/libva/files/patch-va_va__trace.c
==============================================================================
--- head/multimedia/libva/files/patch-va_va__trace.c	Thu Jan 17 23:29:30 2019	(r490610)
+++ head/multimedia/libva/files/patch-va_va__trace.c	Thu Jan 17 23:54:42 2019	(r490611)
@@ -1,68 +1,82 @@
+- Implement gettid() for BSDs
+
 --- va/va_trace.c.orig	2018-02-12 06:32:11 UTC
 +++ va/va_trace.c
-@@ -50,6 +50,9 @@
+@@ -48,12 +48,40 @@
+ #include <unistd.h>
+ #include <sys/types.h>
  #include <sys/stat.h>
- #include <sys/syscall.h>
+-#include <sys/syscall.h>
  #include <pthread.h>
-+#ifdef __FreeBSD__
-+#include <pthread_np.h>
-+#endif
  #include <unistd.h>
  #include <time.h>
  #include <errno.h>
-@@ -290,7 +293,13 @@ static void add_trace_config_info(
+ 
++#if defined(__linux__)
++#include <sys/syscall.h>
++#elif defined(__DragonFly__)
++#include <sys/lwp.h>
++#elif defined(__FreeBSD__)
++#include <pthread_np.h>
++#elif defined(__NetBSD__)
++#include <lwp.h>
++#else // OpenBSD, Solaris
++#include <stdint.h>
++#endif
++
++#if !defined(__BIONIC__)
++static pid_t gettid()
++{
++#if defined(__linux__)
++  return syscall(__NR_gettid);
++#elif defined(__DragonFly__)
++  return lwp_gettid();
++#elif defined(__FreeBSD__)
++  return pthread_getthreadid_np();
++#elif defined(__NetBSD__)
++  return _lwp_self();
++#else // OpenBSD, Solaris
++  return (intptr_t) pthread_self();
++#endif
++}
++#endif
++
+ /*
+  * Env. to debug some issue, e.g. the decode/encode issue in a video conference scenerio:
+  * .LIBVA_TRACE=log_file: general VA parameters saved into log_file
+@@ -290,7 +318,7 @@ static void add_trace_config_info(
  {
      struct trace_config_info *pconfig_info;
      int idx = 0;
-+#ifdef __FreeBSD__
-+    pid_t thd_id = pthread_getthreadid_np();
-+#elif defined __DragonFly__
-+    pid_t thd_id = syscall(SYS_lwp_gettid);
-+#else
-     pid_t thd_id = syscall(__NR_gettid);
-+#endif
+-    pid_t thd_id = syscall(__NR_gettid);
++    pid_t thd_id = gettid();
  
      LOCK_RESOURCE(pva_trace);
  
-@@ -668,7 +677,13 @@ static struct trace_log_file *start_tracing2log_file(
+@@ -668,7 +696,7 @@ static struct trace_log_file *start_tracing2log_file(
  {
      struct trace_log_files_manager *plog_files_mgr = NULL;
      struct trace_log_file *plog_file = NULL;
-+#ifdef __FreeBSD__
-+    pid_t thd_id = pthread_getthreadid_np();
-+#elif defined __DragonFly__
-+    pid_t thd_id = syscall(SYS_lwp_gettid);
-+#else
-     pid_t thd_id = syscall(__NR_gettid);
-+#endif
+-    pid_t thd_id = syscall(__NR_gettid);
++    pid_t thd_id = gettid();
      int i = 0;
  
      LOCK_RESOURCE(pva_trace);
-@@ -707,7 +722,13 @@ static void refresh_log_file(
+@@ -707,7 +735,7 @@ static void refresh_log_file(
      struct trace_context *ptra_ctx)
  {
      struct trace_log_file *plog_file = NULL;
-+#ifdef __FreeBSD__
-+    pid_t thd_id = pthread_getthreadid_np();
-+#elif defined __DragonFly__
-+    pid_t thd_id = syscall(SYS_lwp_gettid);
-+#else
-     pid_t thd_id = syscall(__NR_gettid);
-+#endif
+-    pid_t thd_id = syscall(__NR_gettid);
++    pid_t thd_id = gettid();
      int i = 0;
  
      plog_file = ptra_ctx->plog_file;
-@@ -1230,7 +1251,13 @@ static void internal_TraceUpdateContext (
+@@ -1230,7 +1258,7 @@ static void internal_TraceUpdateContext (
  {
      struct trace_context *trace_ctx = NULL;
      int i = 0, delete = 1;
-+#ifdef __FreeBSD__
-+    pid_t thd_id = pthread_getthreadid_np();
-+#elif defined __DragonFly__
-+    pid_t thd_id = syscall(SYS_lwp_gettid);
-+#else
-     pid_t thd_id = syscall(__NR_gettid);
-+#endif
+-    pid_t thd_id = syscall(__NR_gettid);
++    pid_t thd_id = gettid();
  
      if(tra_ctx_idx >= MAX_TRACE_CTX_NUM)
          return;

Modified: head/multimedia/libva/pkg-descr
==============================================================================
--- head/multimedia/libva/pkg-descr	Thu Jan 17 23:29:30 2019	(r490610)
+++ head/multimedia/libva/pkg-descr	Thu Jan 17 23:54:42 2019	(r490611)
@@ -1,6 +1,6 @@
-The main motivation for VAAPI (Video Acceleration API) is to enable
-hardware accelerated video decode/encode at various entry-points (VLD,
-IDCT, Motion Compensation etc.) for the prevailing coding standards
-today (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, and VC-1/VMW3).
+VA-API is an open-source library and API specification, which provides
+access to graphics hardware acceleration capabilities for video
+processing. It consists of a main library and driver-specific
+acceleration backends for each supported hardware vendor.
 
 WWW: https://github.com/intel/libva



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901172354.x0HNsga6056894>