[Mesa-dev] [PATCH 1/2] st/omx_tizonia: add --enable-omx-tizonia flag and build files

Christian König deathsimple at vodafone.de
Fri Aug 11 08:26:46 UTC 2017


Am 11.08.2017 um 06:31 schrieb Gurkirpal Singh:
> Coexist with --enable-omx so they can be built independently
> Detect tizonia package config file
> Generate libomxtiz_mesa.so and install it to libtizcore.pc::pluginsdir
> Only compile empty source (target.c) for now.

Really nice piece of work. Just a couple of comments:

1. Please rename the bellagio state tracker to omx-bellagio as a 
prerequisite to this, including the directory and config option. Either 
add a proper error message when --enable-omx is given that users should 
use --enable-omx-bellagio or (even better) add auto detection on what it 
installed.

2. Please split up the second patch even further. E.g. adding 
entrypoint.* for the screen creation and then adding the H254 decoder as 
second patch.

3. How for did you got with EGL? Please concentrate on adding more 
decoders/encoders first, feature parity with omx-bellagio would be nice.

Leo, Boyuan any comments on that?

Regards,
Christian.

>
> GSoC Project link: https://summerofcode.withgoogle.com/projects/#4737166321123328
>
> Signed-off-by: Gurkirpal Singh <gurkirpal204 at gmail.com>
> ---
>   configure.ac                                | 30 +++++++++++
>   src/gallium/Makefile.am                     |  4 ++
>   src/gallium/targets/omx-tizonia/Makefile.am | 77 +++++++++++++++++++++++++++++
>   src/gallium/targets/omx-tizonia/omx.sym     | 11 +++++
>   src/gallium/targets/omx-tizonia/target.c    |  2 +
>   5 files changed, 124 insertions(+)
>   create mode 100644 src/gallium/targets/omx-tizonia/Makefile.am
>   create mode 100644 src/gallium/targets/omx-tizonia/omx.sym
>   create mode 100644 src/gallium/targets/omx-tizonia/target.c
>
> diff --git a/configure.ac b/configure.ac
> index f131788..1bd6635 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -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.8.0
>   LIBVA_REQUIRED=0.38.0
>   VDPAU_REQUIRED=1.1
>   WAYLAND_REQUIRED=1.11
> @@ -1219,6 +1220,11 @@ AC_ARG_ENABLE([omx],
>            [enable OpenMAX library @<:@default=disabled@:>@])],
>      [enable_omx="$enableval"],
>      [enable_omx=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@:>@])],
> @@ -1270,6 +1276,7 @@ if test "x$enable_opengl" = xno -a \
>           "x$enable_xvmc" = xno -a \
>           "x$enable_vdpau" = xno -a \
>           "x$enable_omx" = 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])
> @@ -2116,6 +2123,10 @@ if test -n "$with_gallium_drivers" -a "x$with_gallium_drivers" != xswrast; then
>           PKG_CHECK_EXISTS([libomxil-bellagio >= $LIBOMXIL_BELLAGIO_REQUIRED], [enable_omx=yes], [enable_omx=no])
>       fi
>   
> +    if test "x$enable_omx_tizonia -a "x$have_omx_platform" = xyes" = xauto; 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
> @@ -2167,6 +2178,14 @@ if test "x$enable_omx" = xyes; then
>   fi
>   AM_CONDITIONAL(HAVE_ST_OMX, test "x$enable_omx" = xyes)
>   
> +if test "x$enable_omx_tizonia" = xyes; then
> +    PKG_CHECK_MODULES([OMX_TIZONIA], [libtizonia >= $LIBOMXIL_TIZONIA_REQUIRED])
> +    PKG_CHECK_MODULES([OMX_TIZILHEADERS], [tizilheaders >= $LIBOMXIL_TIZONIA_REQUIRED])
> +    PKG_CHECK_MODULES([OMX_TIZPLATFORM], [libtizplatform >= $LIBOMXIL_TIZONIA_REQUIRED])
> +    gallium_st="$gallium_st omx_tizonia"
> +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])
> @@ -2337,6 +2356,15 @@ AC_ARG_WITH([omx-libdir],
>                             $PKG_CONFIG --define-variable=libdir=\$libdir --variable=pluginsdir libomxil-bellagio`])
>   AC_SUBST([OMX_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],
> @@ -2835,6 +2863,7 @@ AC_CONFIG_FILES([Makefile
>                    src/gallium/state_trackers/glx/xlib/Makefile
>                    src/gallium/state_trackers/nine/Makefile
>                    src/gallium/state_trackers/omx/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
> @@ -2845,6 +2874,7 @@ AC_CONFIG_FILES([Makefile
>                    src/gallium/targets/dri/Makefile
>                    src/gallium/targets/libgl-xlib/Makefile
>                    src/gallium/targets/omx/Makefile
> +                 src/gallium/targets/omx-tizonia/Makefile
>                    src/gallium/targets/opencl/Makefile
>                    src/gallium/targets/opencl/mesa.icd
>                    src/gallium/targets/osmesa/Makefile
> diff --git a/src/gallium/Makefile.am b/src/gallium/Makefile.am
> index 9f98a7e..7376f70 100644
> --- a/src/gallium/Makefile.am
> +++ b/src/gallium/Makefile.am
> @@ -153,6 +153,10 @@ if HAVE_ST_OMX
>   SUBDIRS += state_trackers/omx targets/omx
>   endif
>   
> +if HAVE_ST_OMX_TIZONIA
> +SUBDIRS += state_trackers/omx_tizonia targets/omx-tizonia
> +endif
> +
>   if HAVE_GALLIUM_OSMESA
>   SUBDIRS += state_trackers/osmesa targets/osmesa
>   endif
> diff --git a/src/gallium/targets/omx-tizonia/Makefile.am b/src/gallium/targets/omx-tizonia/Makefile.am
> new file mode 100644
> index 0000000..6baacaa
> --- /dev/null
> +++ b/src/gallium/targets/omx-tizonia/Makefile.am
> @@ -0,0 +1,77 @@
> +include $(top_srcdir)/src/gallium/Automake.inc
> +
> +AM_CFLAGS = \
> +	$(GALLIUM_TARGET_CFLAGS)
> +
> +omxdir = $(OMX_TIZONIA_LIB_INSTALL_DIR)
> +omx_LTLIBRARIES = libomxtiz_mesa.la
> +
> +nodist_EXTRA_libomxtiz_mesa_la_SOURCES = dummy.cpp
> +libomxtiz_mesa_la_SOURCES =
> +
> +libomxtiz_mesa_la_LDFLAGS = \
> +	-shared \
> +	-module \
> +	-no-undefined \
> +	-avoid-version \
> +	$(GC_SECTIONS) \
> +	$(LD_NO_UNDEFINED)
> +
> +if HAVE_LD_VERSION_SCRIPT
> +libomxtiz_mesa_la_LDFLAGS += \
> +	-Wl,--version-script=$(top_srcdir)/src/gallium/targets/omx-tizonia/omx.sym
> +endif # HAVE_LD_VERSION_SCRIPT
> +
> +libomxtiz_mesa_la_LIBADD = \
> +	$(top_builddir)/src/gallium/state_trackers/omx_tizonia/libomxtiztracker.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_TIZONIA_LIBS) \
> +	$(OMX_TIZILHEADERS_LIBS) \
> +	$(OMX_TIZPLATFORM_LIBS) \
> +	$(LIBDRM_LIBS) \
> +	$(GALLIUM_COMMON_LIB_DEPS)
> +
> +if HAVE_PLATFORM_X11
> +libomxtiz_mesa_la_LIBADD += \
> +	$(VL_LIBS) \
> +	$(XCB_DRI3_LIBS)
> +endif
> +
> +EXTRA_libomxtiz_mesa_la_DEPENDENCIES = omx.sym
> +EXTRA_DIST = omx.sym
> +
> +if HAVE_GALLIUM_STATIC_TARGETS
> +
> +TARGET_DRIVERS =
> +TARGET_CPPFLAGS =
> +TARGET_LIB_DEPS =
> +
> +
> +include $(top_srcdir)/src/gallium/drivers/nouveau/Automake.inc
> +
> +include $(top_srcdir)/src/gallium/drivers/r600/Automake.inc
> +include $(top_srcdir)/src/gallium/drivers/radeonsi/Automake.inc
> +
> +libomxtiz_mesa_la_SOURCES += target.c
> +libomxtiz_mesa_la_CPPFLAGS = $(TARGET_CPPFLAGS)
> +libomxtiz_mesa_la_LIBADD += \
> +	$(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader_static.la \
> +	$(GALLIUM_PIPE_LOADER_WINSYS_LIBS) \
> +	$(TARGET_LIB_DEPS) \
> +	$(TARGET_COMPILER_LIB_DEPS) \
> +	$(TARGET_RADEON_WINSYS) $(TARGET_RADEON_COMMON)
> +
> +else # HAVE_GALLIUM_STATIC_TARGETS
> +
> +libomxtiz_mesa_la_LIBADD += \
> +	$(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader_dynamic.la
> +
> +endif # HAVE_GALLIUM_STATIC_TARGETS
> +
> +if HAVE_GALLIUM_LLVM
> +libomxtiz_mesa_la_LIBADD += $(LLVM_LIBS)
> +libomxtiz_mesa_la_LDFLAGS += $(LLVM_LDFLAGS)
> +endif
> diff --git a/src/gallium/targets/omx-tizonia/omx.sym b/src/gallium/targets/omx-tizonia/omx.sym
> new file mode 100644
> index 0000000..2aafb29
> --- /dev/null
> +++ b/src/gallium/targets/omx-tizonia/omx.sym
> @@ -0,0 +1,11 @@
> +{
> +	global:
> +		OMX_ComponentInit;
> +
> +		# Workaround for an LLVM warning with -simplifycfg-sink-common
> +		# due to LLVM being initialized multiple times.
> +		radeon_drm_winsys_create;
> +		amdgpu_winsys_create;
> +	local:
> +		*;
> +};
> diff --git a/src/gallium/targets/omx-tizonia/target.c b/src/gallium/targets/omx-tizonia/target.c
> new file mode 100644
> index 0000000..308e23b
> --- /dev/null
> +++ b/src/gallium/targets/omx-tizonia/target.c
> @@ -0,0 +1,2 @@
> +#include "target-helpers/drm_helper.h"
> +#include "target-helpers/sw_helper.h"




More information about the mesa-dev mailing list