st/omx/tizonia: Add --enable-omx-tizonia flag and build files
authorGurkirpal Singh <gurkirpal204@gmail.com>
Sat, 20 Jan 2018 00:07:53 +0000 (05:37 +0530)
committerJulien Isorce <jisorce@oblong.com>
Tue, 6 Mar 2018 14:29:42 +0000 (14:29 +0000)
Allow only bellagio or tizonia to be used at the same time.
Detect tizonia package config file
Generate libomx_mesa.so and install it to libtizcore.pc::pluginsdir
Only compile empty source (target.c) for now.

link: https://summerofcode.withgoogle.com/projects/#4737166321123328
Acked-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Julien Isorce <julien.isorce@gmail.com>
configure.ac
meson.build
meson_options.txt
src/gallium/Makefile.am
src/gallium/state_trackers/omx/Makefile.am
src/gallium/state_trackers/omx/meson.build
src/gallium/state_trackers/omx/tizonia/Makefile.am [new file with mode: 0644]
src/gallium/state_trackers/omx/tizonia/Makefile.sources [new file with mode: 0644]
src/gallium/targets/omx/Makefile.am
src/gallium/targets/omx/omx.sym

index 241b3c0e5829e571e6225cf3d5f0dd8b7fa3fbf3..a45d5c6b5e2b506e10890dbbe04f452a5f52d6c0 100644 (file)
@@ -85,6 +85,7 @@ dnl Versions for external dependencies
 DRI2PROTO_REQUIRED=2.8
 GLPROTO_REQUIRED=1.4.14
 LIBOMXIL_BELLAGIO_REQUIRED=0.0
+LIBOMXIL_TIZONIA_REQUIRED=0.10.0
 LIBVA_REQUIRED=0.38.0
 VDPAU_REQUIRED=1.1
 WAYLAND_REQUIRED=1.11
@@ -1312,14 +1313,19 @@ AC_ARG_ENABLE([vdpau],
    [enable_vdpau=auto])
 AC_ARG_ENABLE([omx],
    [AS_HELP_STRING([--enable-omx],
-         [DEPRECATED: Use --enable-omx-bellagio instead @<:@default=auto@:>@])],
-   [AC_MSG_ERROR([--enable-omx is deprecated. Use --enable-omx-bellagio instead.])],
+         [DEPRECATED: Use --enable-omx-bellagio or --enable-omx-tizonia instead @<:@default=auto@:>@])],
+   [AC_MSG_ERROR([--enable-omx is deprecated. Use --enable-omx-bellagio or --enable-omx-tizonia instead.])],
    [])
 AC_ARG_ENABLE([omx-bellagio],
    [AS_HELP_STRING([--enable-omx-bellagio],
          [enable OpenMAX Bellagio library @<:@default=disabled@:>@])],
    [enable_omx_bellagio="$enableval"],
    [enable_omx_bellagio=no])
