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
This commit is contained in:
parent
7723e7d2bf
commit
09384ce004
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=490611
@ -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_video.so:multimedia/libva-in
|
||||
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/' \
|
||||
|
36
multimedia/libva-vdpau-driver/files/patch-src_vdpau__video.h
Normal file
36
multimedia/libva-vdpau-driver/files/patch-src_vdpau__video.h
Normal file
@ -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"
|
||||
|
@ -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>
|
||||
|
@ -1,11 +0,0 @@
|
||||
--- va/glx/va_glx_private.h.orig 2017-10-21 04:49:28 UTC
|
||||
+++ va/glx/va_glx_private.h
|
||||
@@ -38,7 +38,7 @@ typedef void (*PFNGLXBINDTEXIMAGEEXTPROC)(Display *, G
|
||||
typedef void (*PFNGLXRELEASETEXIMAGEEXTPROC)(Display *, GLXDrawable, int);
|
||||
#endif
|
||||
|
||||
-#if GLX_GLXEXT_VERSION < 27
|
||||
+#if GLX_GLXEXT_VERSION < 21
|
||||
/* XXX: this is not exactly that version but this is the only means to
|
||||
make sure we have the correct <GL/glx.h> with those signatures */
|
||||
typedef GLXPixmap (*PFNGLXCREATEPIXMAPPROC)(Display *, GLXFBConfig, Pixmap, const int *);
|
@ -1,11 +0,0 @@
|
||||
--- va/va.c.orig 2017-10-21 04:49:28 UTC
|
||||
+++ va/va.c
|
||||
@@ -350,7 +350,7 @@ static VAStatus va_openDriver(VADisplay dpy, char *dri
|
||||
strncat( driver_path, DRIVER_EXTENSION, strlen(DRIVER_EXTENSION) );
|
||||
|
||||
va_infoMessage(dpy, "Trying to open %s\n", driver_path);
|
||||
-#ifndef ANDROID
|
||||
+#if !defined(ANDROID) && defined(RTLD_NODELETE)
|
||||
handle = dlopen( driver_path, RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE );
|
||||
#else
|
||||
handle = dlopen( driver_path, RTLD_NOW| RTLD_GLOBAL);
|
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user