meson: Re-add auto option for omx

This re-adds the auto option for omx, without it we default to tizonia
and the build fails almost immediately, this is especially obnoxious
those building a driver that doesn't support the OMX state tracker to
begin with.

v2: - Only define OMX_FOO for auto cases if the dependencies are found.
      This fixes building tizonia with auto (Julien, Eric)

CC: Gurkirpal Singh <gurkirpal204@gmail.com>
Fixes: bb5e27fab6
       ("st/omx/bellagio: Rename st and target directories")
Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk> (v1)
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Tested-by: Julien Isorce <julien.isorce@gmail.com>
Tested-by: Karol Herbst <kherbst@redhat.com> (v1)
This commit is contained in:
Dylan Baker 2018-03-06 10:11:38 -08:00
parent 7598dedfde
commit 34e852d5b5
4 changed files with 57 additions and 36 deletions

View File

@ -464,42 +464,63 @@ endif
_omx = get_option('gallium-omx') _omx = get_option('gallium-omx')
if not system_has_kms_drm if not system_has_kms_drm
if _omx != 'disabled' if ['auto', 'disabled'].contains(_omx)
error('OMX state tracker can only be built on unix-like OSes.')
else
_omx = 'disabled' _omx = 'disabled'
else
error('OMX state tracker can only be built on unix-like OSes.')
endif endif
elif not (with_platform_x11 or with_platform_drm) elif not (with_platform_x11 or with_platform_drm)
if _omx != 'disabled' if ['auto', 'disabled'].contains(_omx)
error('OMX state tracker requires X11 or drm platform support.')
else
_omx = 'disabled' _omx = 'disabled'
else
error('OMX state tracker requires X11 or drm platform support.')
endif endif
elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau) elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
if _omx != 'disabled' if ['auto', 'disabled'].contains(_omx)
error('OMX state tracker requires at least one of the following gallium drivers: r600, radeonsi, nouveau.')
else
_omx = 'disabled' _omx = 'disabled'
else
error('OMX state tracker requires at least one of the following gallium drivers: r600, radeonsi, nouveau.')
endif endif
endif endif
with_gallium_omx = _omx != 'disabled' with_gallium_omx = _omx
gallium_omx = _omx
dep_omx = [] dep_omx = []
dep_omx_other = [] dep_omx_other = []
if gallium_omx == 'bellagio' if with_gallium_omx == 'bellagio' or with_gallium_omx == 'auto'
pre_args += '-DENABLE_ST_OMX_BELLAGIO' dep_omx = dependency(
dep_omx = dependency('libomxil-bellagio') 'libomxil-bellagio', required : with_gallium_omx == 'bellagio'
elif gallium_omx == 'tizonia' )
pre_args += '-DENABLE_ST_OMX_TIZONIA' if dep_omx.found()
dep_omx = dependency('libtizonia', version : '>= 0.10.0') pre_args += '-DENABLE_ST_OMX_BELLAGIO'
dep_omx_other = [ with_gallium_omx = 'bellagio'
dependency('libtizplatform'), endif
dependency('tizilheaders') endif
] if with_gallium_omx == 'tizonia' or with_gallium_omx == 'auto'
if not (with_dri and with_egl)
if with_gallium_omx == 'tizonia'
error('OMX-Tizonia state tracker requires dri and egl')
else
with_gallium_omx == 'disabled'
endif
else
dep_omx = dependency(
'libtizonia', version : '>= 0.10.0',
required : with_gallium_omx == 'tizonia',
)
dep_omx_other = [
dependency('libtizplatform', required : with_gallium_omx == 'tizonia'),
dependency('tizilheaders', required : with_gallium_omx == 'tizonia'),
]
if dep_omx.found() and dep_omx_other[0].found() and dep_omx_other[1].found()
pre_args += '-DENABLE_ST_OMX_TIZONIA'
with_gallium_omx = 'tizonia'
else
with_gallium_omx = 'disabled'
endif
endif
endif endif
omx_drivers_path = get_option('omx-libs-path') omx_drivers_path = get_option('omx-libs-path')
if with_gallium_omx if with_gallium_omx != 'disabled'
# Figure out where to put the omx driver. # Figure out where to put the omx driver.
# FIXME: this could all be vastly simplified by adding a 'defined_variable' # FIXME: this could all be vastly simplified by adding a 'defined_variable'
# argument to meson's get_pkgconfig_variable method. # argument to meson's get_pkgconfig_variable method.
@ -1193,8 +1214,8 @@ if with_platform_x11
dep_xxf86vm = dependency('xxf86vm', required : false) dep_xxf86vm = dependency('xxf86vm', required : false)
endif endif
if (with_any_vk or with_glx == 'dri' or if (with_any_vk or with_glx == 'dri' or
(with_gallium_vdpau or with_gallium_xvmc or with_gallium_omx or (with_gallium_vdpau or with_gallium_xvmc or with_gallium_va or
with_gallium_xa)) with_gallium_omx != 'disabled'))
dep_xcb = dependency('xcb') dep_xcb = dependency('xcb')
dep_x11_xcb = dependency('x11-xcb') dep_x11_xcb = dependency('x11-xcb')
endif endif

View File

@ -90,8 +90,8 @@ option(
option( option(
'gallium-omx', 'gallium-omx',
type : 'combo', type : 'combo',
value : 'tizonia', value : 'auto',
choices : ['disabled', 'bellagio', 'tizonia'], choices : ['auto', 'disabled', 'bellagio', 'tizonia'],
description : 'enable gallium omx state tracker.', description : 'enable gallium omx state tracker.',
) )
option( option(

View File

@ -170,7 +170,7 @@ if with_gallium_xvmc
subdir('state_trackers/xvmc') subdir('state_trackers/xvmc')
subdir('targets/xvmc') subdir('targets/xvmc')
endif endif
if with_gallium_omx if with_gallium_omx != 'disabled'
subdir('state_trackers/omx') subdir('state_trackers/omx')
subdir('targets/omx') subdir('targets/omx')
endif endif

View File

@ -28,7 +28,7 @@ files_omx = files(
'vid_omx_common.c' 'vid_omx_common.c'
) )
if gallium_omx == 'bellagio' if with_gallium_omx == 'bellagio'
files_omx += files( files_omx += files(
'bellagio/entrypoint.c', 'bellagio/entrypoint.c',
'bellagio/vid_dec.c', 'bellagio/vid_dec.c',
@ -37,16 +37,16 @@ files_omx += files(
'bellagio/vid_dec_h265.c', 'bellagio/vid_dec_h265.c',
'bellagio/vid_enc.c' 'bellagio/vid_enc.c'
) )
elif gallium_omx == 'tizonia' elif with_gallium_omx == 'tizonia'
files_omx += files( files_omx += files(
'tizonia/entrypoint.c', 'tizonia/entrypoint.c',
'tizonia/h264d.c', 'tizonia/h264d.c',
'tizonia/h264dprc.c', 'tizonia/h264dprc.c',
'tizonia/h264dinport.c', 'tizonia/h264dinport.c',
'tizonia/h264e.c', 'tizonia/h264e.c',
'tizonia/h264eprc.c', 'tizonia/h264eprc.c',
'tizonia/h264einport.c', 'tizonia/h264einport.c',
'tizonia/h264eoutport.c' 'tizonia/h264eoutport.c'
) )
inc_st_omx = [ inc_st_omx = [
inc_st_omx, inc_st_omx,