+AC_ARG_ENABLE([omx-tizonia],
+   [AS_HELP_STRING([--enable-omx-tizonia],
+         [enable OpenMAX Tizonia library @<:@default=disabled@:>@])],
+   [enable_omx_tizonia="$enableval"],
+   [enable_omx_tizonia=no])
 AC_ARG_ENABLE([va],
    [AS_HELP_STRING([--enable-va],
          [enable va library @<:@default=auto@:>@])],
@@ -1371,11 +1377,17 @@ if test "x$enable_opengl" = xno -a \
         "x$enable_xvmc" = xno -a \
         "x$enable_vdpau" = xno -a \
         "x$enable_omx_bellagio" = xno -a \
+        "x$enable_omx_tizonia" = xno -a \
         "x$enable_va" = xno -a \
         "x$enable_opencl" = xno; then
     AC_MSG_ERROR([at least one API should be enabled])
 fi
 
+if test "x$enable_omx_bellagio" = xyes -a \
+        "x$enable_omx_tizonia" = xyes; then
+   AC_MSG_ERROR([Can't enable both bellagio and tizonia at same time])
+fi
+
 # Building OpenGL ES1 and/or ES2 without OpenGL is not supported on mesa 9.0.x
 if test "x$enable_opengl" = xno -a \
         "x$enable_gles1" = xyes; then
@@ -2210,6 +2222,10 @@ if test -n "$with_gallium_drivers" -a "x$with_gallium_drivers" != xswrast; then
         PKG_CHECK_EXISTS([libomxil-bellagio >= $LIBOMXIL_BELLAGIO_REQUIRED], [enable_omx_bellagio=yes], [enable_omx_bellagio=no])
     fi
 
+    if test "x$enable_omx_tizonia" = xauto -a "x$have_omx_platform" = xyes; then
+       PKG_CHECK_EXISTS([libtizonia >= $LIBOMXIL_TIZONIA_REQUIRED], [enable_omx_tizonia=yes], [enable_omx_tizonia=no])
+    fi
+
     if test "x$enable_va" = xauto -a "x$have_va_platform" = xyes; then
         PKG_CHECK_EXISTS([libva >= $LIBVA_REQUIRED], [enable_va=yes], [enable_va=no])
     fi
@@ -2219,6 +2235,7 @@ if test "x$enable_dri" = xyes -o \
         "x$enable_xvmc" = xyes -o \
         "x$enable_vdpau" = xyes -o \
         "x$enable_omx_bellagio" = xyes -o \
+        "x$enable_omx_tizonia" = xyes -o \
         "x$enable_va" = xyes; then
     need_gallium_vl=yes
 fi
@@ -2227,6 +2244,7 @@ AM_CONDITIONAL(NEED_GALLIUM_VL, test "x$need_gallium_vl" = xyes)
 if test "x$enable_xvmc" = xyes -o \
         "x$enable_vdpau" = xyes -o \
         "x$enable_omx_bellagio" = xyes -o \
+        "x$enable_omx_tizonia" = xyes -o \
         "x$enable_va" = xyes; then
     if echo $platforms | grep -q "x11"; then
         PKG_CHECK_MODULES([VL], [x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED])
@@ -2260,9 +2278,23 @@ if test "x$enable_omx_bellagio" = xyes; then
     fi
     PKG_CHECK_MODULES([OMX_BELLAGIO], [libomxil-bellagio >= $LIBOMXIL_BELLAGIO_REQUIRED])
     gallium_st="$gallium_st omx_bellagio"
+    AC_DEFINE([ENABLE_ST_OMX_BELLAGIO], 1, [Use Bellagio for OMX IL])
 fi
 AM_CONDITIONAL(HAVE_ST_OMX_BELLAGIO, test "x$enable_omx_bellagio" = xyes)
 
+if test "x$enable_omx_tizonia" = xyes; then
+    if test "x$have_omx_platform" != xyes; then
+        AC_MSG_ERROR([OMX requires at least one of the x11 or drm platforms])
+    fi
+    PKG_CHECK_MODULES([OMX_TIZONIA],
+                      [libtizonia >= $LIBOMXIL_TIZONIA_REQUIRED
+                       tizilheaders >= $LIBOMXIL_TIZONIA_REQUIRED
+                       libtizplatform >= $LIBOMXIL_TIZONIA_REQUIRED])
+    gallium_st="$gallium_st omx_tizonia"
+    AC_DEFINE([ENABLE_ST_OMX_TIZONIA], 1, [Use Tizoina for OMX IL])
+fi
+AM_CONDITIONAL(HAVE_ST_OMX_TIZONIA, test "x$enable_omx_tizonia" = xyes)
+
 if test "x$enable_va" = xyes; then
     if test "x$have_va_platform" != xyes; then
         AC_MSG_ERROR([VA requires at least one of the x11 drm or wayland platforms])
@@ -2436,6 +2468,15 @@ AC_ARG_WITH([omx-bellagio-libdir],
                                    $PKG_CONFIG --define-variable=libdir=\$libdir --variable=pluginsdir libomxil-bellagio`])
 AC_SUBST([OMX_BELLAGIO_LIB_INSTALL_DIR])
 
+dnl Directory for OMX_TIZONIA libs
+
+AC_ARG_WITH([omx-tizonia-libdir],
+    [AS_HELP_STRING([--with-omx-tizonia-libdir=DIR],
+        [directory for the OMX_TIZONIA libraries])],
+    [OMX_TIZONIA_LIB_INSTALL_DIR="$withval"],
+    [OMX_TIZONIA_LIB_INSTALL_DIR=`$PKG_CONFIG --define-variable=libdir=\$libdir --variable=pluginsdir libtizcore`])
+AC_SUBST([OMX_TIZONIA_LIB_INSTALL_DIR])
+
 dnl Directory for VA libs
 
 AC_ARG_WITH([va-libdir],
@@ -2977,6 +3018,7 @@ AC_CONFIG_FILES([Makefile
                  src/gallium/state_trackers/nine/Makefile
                  src/gallium/state_trackers/omx/Makefile
                  src/gallium/state_trackers/omx/bellagio/Makefile
+                 src/gallium/state_trackers/omx/tizonia/Makefile
                  src/gallium/state_trackers/osmesa/Makefile
                  src/gallium/state_trackers/va/Makefile
                  src/gallium/state_trackers/vdpau/Makefile
index 9bb114056b10708e0c2cb11433598dc53067afc0..6a13e8000841ed092912a75a5d0514d623ca1c36 100644 (file)
@@ -485,8 +485,15 @@ endif
 with_gallium_omx = _omx != 'disabled'
 gallium_omx = _omx
 dep_omx = []
+dep_omx_other = []
 if gallium_omx == 'bellagio'
   dep_omx = dependency('libomxil-bellagio')
+elif gallium_omx == 'tizonia'
+  dep_omx = dependency('libtizonia', version : '>= 0.10.0')
+  dep_omx_other = [
+    dependency('libtizplatform'),
+    dependency('tizilheaders')
+  ]
 endif
 
 omx_drivers_path = get_option('omx-libs-path')
index f5705c2b3c21144377d75606cd16c1bdc9c2e7bb..50ae19685e72e38fd390ed239c2e1c6c75b2990e 100644 (file)
@@ -90,8 +90,8 @@ option(
 option(
   'gallium-omx',
   type : 'combo',
-  value : 'bellagio',
-  choices : ['disabled', 'bellagio'],
+  value : 'tizonia',
+  choices : ['disabled', 'bellagio', 'tizonia'],
   description : 'enable gallium omx state tracker.',
 )
 option(
index 047fa12bf5480152fc47f74006882dba3375b6aa..2c66064f79f9a3f6e78b1479dc47121df658836a 100644 (file)
@@ -158,6 +158,10 @@ if HAVE_ST_OMX_BELLAGIO
 SUBDIRS += state_trackers/omx targets/omx
 endif
 
+if HAVE_ST_OMX_TIZONIA
+SUBDIRS += state_trackers/omx targets/omx
+endif
+
 if HAVE_GALLIUM_OSMESA
 SUBDIRS += state_trackers/osmesa targets/osmesa
 endif
index ea72787919cb166216a023c986e835a3d472918a..b25ad5d275574e44544cebfb641cc60aef274566 100644 (file)
@@ -23,6 +23,7 @@
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
+if HAVE_ST_OMX_BELLAGIO
 SUBDIRS = bellagio
 
 AM_CFLAGS = \
@@ -31,6 +32,18 @@ AM_CFLAGS = \
        $(VL_CFLAGS) \
        $(XCB_DRI3_CFLAGS) \
        $(OMX_BELLAGIO_CFLAGS)
+else
+SUBDIRS = tizonia
+
+AM_CFLAGS = \
+       $(GALLIUM_CFLAGS) \
+       $(VISIBILITY_CFLAGS) \
+       $(VL_CFLAGS) \
+       $(XCB_DRI3_CFLAGS) \
+       $(OMX_TIZONIA_CFLAGS) \
+       $(OMX_TIZILHEADERS_CFLAGS) \
+       $(OMX_TIZPLATFORM_CFLAGS)
+endif
 
 noinst_LTLIBRARIES = libomxtracker_common.la
 
index d17332553ffa93c10a60a88ec825ca62eefdf3a5..40f7284032aef2336a387ecb5b747b229922b18d 100644 (file)
@@ -27,6 +27,8 @@ files_omx = files(
   'bellagio/vid_dec_h265.c',
   'bellagio/vid_enc.c'
 )
+elif gallium_omx == 'tizonia'
+files_omx = files()
 endif
 
 libomx_st = static_library(
@@ -34,5 +36,5 @@ libomx_st = static_library(
   files_omx,
   c_args : [c_vis_args],
   include_directories : [inc_common],
-  dependencies : [dep_omx, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3],
+  dependencies : [dep_omx, dep_omx_other, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3],
 )
diff --git a/src/gallium/state_trackers/omx/tizonia/Makefile.am b/src/gallium/state_trackers/omx/tizonia/Makefile.am
new file mode 100644 (file)
index 0000000..0f72e39
--- /dev/null
@@ -0,0 +1,36 @@
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+
+include Makefile.sources
+include $(top_srcdir)/src/gallium/Automake.inc
+
+AM_CFLAGS = \
+       -I$(top_srcdir)/src/gallium/state_trackers/omx \
+       $(GALLIUM_CFLAGS) \
+       $(VISIBILITY_CFLAGS) \
+       $(VL_CFLAGS) \
+       $(XCB_DRI3_CFLAGS) \
+       $(OMX_TIZONIA_CFLAGS) \
+       $(OMX_TIZILHEADERS_CFLAGS) \
+       $(OMX_TIZPLATFORM_CFLAGS)
+
+noinst_LTLIBRARIES = libomxtiztracker.la
+
+libomxtiztracker_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/state_trackers/omx/tizonia/Makefile.sources b/src/gallium/state_trackers/omx/tizonia/Makefile.sources
new file mode 100644 (file)
index 0000000..9103ca8
--- /dev/null
@@ -0,0 +1 @@
+C_SOURCES :=
index 89ebcc045cbbce1f25a8d6285e4f63b91619e424..32d61a189b4bb6b60bd0cd4400d038667191045d 100644 (file)
@@ -3,7 +3,12 @@ include $(top_srcdir)/src/gallium/Automake.inc
 AM_CFLAGS = \
        $(GALLIUM_TARGET_CFLAGS)
 
+if HAVE_ST_OMX_BELLAGIO
 omxdir = $(OMX_BELLAGIO_LIB_INSTALL_DIR)
+else
+omxdir = $(OMX_TIZONIA_LIB_INSTALL_DIR)
+endif
+
 omx_LTLIBRARIES = libomx_mesa.la
 
 nodist_EXTRA_libomx_mesa_la_SOURCES = dummy.cpp
@@ -24,15 +29,25 @@ endif # HAVE_LD_VERSION_SCRIPT
 
 libomx_mesa_la_LIBADD = \
        $(top_builddir)/src/gallium/state_trackers/omx/libomxtracker_common.la \
-       $(top_builddir)/src/gallium/state_trackers/omx/bellagio/libomxtracker.la \
        $(top_builddir)/src/gallium/auxiliary/libgalliumvlwinsys.la \
        $(top_builddir)/src/gallium/auxiliary/libgalliumvl.la \
        $(top_builddir)/src/gallium/auxiliary/libgallium.la \
        $(top_builddir)/src/util/libmesautil.la \
-       $(OMX_BELLAGIO_LIBS) \
        $(LIBDRM_LIBS) \
        $(GALLIUM_COMMON_LIB_DEPS)
 
+if HAVE_ST_OMX_BELLAGIO
+libomx_mesa_la_LIBADD += \
+       $(top_builddir)/src/gallium/state_trackers/omx/bellagio/libomxtracker.la \
+       $(OMX_BELLAGIO_LIBS)
+else
+libomx_mesa_la_LIBADD += \
+       $(top_builddir)/src/gallium/state_trackers/omx/tizonia/libomxtiztracker.la \
+       $(OMX_TIZONIA_LIBS) \
+       $(OMX_TIZILHEADERS_LIBS) \
+       $(OMX_TIZPLATFORM_LIBS)
+endif
+
 if HAVE_PLATFORM_X11
 libomx_mesa_la_LIBADD += \
        $(VL_LIBS) \
index e8a287600a5b20f24d57c59c25c41d09887a37ed..07b65e57643fd8a55396c1954637f1657344b91b 100644 (file)
@@ -1,5 +1,6 @@
 {
        global:
+               OMX_ComponentInit;
                omx_component_library_Setup;
 
                # Workaround for an LLVM warning with -simplifycfg-sink-common