Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

Commit 89e9488

Browse files
committed
Added wrapper source and autotools.
Signed-off-by: Sean V Kelley <sean.v.kelley@intel.com>
1 parent 4e9b6e9 commit 89e9488

9 files changed

+1830
-0
lines changed

AUTHORS

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Authors of this libva wrapper project:
2+
Tay, Boon Wooi
3+
Kalaiyappan, Periyakaruppan Kumaran
4+
5+
Additional contributors:
6+
Teres Alexis, Alan Previn
7+
Kelley, Sean V
8+
Kibey, Sameer

COPYING

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Permission is hereby granted, free of charge, to any person obtaining a
2+
copy of this software and associated documentation files (the
3+
"Software"), to deal in the Software without restriction, including
4+
without limitation the rights to use, copy, modify, merge, publish,
5+
distribute, sub license, and/or sell copies of the Software, and to
6+
permit persons to whom the Software is furnished to do so, subject to
7+
the following conditions:
8+
9+
The above copyright notice and this permission notice (including the
10+
next paragraph) shall be included in all copies or substantial portions
11+
of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
16+
IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
17+
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
18+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Makefile.am

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
AUTOMAKE_OPTIONS = foreign
2+
3+
# Extra clean files so that maintainer-clean removes *everything*
4+
MAINTAINERCLEANFILES = \
5+
aclocal.m4 compile config.guess config.sub \
6+
configure depcomp install-sh ltmain.sh \
7+
Makefile.in missing

autogen.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#! /bin/sh
2+
3+
autoreconf -v --install
4+
5+
if test -z "$NOCONFIGURE"; then
6+
./configure "$@"
7+
fi

configure.ac

