Sun Mar 12 09:44:25 2017 UTC ()
Import intel-vaapi-driver-1.7.3 as multimedia/intel-vaapi-driver

VA-API (Video Acceleration API) user mode driver for Intel GEN
Graphics family.

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.

The current video driver backend provides a bridge to the GEN GPUs
through the packaging of buffers and commands to be sent to the
i915 driver for exercising both hardware and shader functionality
for video decode, encode, and processing.


(leot)
diff -r0 -r1.1 pkgsrc/multimedia/intel-vaapi-driver/DESCR
diff -r0 -r1.1 pkgsrc/multimedia/intel-vaapi-driver/Makefile
diff -r0 -r1.1 pkgsrc/multimedia/intel-vaapi-driver/PLIST
diff -r0 -r1.1 pkgsrc/multimedia/intel-vaapi-driver/distinfo
diff -r0 -r1.1 pkgsrc/multimedia/intel-vaapi-driver/patches/patch-src_i965__decoder__utils.c

File Added: pkgsrc/multimedia/intel-vaapi-driver/DESCR
VA-API (Video Acceleration API) user mode driver for Intel GEN
Graphics family.

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.

The current video driver backend provides a bridge to the GEN GPUs
through the packaging of buffers and commands to be sent to the
i915 driver for exercising both hardware and shader functionality
for video decode, encode, and processing.

File Added: pkgsrc/multimedia/intel-vaapi-driver/Makefile
# $NetBSD: Makefile,v 1.1 2017/03/12 09:44:25 leot Exp $

DISTNAME=	intel-vaapi-driver-1.7.3
CATEGORIES=	multimedia
MASTER_SITES=	${MASTER_SITE_GITHUB:=01org/}

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	https://github.com/01org/intel-vaapi-driver/
COMMENT=	VA-API user mode driver for Intel GEN Graphics family
LICENSE=	mit

.include "../../multimedia/libva/available.mk"

.if ${VAAPI_AVAILABLE} == "no"
NOT_FOR_PLATFORM+=	${MACHINE_PLATFORM}
.endif

GNU_CONFIGURE=	yes
USE_LIBTOOL=	yes
USE_TOOLS+=	autoconf automake gmake pkg-config

CONFIGURE_ARGS+=	--disable-wayland

# XXX: Force installation in PREFIX.
# XXX: LIBVA_DRIVERS_PATH - if undefined - is obtained via
# XXX: `pkg-config libva --variable driverdir'. This is not desiderable
# XXX: for native X.org so handle installation similarly to graphics/MesaLib
# XXX: in order to be X11_TYPE agnostic.
CONFIGURE_ENV+=		LIBVA_DRIVERS_PATH=${PREFIX}/lib/dri/

.include "../../mk/bsd.prefs.mk"

.if ${OPSYS} != "Linux"
BUILDLINK_TRANSFORM+=	rm:-ldl
.endif

pre-configure:
	${RUN} cd ${WRKSRC} && ${SH} ./autogen.sh

.include "../../mk/dlopen.buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
.include "../../multimedia/libva/buildlink3.mk"
.include "../../x11/libdrm/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

File Added: pkgsrc/multimedia/intel-vaapi-driver/PLIST
@comment $NetBSD: PLIST,v 1.1 2017/03/12 09:44:25 leot Exp $
lib/dri/i965_drv_video.la

File Added: pkgsrc/multimedia/intel-vaapi-driver/distinfo
$NetBSD: distinfo,v 1.1 2017/03/12 09:44:25 leot Exp $

SHA1 (intel-vaapi-driver-1.7.3.tar.gz) = f2f412edc9d03567897b187d96343db68598fa37
RMD160 (intel-vaapi-driver-1.7.3.tar.gz) = 2ba7c3d945733bf56f234fc5451422173a612f1d
SHA512 (intel-vaapi-driver-1.7.3.tar.gz) = 57ae4fbf1bd5799e8a311fcd67eda1a8a6d5b5267df502b83f63f8bd0cdd510a4f78b4d09088833bfa2e98447d841c3d4e7229f4e75a9d9f4b8096fb14027878
Size (intel-vaapi-driver-1.7.3.tar.gz) = 1648659 bytes
SHA1 (patch-src_i965__decoder__utils.c) = 1719cac7ee434c92e1a7016ad4130615dd62ddaa

File Added: pkgsrc/multimedia/intel-vaapi-driver/patches/Attic/patch-src_i965__decoder__utils.c
$NetBSD: patch-src_i965__decoder__utils.c,v 1.1 2017/03/12 09:44:25 leot Exp $

Use malloc(3) and free(3) instead of alloca(3).

From upstream via issue pull request #77 (it will not needed
for the next 1.8.0 version).

--- src/i965_decoder_utils.c.orig	2016-11-10 05:04:36.000000000 +0000
+++ src/i965_decoder_utils.c
@@ -23,7 +23,6 @@
 
 #include "sysdeps.h"
 #include <limits.h>
-#include <alloca.h>
 
 #include "intel_batchbuffer.h"
 #include "intel_media.h"
@@ -343,7 +342,7 @@ avc_get_first_mb_bit_offset_with_epb(
     if (buf_size > data_size)
         buf_size = data_size;
 
-    buf = alloca(buf_size);
+    buf = malloc(buf_size);
     ret = dri_bo_get_subdata(
         slice_data_bo, slice_param->slice_data_offset,
         buf_size, buf
@@ -355,6 +354,8 @@ avc_get_first_mb_bit_offset_with_epb(
             i += 2, j++, n++;
     }
 
+    free(buf);
+
     out_slice_data_bit_offset = in_slice_data_bit_offset + n * 8;
 
     if (mode_flag == ENTROPY_CABAC)