+208
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
# intel-driver package version number
2+
m4_define([libva_wrapper_major_version], [1])
3+
m4_define([libva_wrapper_minor_version], [0])
4+
m4_define([libva_wrapper_micro_version], [20])
5+
m4_define([libva_wrapper_pre_version], [0])
6+
m4_define([libva_wrapper_version],
7+
[libva_wrapper_major_version.libva_wrapper_minor_version.libva_wrapper_micro_version])
8+
m4_if(libva_wrapper_pre_version, [0], [], [
9+
m4_append([libva_wrapper_version], libva_wrapper_pre_version, [.pre])
10+
])
11+
12+
# libva minimum version requirement
13+
m4_define([libva_package_version], [1.2.2])
14+
m4_define([va_api_version], [0.34.0])
15+
16+
# libdrm minimum version requirement
17+
m4_define([libdrm_version], [2.4.45])
18+
19+
AC_PREREQ([2.60])
20+
AC_INIT([liva_wrapper], [libva_wrapper_version], [boon.wooi.tay@intel.com],
21+
[libva_wrapper])
22+
AC_CONFIG_SRCDIR([Makefile.am])
23+
AM_INIT_AUTOMAKE([1.9 tar-ustar])
24+
25+
AC_CONFIG_HEADERS([src/config.h])
26+
27+
LIBVA_WRAPPER_MAJOR_VERSION=libva_wrapper_major_version
28+
LIBVA_WRAPPER_MINOR_VERSION=libva_wrapper_minor_version
29+
LIBVA_WRAPPER_MICRO_VERSION=libva_wrapper_micro_version
30+
AC_DEFINE([LIBVA_WRAPPER_MAJOR_VERSION], [libva_wrapper_major_version], [Major version of the driver])
31+
AC_DEFINE([LIBVA_WRAPPER_MINOR_VERSION], [libva_wrapper_minor_version], [Minor version of the driver])
32+
AC_DEFINE([LIBVA_WRAPPER_MICRO_VERSION], [libva_wrapper_micro_version], [Micro version of the driver])
33+
AC_DEFINE([LIBVA_WRAPPER_PRE_VERSION], [libva_wrapper_pre_version], [Preversion of the driver])
34+
35+
LIBVA_WRAPPER_LT_LDFLAGS="-avoid-version"
36+
AC_SUBST(LIBVA_WRAPPER_LT_LDFLAGS)
37+
38+
dnl Use pretty build output with automake >= 1.11
39+
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [
40+
AM_DEFAULT_VERBOSITY=1
41+
AC_SUBST(AM_DEFAULT_VERBOSITY)
42+
])
43+
44+
AC_ARG_ENABLE(drm,
45+
[AC_HELP_STRING([--enable-drm],
46+
[build with VA/DRM API support @<:@default=yes@:>@])],
47+
[], [enable_drm="yes"])
48+
49+
AC_ARG_ENABLE(x11,
50+
[AC_HELP_STRING([--enable-x11],
51+
[build with VA/X11 API support @<:@default=yes@:>@])],
52+
[], [enable_x11="yes"])
53+
54+
AC_ARG_ENABLE([wayland],
55+
[AC_HELP_STRING([--enable-wayland],
56+
[build with VA/Wayland API support @<:@default=yes@:>@])],
57+
[], [enable_wayland="yes"])
58+
59+
AC_DISABLE_STATIC
60+
AC_PROG_LIBTOOL
61+
AC_PROG_CC
62+
AM_PROG_CC_C_O
63+
64+
AC_C_BIGENDIAN
65+
AC_HEADER_STDC
66+
AC_SYS_LARGEFILE
67+
AC_CHECK_LIB([m], [sin])
68+
69+
LIBVA_PACKAGE_VERSION=libva_package_version
70+
AC_SUBST(LIBVA_PACKAGE_VERSION)
71+
72+
dnl Check for recent enough DRM
73+
LIBDRM_VERSION=libdrm_version
74+
PKG_CHECK_MODULES([DRM], [libdrm >= $LIBDRM_VERSION])
75+
AC_SUBST(LIBDRM_VERSION)
76+
77+
dnl Check for gen4asm
78+
PKG_CHECK_MODULES(GEN4ASM, [intel-gen4asm >= 1.3], [gen4asm=yes], [gen4asm=no])
79+
AM_CONDITIONAL(HAVE_GEN4ASM, test x$gen4asm = xyes)
80+
AC_PATH_PROG([GEN4ASM], [intel-gen4asm])
81+
82+
dnl Check for VA-API
83+
PKG_CHECK_MODULES(LIBVA_DEPS, [libva >= va_api_version])
84+
85+
dnl Check for VA/DRM API
86+
USE_DRM="$enable_drm"
87+
if test "$USE_DRM" = "yes"; then
88+
PKG_CHECK_MODULES(LIBVA_DRM_DEPS, [libva-drm],
89+
[AC_DEFINE([HAVE_VA_DRM], [1], [Defined to 1 if VA/DRM API is enabled])],
90+
[USE_DRM="no"])
91+
92+
# Check for <drm_fourcc.h>
93+
if test "$USE_DRM" = "yes"; then
94+
saved_CPPFLAGS="$CPPFLAGS"
95+
CPPFLAGS="$CPPFLAGS $DRM_CFLAGS"
96+
AC_CHECK_HEADERS([drm_fourcc.h], [:], [USE_DRM="no"])
97+
CPPFLAGS="$saved_CPPFLAGS"
98+
fi
99+
fi
100+
AM_CONDITIONAL(USE_DRM, test "$USE_DRM" = "yes")
101+
102+
VA_VERSION=`$PKG_CONFIG --modversion libva`
103+
VA_MAJOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f1`
104+
VA_MINOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f2`
105+
VA_MICRO_VERSION=`echo "$VA_VERSION" | cut -d'.' -f3`
106+
VA_VERSION_STR="$VA_VERSION"
107+
108+
va_full_version_int=`expr ${VA_MAJOR_VERSION:-0} "*" 1000000 + \
109+
${VA_MINOR_VERSION:-0} "*" 10000 + \
110+
${VA_MICRO_VERSION:-0} "*" 100 + \
111+
0`
112+
VA_DRIVER_INIT_FUNC="__vaDriverInit_${VA_MAJOR_VERSION}_${VA_MINOR_VERSION}"
113+
AC_DEFINE_UNQUOTED([VA_DRIVER_INIT_FUNC], [$VA_DRIVER_INIT_FUNC],
114+
[Define driver entry-point])
115+
116+
dnl Check for VA/DRM API
117+
USE_X11="$enable_x11"
118+
if test "$USE_X11" = "yes"; then
119+
PKG_CHECK_MODULES(LIBVA_X11_DEPS, [libva-x11],
120+
[AC_DEFINE([HAVE_VA_X11], [1], [Defined to 1 if VA/X11 API is enabled])],
121+
[USE_X11="no"])
122+
fi
123+
AM_CONDITIONAL(USE_X11, test "$USE_X11" = "yes")
124+
125+
dnl Check for VA-API drivers path
126+
AC_MSG_CHECKING([for VA drivers path])
127+
LIBVA_DRIVERS_PATH=`$PKG_CONFIG libva --variable driverdir`
128+
if test -z "$LIBVA_DRIVERS_PATH"; then
129+
LIBVA_DRIVERS_PATH="/usr/lib64/va/drivers"
130+
fi
131+
AC_MSG_RESULT([$LIBVA_DRIVERS_PATH])
132+
AC_SUBST(LIBVA_DRIVERS_PATH)
133+
134+
# Check for EGL
135+
if test "$enable_wayland" = "yes"; then
136+
enable_egl="yes"
137+
fi
138+
139+
USE_EGL="no"
140+
if test "$enable_egl" = "yes"; then
141+
PKG_CHECK_MODULES([EGL], [egl], [USE_EGL="yes"], [USE_EGL="no"])
142+
saved_CPPFLAGS="$CPPFLAGS"
143+
saved_LIBS="$LIBS"
144+
CPPFLAGS="$CPPFLAGS $EGL_CFLAGS"
145+
LIBS="$LIBS $EGL_LIBS"
146+
AC_CHECK_HEADERS([EGL/egl.h], [:], [USE_EGL="no"])
147+
AC_CHECK_LIB([EGL], [eglGetDisplay], [:], [USE_EGL="no"])
148+
CPPFLAGS="$saved_CPPFLAGS"
149+
LIBS="$saved_LIBS"
150+
fi
151+
AM_CONDITIONAL(USE_EGL, test "$USE_EGL" = "yes")
152+
153+
# Check for Wayland
154+
USE_WAYLAND="no"
155+
if test "$enable_wayland" = "yes"; then
156+
PKG_CHECK_MODULES([WAYLAND], [wayland-client], [USE_WAYLAND="yes"], [:])
157+
PKG_CHECK_MODULES([LIBVA_WAYLAND_DEPS], [libva-wayland],
158+
[AC_DEFINE([HAVE_VA_WAYLAND], [1], [Defined to 1 if VA/Wayland API is enabled])],
159+
[USE_WAYLAND="no"])
160+
fi
161+
AM_CONDITIONAL(USE_WAYLAND, test "$USE_WAYLAND" = "yes")
162+
163+
m4_ifdef([WAYLAND_SCANNER_RULES],
164+
[WAYLAND_SCANNER_RULES(['$(top_srcdir)/src/wayland'])],
165+
[wayland_scanner_rules=""; AC_SUBST(wayland_scanner_rules)])
166+
167+
dnl Check for JPEG decoding API
168+
AC_CACHE_CHECK([for JPEG decoding API], ac_cv_have_va_jpeg_decode, [
169+
saved_CPPFLAGS="$CPPFLAGS"
170+
CPPFLAGS="$CPPFLAGS $LIBVA_DEPS_CFLAGS"
171+
saved_LIBS="$LIBS"
172+
LIBS="$LIBS $LIBVA_DEPS_LIBS"
173+
AC_COMPILE_IFELSE(
174+
[AC_LANG_PROGRAM(
175+
[[#include <va/va.h>]],
176+
[[VAPictureParameterBufferJPEGBaseline pic_param;
177+
VASliceParameterBufferJPEGBaseline slice_param;
178+
VAHuffmanTableBufferJPEGBaseline huffman_table;
179+
VAIQMatrixBufferJPEGBaseline iq_matrix;]])],
180+
[ac_cv_have_va_jpeg_decode="yes"],
181+
[ac_cv_have_va_jpeg_decode="no"]
182+
)
183+
CPPFLAGS="$saved_CPPFLAGS"
184+
LIBS="$saved_LIBS"
185+
])
186+
if test "$ac_cv_have_va_jpeg_decode" = "yes"; then
187+
AC_DEFINE(HAVE_VA_JPEG_DECODE, 1,
188+
[Defined to 1 if VA-API exposes JPEG decoding])
189+
fi
190+
191+
AC_OUTPUT([
192+
Makefile
193+
src/Makefile
194+
])
195+
196+
dnl Print summary
197+
BACKENDS=""
198+
AS_IF([test "$USE_DRM" = "yes"], [BACKENDS="$BACKENDS drm"])
199+
AS_IF([test "$USE_X11" = "yes"], [BACKENDS="$BACKENDS x11"])
200+
AS_IF([test "$USE_WAYLAND" = "yes"], [BACKENDS="$BACKENDS wayland"])
201+
202+
echo
203+
echo $PACKAGE configuration summary:
204+
echo
205+
echo VA-API version ................... : $VA_VERSION_STR
206+
echo VA-API drivers path .............. : $LIBVA_DRIVERS_PATH
207+
echo Windowing systems ................ : $BACKENDS
208+
echo

src/Makefile.am

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Copyright (c) 2007 Intel Corporation. All Rights Reserved.
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a
4+
# copy of this software and associated documentation files (the
5+
# "Software"), to deal in the Software without restriction, including
6+
# without limitation the rights to use, copy, modify, merge, publish,
7+
# distribute, sub license, and/or sell copies of the Software, and to
8+
# permit persons to whom the Software is furnished to do so, subject to
9+
# the following conditions:
10+
#
11+
# The above copyright notice and this permission notice (including the
12+
# next paragraph) shall be included in all copies or substantial portions
13+
# of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16+
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
18+
# IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
19+
# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20+
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21+
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
23+
AM_CPPFLAGS = \
24+
-DPTHREADS \
25+
$(DRM_CFLAGS) \
26+
$(LIBVA_DEPS_CFLAGS) \
27+
$(NULL)
28+
29+
driver_cflags = \
30+
-Wall \
31+
-fvisibility=hidden \
32+
$(NULL)
33+
34+
driver_ldflags = \
35+
-module -avoid-version \
36+
-no-undefined \
37+
-Wl,--no-undefined \
38+
$(NULL)
39+
40+
driver_libs = \
41+
-lpthread -ldl \
42+
$(DRM_LIBS) -ldrm_intel \
43+
$(LIBVA_DEPS_LIBS) \
44+
$(NULL)
45+
46+
source_c = \
47+
wrapper_drv_video.c \
48+
$(NULL)
49+
50+
source_h = \
51+
wrapper_drv_video.h \
52+
$(NULL)
53+
54+
wrapper_drv_video_la_LTLIBRARIES = wrapper_drv_video.la
55+
wrapper_drv_video_ladir = $(LIBVA_DRIVERS_PATH)
56+
wrapper_drv_video_la_CFLAGS = $(driver_cflags)
57+
wrapper_drv_video_la_LDFLAGS = $(driver_ldflags)
58+
wrapper_drv_video_la_LIBADD = $(driver_libs)
59+
wrapper_drv_video_la_SOURCES = $(source_c)
60+
noinst_HEADERS = $(source_h)
61+
62+
#if USE_X11
63+
#source_c += i965_output_dri.c
64+
#source_h += i965_output_dri.h
65+
#endif
66+
67+
#if USE_WAYLAND
68+
#source_c += i965_output_wayland.c
69+
#source_h += i965_output_wayland.h
70+
#driver_cflags += $(WAYLAND_CFLAGS)
71+
#endif
72+
73+
# Wayland protocol
74+
#i965_output_wayland.c: $(protocol_source_h)
75+
#@wayland_scanner_rules@
76+
77+
#DIST_SUBDIRS = $(SUBDIRS) wayland
78+
79+
# Extra clean files so that maintainer-clean removes *everything*
80+
MAINTAINERCLEANFILES = Makefile.in config.h.in

0 commit comments

Comments
 (0)