Re: [Mesa-dev] [PATCH 2/6] st/omx/tizonia: Add --enable-omx-tizonia flag and build files
Since patch 1 was rejected this time around for being too large I've also sent the series directly to Leo and Julien. On Sat, Jan 20, 2018 at 8:01 AM, Gurkirpal Singh <gurkirpal...@gmail.com> wrote: > I've added the right patches as a reply. > > Sry again for the inconvenience > > On Sat, Jan 20, 2018 at 3:38 AM, Gurkirpal Singh <gurkirpal...@gmail.com> > wrote: > >> >> >> On Fri, Jan 19, 2018 at 8:30 PM, Leo Liu <leo@amd.com> wrote: >> >>> >>> >>> On 01/19/2018 04:46 AM, Julien Isorce wrote: >>> >>> Hi Leo, >>> >>> Do you have enough data to start the merge ? >>> >>> Hi Julien, >>> >>> What I can help is to have the patches pushed to upstream, and which I >>> think anyone with write-permission account also can do. >>> >>> I would like to help to push patches that are cleanly applied, and build >>> successfully, and we can take of how functional later. >>> >>> @Dylan, you said: >>> >The patches in this thread don't apply, there is some other work on you >>> tree not >>> >included maybe? Or I'd see about adding it (I don't think it would be >>> too hard). >>> >Do you have this series in a public git repo I could pull from? >>> >>> I have the patch from this thread applied cleanly without any problem, >>> re-attached as your reference. >>> >>> $ git am *.patch >>> Applying: st/omx/bellagio: Rename st and target directories >>> Applying: st/omx/tizonia: Add --enable-omx-tizonia flag and build files >>> Applying: st/omx/tizonia: Add entrypoint >>> Applying: st/omx/tizonia: Add H.264 decoder >>> Applying: st/omx/tizonia: Add H.264 encoder >>> Applying: st/omx/tizonia/h264d: Add EGLImage support >>> >>> >>> >>> >For Tizonia, what I'd like to do is change the -Dgallium-omx argument >>> to accept >>> >['auto', 'bellagio', 'tizonia', 'disabled'] (this mirrors the glx >>> option), with >>> >auto trying to find bellagio and tizonia in some order and falling back >>> to >>> >disabled if neither is found. >>> >>> Can you help to add this into current patch set ? Thanks. >>> >>> >>> @Gukirpal, the patches (also re-attached) failed to build >>> >> >> Ah my bad. I just realised these were slightly older version of same >> patches that got mixed up. I'll send in the latest ones ASAP. >> >>> >>> >>> Making all in state_trackers/omx >>> make[4]: Entering directory 'mesa/src/gallium/state_trackers/omx' >>> Making all in bellagio >>> make[5]: Entering directory 'mesa/src/gallium/state_tracke >>> rs/omx/bellagio' >>> CC entrypoint.lo >>> CC vid_dec_mpeg12.lo >>> CC vid_dec.lo >>> CC vid_dec_h265.lo >>> CC vid_enc.lo >>> CC vid_dec_h264.lo >>> vid_enc.c: In function ‘vid_enc_Constructor’: >>> vid_enc.c:150:19: error: implicit declaration of function >>> ‘omx_get_screen’; did you mean ‘os_get_option’? >>> [-Werror=implicit-function-declaration] >>> priv->screen = omx_get_screen("OMX_RENDER_NODE"); >>>^~ >>>os_get_option >>> vid_enc.c:150:17: warning: assignment makes pointer from integer without >>> a cast [-Wint-conversion] >>> priv->screen = omx_get_screen("OMX_RENDER_NODE"); >>> ^ >>> vid_enc.c: In function ‘vid_enc_Destructor’: >>> vid_enc.c:276:7: error: implicit declaration of function >>> ‘omx_put_screen’ [-Werror=implicit-function-declaration] >>>omx_put_screen(); >>>^~ >>> cc1: some warnings being treated as errors >>> Makefile:682: recipe for target 'vid_enc.lo' failed >>> make[5]: *** [vid_enc.lo] Error 1 >>> >>> >>> Leo >>> >>> >>> >>> >>> Thx >>> Julien >>> >>> On 18 January 2018 at 02:28, Gurkirpal Singh <gurkirpal...@gmail.com> >>> wrote: >>> >>>> >>>> >>>> On Wed, Jan 17, 2018 at 10:39 PM, Dylan Baker <dy...@pnwbakers.com> >>>> wrote: >>>> >>>>> The meson build for omx-bellagio has landed along with the other media >>>>> state >>>>> trackers that are in tree. Currently there is
Re: [Mesa-dev] [PATCH 2/6] st/omx/tizonia: Add --enable-omx-tizonia flag and build files
I've added the right patches as a reply. Sry again for the inconvenience On Sat, Jan 20, 2018 at 3:38 AM, Gurkirpal Singh <gurkirpal...@gmail.com> wrote: > > > On Fri, Jan 19, 2018 at 8:30 PM, Leo Liu <leo@amd.com> wrote: > >> >> >> On 01/19/2018 04:46 AM, Julien Isorce wrote: >> >> Hi Leo, >> >> Do you have enough data to start the merge ? >> >> Hi Julien, >> >> What I can help is to have the patches pushed to upstream, and which I >> think anyone with write-permission account also can do. >> >> I would like to help to push patches that are cleanly applied, and build >> successfully, and we can take of how functional later. >> >> @Dylan, you said: >> >The patches in this thread don't apply, there is some other work on you >> tree not >> >included maybe? Or I'd see about adding it (I don't think it would be >> too hard). >> >Do you have this series in a public git repo I could pull from? >> >> I have the patch from this thread applied cleanly without any problem, >> re-attached as your reference. >> >> $ git am *.patch >> Applying: st/omx/bellagio: Rename st and target directories >> Applying: st/omx/tizonia: Add --enable-omx-tizonia flag and build files >> Applying: st/omx/tizonia: Add entrypoint >> Applying: st/omx/tizonia: Add H.264 decoder >> Applying: st/omx/tizonia: Add H.264 encoder >> Applying: st/omx/tizonia/h264d: Add EGLImage support >> >> >> >> >For Tizonia, what I'd like to do is change the -Dgallium-omx argument to >> accept >> >['auto', 'bellagio', 'tizonia', 'disabled'] (this mirrors the glx >> option), with >> >auto trying to find bellagio and tizonia in some order and falling back >> to >> >disabled if neither is found. >> >> Can you help to add this into current patch set ? Thanks. >> >> >> @Gukirpal, the patches (also re-attached) failed to build >> > > Ah my bad. I just realised these were slightly older version of same > patches that got mixed up. I'll send in the latest ones ASAP. > >> >> >> Making all in state_trackers/omx >> make[4]: Entering directory 'mesa/src/gallium/state_trackers/omx' >> Making all in bellagio >> make[5]: Entering directory 'mesa/src/gallium/state_tracke >> rs/omx/bellagio' >> CC entrypoint.lo >> CC vid_dec_mpeg12.lo >> CC vid_dec.lo >> CC vid_dec_h265.lo >> CC vid_enc.lo >> CC vid_dec_h264.lo >> vid_enc.c: In function ‘vid_enc_Constructor’: >> vid_enc.c:150:19: error: implicit declaration of function >> ‘omx_get_screen’; did you mean ‘os_get_option’? >> [-Werror=implicit-function-declaration] >> priv->screen = omx_get_screen("OMX_RENDER_NODE"); >>^~ >>os_get_option >> vid_enc.c:150:17: warning: assignment makes pointer from integer without >> a cast [-Wint-conversion] >> priv->screen = omx_get_screen("OMX_RENDER_NODE"); >> ^ >> vid_enc.c: In function ‘vid_enc_Destructor’: >> vid_enc.c:276:7: error: implicit declaration of function ‘omx_put_screen’ >> [-Werror=implicit-function-declaration] >>omx_put_screen(); >>^~ >> cc1: some warnings being treated as errors >> Makefile:682: recipe for target 'vid_enc.lo' failed >> make[5]: *** [vid_enc.lo] Error 1 >> >> >> Leo >> >> >> >> >> Thx >> Julien >> >> On 18 January 2018 at 02:28, Gurkirpal Singh <gurkirpal...@gmail.com> >> wrote: >> >>> >>> >>> On Wed, Jan 17, 2018 at 10:39 PM, Dylan Baker <dy...@pnwbakers.com> >>> wrote: >>> >>>> The meson build for omx-bellagio has landed along with the other media >>>> state >>>> trackers that are in tree. Currently there is a known bug with at least >>>> vdpau >>>> and va-api (I suspect that the omx, va, and xvmc are affected as well) >>>> which >>>> causes required symbols to not be exported, I'm still trying to resolve >>>> that. >>>> >>>> For Tizonia, what I'd like to do is change the -Dgallium-omx argument >>>> to accept >>>> ['auto', 'bellagio', 'tizonia', 'disabled'] (this mirrors the glx >>>> option), with >>>> auto trying to find bellagio and tizonia in some order and falling back >>>> to >>>> disabled if neither is found. >>
[Mesa-dev] [PATCH 6/6] st/omx/tizonia/h264d: Add EGLImage support
Example Gstreamer pipeline : MESA_ENABLE_OMX_EGLIMAGE=1 GST_GL_API=gles2 GST_GL_PLATFORM=egl gst-launch-1.0 filesrc location=movie.mp4 ! qtdemux ! h264parse ! omxh264dec ! glimagesink Acked-by: Leo LiuReviewed-by: Julien Isorce --- src/gallium/state_trackers/omx/Makefile.am | 1 + src/gallium/state_trackers/omx/tizonia/Makefile.am | 13 +++ .../state_trackers/omx/tizonia/entrypoint.c| 44 src/gallium/state_trackers/omx/tizonia/h264dprc.c | 116 - src/gallium/state_trackers/omx/vid_dec_common.c| 38 +++ src/gallium/state_trackers/omx/vid_dec_common.h| 3 + 6 files changed, 211 insertions(+), 4 deletions(-) diff --git a/src/gallium/state_trackers/omx/Makefile.am b/src/gallium/state_trackers/omx/Makefile.am index de6eb64..fbde8e0 100644 --- a/src/gallium/state_trackers/omx/Makefile.am +++ b/src/gallium/state_trackers/omx/Makefile.am @@ -37,6 +37,7 @@ SUBDIRS = tizonia AM_CFLAGS = \ $(GALLIUM_CFLAGS) \ + $(LIBDRM_CFLAGS) \ $(VISIBILITY_CFLAGS) \ $(VL_CFLAGS) \ $(XCB_DRI3_CFLAGS) \ diff --git a/src/gallium/state_trackers/omx/tizonia/Makefile.am b/src/gallium/state_trackers/omx/tizonia/Makefile.am index 0f72e39..3149afa 100644 --- a/src/gallium/state_trackers/omx/tizonia/Makefile.am +++ b/src/gallium/state_trackers/omx/tizonia/Makefile.am @@ -22,8 +22,21 @@ include Makefile.sources include $(top_srcdir)/src/gallium/Automake.inc AM_CFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/src/mapi \ + -I$(top_srcdir)/src/mesa \ + -I$(top_builddir)/src/mesa/drivers/dri/common \ + -I$(top_srcdir)/src/mesa/drivers/dri/common \ + -I$(top_srcdir)/src/egl/drivers/dri2 \ + -I$(top_srcdir)/src/egl/wayland/wayland-egl \ + -I$(top_srcdir)/src/egl/main \ + -I$(top_srcdir)/src/gbm/main \ + -I$(top_srcdir)/src/loader \ + -I$(top_srcdir)/src/gbm/backends/dri \ + -I$(top_srcdir)/src/gallium/state_trackers/dri \ -I$(top_srcdir)/src/gallium/state_trackers/omx \ $(GALLIUM_CFLAGS) \ + $(LIBDRM_CFLAGS) \ $(VISIBILITY_CFLAGS) \ $(VL_CFLAGS) \ $(XCB_DRI3_CFLAGS) \ diff --git a/src/gallium/state_trackers/omx/tizonia/entrypoint.c b/src/gallium/state_trackers/omx/tizonia/entrypoint.c index 72d955b..b896447 100644 --- a/src/gallium/state_trackers/omx/tizonia/entrypoint.c +++ b/src/gallium/state_trackers/omx/tizonia/entrypoint.c @@ -44,6 +44,40 @@ #include "h264eoutport.h" #include "names.h" +#include "util/u_debug.h" + +DEBUG_GET_ONCE_BOOL_OPTION(mesa_enable_omx_eglimage, + "MESA_ENABLE_OMX_EGLIMAGE", + false) + +static OMX_BOOL egl_image_validation_hook(const OMX_HANDLETYPE ap_hdl, + OMX_U32 pid, OMX_PTR ap_eglimage, + void *ap_args) +{ + const void * p_krn = NULL; + const tiz_port_t * p_port = NULL; + + assert(ap_hdl); + assert(ap_eglimage); + assert(!ap_args); + + if (!debug_get_option_mesa_enable_omx_eglimage()) { + return OMX_FALSE; + } + + p_krn = tiz_get_krn(ap_hdl); + p_port = tiz_krn_get_port(p_krn, pid); + + const OMX_VIDEO_PORTDEFINITIONTYPE * p_video_portdef + = &(p_port->portdef_.format.video); + + if (!p_video_portdef->pNativeWindow) { + return OMX_FALSE; + } + + return OMX_TRUE; +} + OMX_ERRORTYPE OMX_ComponentInit (OMX_HANDLETYPE ap_hdl) { tiz_role_factory_t h264d_role; @@ -57,6 +91,11 @@ OMX_ERRORTYPE OMX_ComponentInit (OMX_HANDLETYPE ap_hdl) const tiz_type_factory_t * tf_list[] = {_inport_type, _outport_type, _type, _type, _inport_type}; + const tiz_eglimage_hook_t egl_validation_hook = { + OMX_VID_DEC_AVC_OUTPUT_PORT_INDEX, + egl_image_validation_hook, + NULL + }; /* Settings for roles */ strcpy ((OMX_STRING) h264d_role.role, OMX_VID_DEC_AVC_ROLE); @@ -108,5 +147,10 @@ OMX_ERRORTYPE OMX_ComponentInit (OMX_HANDLETYPE ap_hdl) /* Register the component roles */ tiz_comp_register_roles (ap_hdl, rf_list, 2); + /* Register egl image validation hook for the decoder */ + tiz_check_omx (tiz_comp_register_role_eglimage_hook + (ap_hdl, (const OMX_U8 *) OMX_VID_DEC_AVC_ROLE, + _validation_hook)); + return OMX_ErrorNone; } diff --git a/src/gallium/state_trackers/omx/tizonia/h264dprc.c b/src/gallium/state_trackers/omx/tizonia/h264dprc.c index f5c5d659..96f95b9 100644 --- a/src/gallium/state_trackers/omx/tizonia/h264dprc.c +++ b/src/gallium/state_trackers/omx/tizonia/h264dprc.c @@ -38,10 +38,33 @@ #include "vl/vl_video_buffer.h" #include "vl/vl_compositor.h" +#include "util/u_hash_table.h" #include "util/u_surface.h" +#include "dri_screen.h" +#include "egl_dri2.h" + unsigned dec_frame_delta;
[Mesa-dev] [PATCH 5/6] st/omx/tizonia: Add H.264 encoder
v2: Refactor out screen functions to st/omx Example Gstreamer pipeline : gst-launch-1.0 filesrc location=movie.mp4 ! qtdemux ! h264parse ! avdec_h264 ! videoconvert ! omxh264enc ! h264parse ! avdec_h264 ! videoconvert ! ximagesink Acked-by: Leo LiuReviewed-by: Julien Isorce --- src/gallium/state_trackers/omx/Makefile.sources| 4 +- src/gallium/state_trackers/omx/bellagio/vid_enc.c | 355 +-- src/gallium/state_trackers/omx/bellagio/vid_enc.h | 48 -- .../state_trackers/omx/tizonia/Makefile.sources| 11 + .../state_trackers/omx/tizonia/entrypoint.c| 40 +- src/gallium/state_trackers/omx/tizonia/h264e.c | 184 ++ src/gallium/state_trackers/omx/tizonia/h264e.h | 55 ++ .../state_trackers/omx/tizonia/h264einport.c | 216 +++ .../state_trackers/omx/tizonia/h264einport.h | 31 + .../state_trackers/omx/tizonia/h264einport_decls.h | 48 ++ .../state_trackers/omx/tizonia/h264eoutport.c | 143 + .../state_trackers/omx/tizonia/h264eoutport.h | 31 + .../omx/tizonia/h264eoutport_decls.h | 48 ++ src/gallium/state_trackers/omx/tizonia/h264eprc.c | 689 + src/gallium/state_trackers/omx/tizonia/h264eprc.h | 31 + src/gallium/state_trackers/omx/vid_enc_common.c| 387 src/gallium/state_trackers/omx/vid_enc_common.h| 175 ++ 17 files changed, 2094 insertions(+), 402 deletions(-) create mode 100644 src/gallium/state_trackers/omx/tizonia/h264e.c create mode 100644 src/gallium/state_trackers/omx/tizonia/h264e.h create mode 100644 src/gallium/state_trackers/omx/tizonia/h264einport.c create mode 100644 src/gallium/state_trackers/omx/tizonia/h264einport.h create mode 100644 src/gallium/state_trackers/omx/tizonia/h264einport_decls.h create mode 100644 src/gallium/state_trackers/omx/tizonia/h264eoutport.c create mode 100644 src/gallium/state_trackers/omx/tizonia/h264eoutport.h create mode 100644 src/gallium/state_trackers/omx/tizonia/h264eoutport_decls.h create mode 100644 src/gallium/state_trackers/omx/tizonia/h264eprc.c create mode 100644 src/gallium/state_trackers/omx/tizonia/h264eprc.h create mode 100644 src/gallium/state_trackers/omx/vid_enc_common.c create mode 100644 src/gallium/state_trackers/omx/vid_enc_common.h diff --git a/src/gallium/state_trackers/omx/Makefile.sources b/src/gallium/state_trackers/omx/Makefile.sources index ba9b0be..0fb1d9a 100644 --- a/src/gallium/state_trackers/omx/Makefile.sources +++ b/src/gallium/state_trackers/omx/Makefile.sources @@ -4,4 +4,6 @@ C_SOURCES := \ vid_dec_h264_common.c \ vid_dec_h264_common.h \ vid_omx_common.c \ - vid_omx_common.h + vid_omx_common.h \ + vid_enc_common.c \ + vid_enc_common.h diff --git a/src/gallium/state_trackers/omx/bellagio/vid_enc.c b/src/gallium/state_trackers/omx/bellagio/vid_enc.c index 169c36a..b1b8622 100644 --- a/src/gallium/state_trackers/omx/bellagio/vid_enc.c +++ b/src/gallium/state_trackers/omx/bellagio/vid_enc.c @@ -49,32 +49,11 @@ #include "pipe/p_screen.h" #include "pipe/p_video_codec.h" #include "util/u_memory.h" -#include "vl/vl_video_buffer.h" #include "entrypoint.h" #include "vid_enc.h" #include "vid_omx_common.h" - -struct encode_task { - struct list_head list; - - struct pipe_video_buffer *buf; - unsigned pic_order_cnt; - struct pipe_resource *bitstream; - void *feedback; -}; - -struct input_buf_private { - struct list_head tasks; - - struct pipe_resource *resource; - struct pipe_transfer *transfer; -}; - -struct output_buf_private { - struct pipe_resource *bitstream; - struct pipe_transfer *transfer; -}; +#include "vid_enc_common.h" static OMX_ERRORTYPE vid_enc_Constructor(OMX_COMPONENTTYPE *comp, OMX_STRING name); static OMX_ERRORTYPE vid_enc_Destructor(OMX_COMPONENTTYPE *comp); @@ -94,8 +73,6 @@ static OMX_ERRORTYPE vid_enc_AllocateOutBuffer(omx_base_PortType *comp, OMX_INOU static OMX_ERRORTYPE vid_enc_FreeOutBuffer(omx_base_PortType *port, OMX_U32 idx, OMX_BUFFERHEADERTYPE *buf); static void vid_enc_BufferEncoded(OMX_COMPONENTTYPE *comp, OMX_BUFFERHEADERTYPE* input, OMX_BUFFERHEADERTYPE* output); -static void enc_ReleaseTasks(struct list_head *head); - OMX_ERRORTYPE vid_enc_LoaderComponent(stLoaderComponentType *comp) { comp->componentVersion.s.nVersionMajor = 0; @@ -616,66 +593,6 @@ static OMX_ERRORTYPE vid_enc_GetConfig(OMX_HANDLETYPE handle, OMX_INDEXTYPE idx, return OMX_ErrorNone; } -static enum pipe_video_profile enc_TranslateOMXProfileToPipe(unsigned omx_profile) -{ - switch (omx_profile) { - case OMX_VIDEO_AVCProfileBaseline: - return PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE; - case OMX_VIDEO_AVCProfileMain: - return PIPE_VIDEO_PROFILE_MPEG4_AVC_MAIN; - case OMX_VIDEO_AVCProfileExtended: - return PIPE_VIDEO_PROFILE_MPEG4_AVC_EXTENDED; - case OMX_VIDEO_AVCProfileHigh: - return
[Mesa-dev] [PATCH 3/6] st/omx/tizonia: Add entrypoint
Adds base files for adding components Acked-by: Leo LiuReviewed-by: Julien Isorce --- .../state_trackers/omx/tizonia/Makefile.sources| 4 ++- .../state_trackers/omx/tizonia/entrypoint.c| 37 ++ .../state_trackers/omx/tizonia/entrypoint.h| 35 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 src/gallium/state_trackers/omx/tizonia/entrypoint.c create mode 100644 src/gallium/state_trackers/omx/tizonia/entrypoint.h diff --git a/src/gallium/state_trackers/omx/tizonia/Makefile.sources b/src/gallium/state_trackers/omx/tizonia/Makefile.sources index 9103ca8..de6fcf9 100644 --- a/src/gallium/state_trackers/omx/tizonia/Makefile.sources +++ b/src/gallium/state_trackers/omx/tizonia/Makefile.sources @@ -1 +1,3 @@ -C_SOURCES := +C_SOURCES := \ + entrypoint.c \ + entrypoint.h diff --git a/src/gallium/state_trackers/omx/tizonia/entrypoint.c b/src/gallium/state_trackers/omx/tizonia/entrypoint.c new file mode 100644 index 000..c89bdfd --- /dev/null +++ b/src/gallium/state_trackers/omx/tizonia/entrypoint.c @@ -0,0 +1,37 @@ +/** + * + * Copyright 2013 Advanced Micro Devices, Inc. + * All Rights Reserved. + * + * 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, sub license, 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 +#include +#include + +#include "entrypoint.h" + +OMX_ERRORTYPE OMX_ComponentInit (OMX_HANDLETYPE ap_hdl) +{ + return OMX_ErrorNone; +} diff --git a/src/gallium/state_trackers/omx/tizonia/entrypoint.h b/src/gallium/state_trackers/omx/tizonia/entrypoint.h new file mode 100644 index 000..740a89d --- /dev/null +++ b/src/gallium/state_trackers/omx/tizonia/entrypoint.h @@ -0,0 +1,35 @@ +/** + * + * Copyright 2013 Advanced Micro Devices, Inc. + * All Rights Reserved. + * + * 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, sub license, 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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. + * + **/ + +#ifndef OMX_TIZ_ENTRYPOINT_H +#define OMX_TIZ_ENTRYPOINT_H + +#include "vl/vl_winsys.h" + +PUBLIC OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE ap_hdl); + +#endif -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/6] st/omx/tizonia: Add --enable-omx-tizonia flag and build files
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. GSoC Project link: https://summerofcode.withgoogle.com/projects/#4737166321123328 Acked-by: Leo LiuReviewed-by: Julien Isorce --- configure.ac | 47 +- src/gallium/Makefile.am| 4 ++ src/gallium/state_trackers/omx/Makefile.am | 13 ++ src/gallium/state_trackers/omx/tizonia/Makefile.am | 36 + .../state_trackers/omx/tizonia/Makefile.sources| 1 + src/gallium/targets/omx/Makefile.am| 19 - src/gallium/targets/omx/omx.sym| 1 + 7 files changed, 117 insertions(+), 4 deletions(-) create mode 100644 src/gallium/state_trackers/omx/tizonia/Makefile.am create mode 100644 src/gallium/state_trackers/omx/tizonia/Makefile.sources diff --git a/configure.ac b/configure.ac index 8de0c10..aaa3ca5 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.9.0 LIBVA_REQUIRED=0.38.0 VDPAU_REQUIRED=1.1 WAYLAND_REQUIRED=1.11 @@ -1298,14 +1299,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@:>@])], @@ -1357,11 +1363,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 @@ -2202,6 +2214,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 @@ -2211,6 +2227,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 @@ -2219,6 +2236,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]) @@ -2252,9 +2270,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
Re: [Mesa-dev] [PATCH 2/6] st/omx/tizonia: Add --enable-omx-tizonia flag and build files
On Fri, Jan 19, 2018 at 8:30 PM, Leo Liu <leo@amd.com> wrote: > > > On 01/19/2018 04:46 AM, Julien Isorce wrote: > > Hi Leo, > > Do you have enough data to start the merge ? > > Hi Julien, > > What I can help is to have the patches pushed to upstream, and which I > think anyone with write-permission account also can do. > > I would like to help to push patches that are cleanly applied, and build > successfully, and we can take of how functional later. > > @Dylan, you said: > >The patches in this thread don't apply, there is some other work on you > tree not > >included maybe? Or I'd see about adding it (I don't think it would be too > hard). > >Do you have this series in a public git repo I could pull from? > > I have the patch from this thread applied cleanly without any problem, > re-attached as your reference. > > $ git am *.patch > Applying: st/omx/bellagio: Rename st and target directories > Applying: st/omx/tizonia: Add --enable-omx-tizonia flag and build files > Applying: st/omx/tizonia: Add entrypoint > Applying: st/omx/tizonia: Add H.264 decoder > Applying: st/omx/tizonia: Add H.264 encoder > Applying: st/omx/tizonia/h264d: Add EGLImage support > > > > >For Tizonia, what I'd like to do is change the -Dgallium-omx argument to > accept > >['auto', 'bellagio', 'tizonia', 'disabled'] (this mirrors the glx > option), with > >auto trying to find bellagio and tizonia in some order and falling back to > >disabled if neither is found. > > Can you help to add this into current patch set ? Thanks. > > > @Gukirpal, the patches (also re-attached) failed to build > Ah my bad. I just realised these were slightly older version of same patches that got mixed up. I'll send in the latest ones ASAP. > > > Making all in state_trackers/omx > make[4]: Entering directory 'mesa/src/gallium/state_trackers/omx' > Making all in bellagio > make[5]: Entering directory 'mesa/src/gallium/state_trackers/omx/bellagio' > CC entrypoint.lo > CC vid_dec_mpeg12.lo > CC vid_dec.lo > CC vid_dec_h265.lo > CC vid_enc.lo > CC vid_dec_h264.lo > vid_enc.c: In function ‘vid_enc_Constructor’: > vid_enc.c:150:19: error: implicit declaration of function > ‘omx_get_screen’; did you mean ‘os_get_option’? [-Werror=implicit-function- > declaration] > priv->screen = omx_get_screen("OMX_RENDER_NODE"); >^~ >os_get_option > vid_enc.c:150:17: warning: assignment makes pointer from integer without a > cast [-Wint-conversion] > priv->screen = omx_get_screen("OMX_RENDER_NODE"); > ^ > vid_enc.c: In function ‘vid_enc_Destructor’: > vid_enc.c:276:7: error: implicit declaration of function ‘omx_put_screen’ > [-Werror=implicit-function-declaration] >omx_put_screen(); >^~ > cc1: some warnings being treated as errors > Makefile:682: recipe for target 'vid_enc.lo' failed > make[5]: *** [vid_enc.lo] Error 1 > > > Leo > > > > > Thx > Julien > > On 18 January 2018 at 02:28, Gurkirpal Singh <gurkirpal...@gmail.com> > wrote: > >> >> >> On Wed, Jan 17, 2018 at 10:39 PM, Dylan Baker <dy...@pnwbakers.com> >> wrote: >> >>> The meson build for omx-bellagio has landed along with the other media >>> state >>> trackers that are in tree. Currently there is a known bug with at least >>> vdpau >>> and va-api (I suspect that the omx, va, and xvmc are affected as well) >>> which >>> causes required symbols to not be exported, I'm still trying to resolve >>> that. >>> >>> For Tizonia, what I'd like to do is change the -Dgallium-omx argument to >>> accept >>> ['auto', 'bellagio', 'tizonia', 'disabled'] (this mirrors the glx >>> option), with >>> auto trying to find bellagio and tizonia in some order and falling back >>> to >>> disabled if neither is found. >>> >>> The patches in this thread don't apply, there is some other work on you >>> tree not >>> included maybe? Or I'd see about adding it (I don't think it would be >>> too hard). >>> Do you have this series in a public git repo I could pull from? >>> >> >> I decided not to commit incomplete work so there are only these commits >> in the repo. >> I have it on my github repo branch "refactor_stomx" >> https://github.com/gpalsingh/mesa/commits/refactor_stomx >> >> Cheers >> >>> >>> Dylan >>> >>> Quoting L
Re: [Mesa-dev] [PATCH 2/6] st/omx/tizonia: Add --enable-omx-tizonia flag and build files
On Wed, Jan 17, 2018 at 10:39 PM, Dylan Baker <dy...@pnwbakers.com> wrote: > The meson build for omx-bellagio has landed along with the other media > state > trackers that are in tree. Currently there is a known bug with at least > vdpau > and va-api (I suspect that the omx, va, and xvmc are affected as well) > which > causes required symbols to not be exported, I'm still trying to resolve > that. > > For Tizonia, what I'd like to do is change the -Dgallium-omx argument to > accept > ['auto', 'bellagio', 'tizonia', 'disabled'] (this mirrors the glx option), > with > auto trying to find bellagio and tizonia in some order and falling back to > disabled if neither is found. > > The patches in this thread don't apply, there is some other work on you > tree not > included maybe? Or I'd see about adding it (I don't think it would be too > hard). > Do you have this series in a public git repo I could pull from? > I decided not to commit incomplete work so there are only these commits in the repo. I have it on my github repo branch "refactor_stomx" https://github.com/gpalsingh/mesa/commits/refactor_stomx Cheers > > Dylan > > Quoting Leo Liu (2018-01-17 08:23:54) > > > > > > On 01/17/2018 11:19 AM, Gurkirpal Singh wrote: > > > > > > > > On Wed, Jan 17, 2018 at 8:22 PM, Leo Liu <leo@amd.com> wrote: > > > > Hi Gurkirpal, > > > > Do we have patch 1 in the 6 patch set, or it hasn't arrived. > > > > > > We do have a patch 1 which has been held for moderation for being too > > large. > > > > If there is no arrival tomorrow, please send it as attachment. Thanks. > > > > > > > > Also I haven't seen the updates for Meson build in the current > set. > > > > > > I wasn't sure if the changes needed to be added to this commit or > add a new > > commit. > > > > > > I think Dylan can give you advice on this for sure. > > > > Thanks, > > Leo > > > > > > > > > > > > @Dylan, if possible, could you give an update for the Meson > build on > > the current set? > > > > > > Thanks, > > > > Leo > > > > > > > > > > On 01/17/2018 08:54 AM, Gurkirpal Singh wrote: > > > > 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. > > > > GSoC Project link: https://summerofcode. > withgoogle.com/projects/# > > 4737166321123328 > > > > Acked-by: Leo Liu <leo@amd.com> > > Reviewed-by: Julien Isorce <julien.iso...@gmail.com> > > --- > > configure.ac | 47 > > +- > > src/gallium/Makefile.am| 4 ++ > > src/gallium/state_trackers/omx/Makefile.am | 13 > ++ > > src/gallium/state_trackers/omx/tizonia/Makefile.am | 36 > > + > > .../state_trackers/omx/tizonia/Makefile.sources| 1 + > > src/gallium/targets/omx/Makefile.am| 19 > - > > src/gallium/targets/omx/omx.sym| 1 + > > 7 files changed, 117 insertions(+), 4 deletions(-) > > create mode 100644 src/gallium/state_trackers/omx/tizonia/ > > Makefile.am > > create mode 100644 src/gallium/state_trackers/omx/tizonia/ > > Makefile.sources > > > > diff --git a/configure.ac b/configure.ac > > index 7675a45..1f7b163 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.9.0 > > LIBVA_REQUIRED=0.38.0 > > VDPAU_REQUIRED=1.1 > > WAYLAND_REQUIRED=1.11 > > @@ -1298,14 +1299,19 @@ AC_ARG_ENABLE([vdpau], > > [enable_vdpau=auto]) > > AC_ARG_ENABLE([omx], > >
Re: [Mesa-dev] [PATCH 2/6] st/omx/tizonia: Add --enable-omx-tizonia flag and build files
On Wed, Jan 17, 2018 at 8:22 PM, Leo Liu <leo@amd.com> wrote: > Hi Gurkirpal, > > Do we have patch 1 in the 6 patch set, or it hasn't arrived. > We do have a patch 1 which has been held for moderation for being too large. > > Also I haven't seen the updates for Meson build in the current set. > I wasn't sure if the changes needed to be added to this commit or add a new commit. > > @Dylan, if possible, could you give an update for the Meson build on the > current set? > > > Thanks, > > Leo > > > > > On 01/17/2018 08:54 AM, Gurkirpal Singh wrote: > >> 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. >> >> GSoC Project link: https://summerofcode.withgoogl >> e.com/projects/#4737166321123328 >> >> Acked-by: Leo Liu <leo@amd.com> >> Reviewed-by: Julien Isorce <julien.iso...@gmail.com> >> --- >> configure.ac | 47 >> +- >> src/gallium/Makefile.am| 4 ++ >> src/gallium/state_trackers/omx/Makefile.am | 13 ++ >> src/gallium/state_trackers/omx/tizonia/Makefile.am | 36 >> + >> .../state_trackers/omx/tizonia/Makefile.sources| 1 + >> src/gallium/targets/omx/Makefile.am| 19 - >> src/gallium/targets/omx/omx.sym| 1 + >> 7 files changed, 117 insertions(+), 4 deletions(-) >> create mode 100644 src/gallium/state_trackers/omx/tizonia/Makefile.am >> create mode 100644 src/gallium/state_trackers/omx >> /tizonia/Makefile.sources >> >> diff --git a/configure.ac b/configure.ac >> index 7675a45..1f7b163 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.9.0 >> LIBVA_REQUIRED=0.38.0 >> VDPAU_REQUIRED=1.1 >> WAYLAND_REQUIRED=1.11 >> @@ -1298,14 +1299,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@:>@])], >> @@ -1357,11 +1363,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 >> @@ -2202,6 +2214,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_o
[Mesa-dev] [PATCH 5/6] st/omx/tizonia: Add H.264 encoder
v2: Refactor out screen functions to st/omx Example Gstreamer pipeline : gst-launch-1.0 filesrc location=movie.mp4 ! qtdemux ! h264parse ! avdec_h264 ! videoconvert ! omxh264enc ! h264parse ! avdec_h264 ! videoconvert ! ximagesink Acked-by: Leo LiuReviewed-by: Julien Isorce --- src/gallium/state_trackers/omx/Makefile.sources| 4 +- src/gallium/state_trackers/omx/bellagio/vid_enc.c | 357 +-- src/gallium/state_trackers/omx/bellagio/vid_enc.h | 48 -- .../state_trackers/omx/tizonia/Makefile.sources| 11 + .../state_trackers/omx/tizonia/entrypoint.c| 40 +- src/gallium/state_trackers/omx/tizonia/h264e.c | 184 ++ src/gallium/state_trackers/omx/tizonia/h264e.h | 55 ++ .../state_trackers/omx/tizonia/h264einport.c | 216 +++ .../state_trackers/omx/tizonia/h264einport.h | 31 + .../state_trackers/omx/tizonia/h264einport_decls.h | 48 ++ .../state_trackers/omx/tizonia/h264eoutport.c | 143 + .../state_trackers/omx/tizonia/h264eoutport.h | 31 + .../omx/tizonia/h264eoutport_decls.h | 48 ++ src/gallium/state_trackers/omx/tizonia/h264eprc.c | 688 + src/gallium/state_trackers/omx/tizonia/h264eprc.h | 31 + src/gallium/state_trackers/omx/vid_enc_common.c| 387 src/gallium/state_trackers/omx/vid_enc_common.h| 175 ++ 17 files changed, 2094 insertions(+), 403 deletions(-) create mode 100644 src/gallium/state_trackers/omx/tizonia/h264e.c create mode 100644 src/gallium/state_trackers/omx/tizonia/h264e.h create mode 100644 src/gallium/state_trackers/omx/tizonia/h264einport.c create mode 100644 src/gallium/state_trackers/omx/tizonia/h264einport.h create mode 100644 src/gallium/state_trackers/omx/tizonia/h264einport_decls.h create mode 100644 src/gallium/state_trackers/omx/tizonia/h264eoutport.c create mode 100644 src/gallium/state_trackers/omx/tizonia/h264eoutport.h create mode 100644 src/gallium/state_trackers/omx/tizonia/h264eoutport_decls.h create mode 100644 src/gallium/state_trackers/omx/tizonia/h264eprc.c create mode 100644 src/gallium/state_trackers/omx/tizonia/h264eprc.h create mode 100644 src/gallium/state_trackers/omx/vid_enc_common.c create mode 100644 src/gallium/state_trackers/omx/vid_enc_common.h diff --git a/src/gallium/state_trackers/omx/Makefile.sources b/src/gallium/state_trackers/omx/Makefile.sources index d69d7c6..95bccdd 100644 --- a/src/gallium/state_trackers/omx/Makefile.sources +++ b/src/gallium/state_trackers/omx/Makefile.sources @@ -2,4 +2,6 @@ C_SOURCES := \ vid_dec_common.c \ vid_dec_common.h \ vid_dec_h264_common.c \ - vid_dec_h264_common.h + vid_dec_h264_common.h \ + vid_enc_common.c \ + vid_enc_common.h diff --git a/src/gallium/state_trackers/omx/bellagio/vid_enc.c b/src/gallium/state_trackers/omx/bellagio/vid_enc.c index 1a4fb62..ba8eed2 100644 --- a/src/gallium/state_trackers/omx/bellagio/vid_enc.c +++ b/src/gallium/state_trackers/omx/bellagio/vid_enc.c @@ -49,31 +49,10 @@ #include "pipe/p_screen.h" #include "pipe/p_video_codec.h" #include "util/u_memory.h" -#include "vl/vl_video_buffer.h" #include "entrypoint.h" #include "vid_enc.h" - -struct encode_task { - struct list_head list; - - struct pipe_video_buffer *buf; - unsigned pic_order_cnt; - struct pipe_resource *bitstream; - void *feedback; -}; - -struct input_buf_private { - struct list_head tasks; - - struct pipe_resource *resource; - struct pipe_transfer *transfer; -}; - -struct output_buf_private { - struct pipe_resource *bitstream; - struct pipe_transfer *transfer; -}; +#include "vid_enc_common.h" static OMX_ERRORTYPE vid_enc_Constructor(OMX_COMPONENTTYPE *comp, OMX_STRING name); static OMX_ERRORTYPE vid_enc_Destructor(OMX_COMPONENTTYPE *comp); @@ -93,8 +72,6 @@ static OMX_ERRORTYPE vid_enc_AllocateOutBuffer(omx_base_PortType *comp, OMX_INOU static OMX_ERRORTYPE vid_enc_FreeOutBuffer(omx_base_PortType *port, OMX_U32 idx, OMX_BUFFERHEADERTYPE *buf); static void vid_enc_BufferEncoded(OMX_COMPONENTTYPE *comp, OMX_BUFFERHEADERTYPE* input, OMX_BUFFERHEADERTYPE* output); -static void enc_ReleaseTasks(struct list_head *head); - OMX_ERRORTYPE vid_enc_LoaderComponent(stLoaderComponentType *comp) { comp->componentVersion.s.nVersionMajor = 0; @@ -170,7 +147,7 @@ static OMX_ERRORTYPE vid_enc_Constructor(OMX_COMPONENTTYPE *comp, OMX_STRING nam comp->GetConfig = vid_enc_GetConfig; comp->SetConfig = vid_enc_SetConfig; - priv->screen = omx_get_screen(); + priv->screen = omx_get_screen("OMX_RENDER_NODE"); if (!priv->screen) return OMX_ErrorInsufficientResources; @@ -615,66 +592,6 @@ static OMX_ERRORTYPE vid_enc_GetConfig(OMX_HANDLETYPE handle, OMX_INDEXTYPE idx, return OMX_ErrorNone; } -static enum pipe_video_profile enc_TranslateOMXProfileToPipe(unsigned omx_profile) -{ - switch (omx_profile) { - case
[Mesa-dev] [PATCH 6/6] st/omx/tizonia/h264d: Add EGLImage support
Example Gstreamer pipeline : MESA_ENABLE_OMX_EGLIMAGE=1 GST_GL_API=gles2 GST_GL_PLATFORM=egl gst-launch-1.0 filesrc location=movie.mp4 ! qtdemux ! h264parse ! omxh264dec ! glimagesink Acked-by: Leo LiuReviewed-by: Julien Isorce --- src/gallium/state_trackers/omx/Makefile.am | 1 + src/gallium/state_trackers/omx/tizonia/Makefile.am | 13 +++ .../state_trackers/omx/tizonia/entrypoint.c| 44 src/gallium/state_trackers/omx/tizonia/h264dprc.c | 116 - src/gallium/state_trackers/omx/vid_dec_common.c| 38 +++ src/gallium/state_trackers/omx/vid_dec_common.h| 3 + 6 files changed, 211 insertions(+), 4 deletions(-) diff --git a/src/gallium/state_trackers/omx/Makefile.am b/src/gallium/state_trackers/omx/Makefile.am index de6eb64..fbde8e0 100644 --- a/src/gallium/state_trackers/omx/Makefile.am +++ b/src/gallium/state_trackers/omx/Makefile.am @@ -37,6 +37,7 @@ SUBDIRS = tizonia AM_CFLAGS = \ $(GALLIUM_CFLAGS) \ + $(LIBDRM_CFLAGS) \ $(VISIBILITY_CFLAGS) \ $(VL_CFLAGS) \ $(XCB_DRI3_CFLAGS) \ diff --git a/src/gallium/state_trackers/omx/tizonia/Makefile.am b/src/gallium/state_trackers/omx/tizonia/Makefile.am index 0f72e39..3149afa 100644 --- a/src/gallium/state_trackers/omx/tizonia/Makefile.am +++ b/src/gallium/state_trackers/omx/tizonia/Makefile.am @@ -22,8 +22,21 @@ include Makefile.sources include $(top_srcdir)/src/gallium/Automake.inc AM_CFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/src/mapi \ + -I$(top_srcdir)/src/mesa \ + -I$(top_builddir)/src/mesa/drivers/dri/common \ + -I$(top_srcdir)/src/mesa/drivers/dri/common \ + -I$(top_srcdir)/src/egl/drivers/dri2 \ + -I$(top_srcdir)/src/egl/wayland/wayland-egl \ + -I$(top_srcdir)/src/egl/main \ + -I$(top_srcdir)/src/gbm/main \ + -I$(top_srcdir)/src/loader \ + -I$(top_srcdir)/src/gbm/backends/dri \ + -I$(top_srcdir)/src/gallium/state_trackers/dri \ -I$(top_srcdir)/src/gallium/state_trackers/omx \ $(GALLIUM_CFLAGS) \ + $(LIBDRM_CFLAGS) \ $(VISIBILITY_CFLAGS) \ $(VL_CFLAGS) \ $(XCB_DRI3_CFLAGS) \ diff --git a/src/gallium/state_trackers/omx/tizonia/entrypoint.c b/src/gallium/state_trackers/omx/tizonia/entrypoint.c index 72d955b..b896447 100644 --- a/src/gallium/state_trackers/omx/tizonia/entrypoint.c +++ b/src/gallium/state_trackers/omx/tizonia/entrypoint.c @@ -44,6 +44,40 @@ #include "h264eoutport.h" #include "names.h" +#include "util/u_debug.h" + +DEBUG_GET_ONCE_BOOL_OPTION(mesa_enable_omx_eglimage, + "MESA_ENABLE_OMX_EGLIMAGE", + false) + +static OMX_BOOL egl_image_validation_hook(const OMX_HANDLETYPE ap_hdl, + OMX_U32 pid, OMX_PTR ap_eglimage, + void *ap_args) +{ + const void * p_krn = NULL; + const tiz_port_t * p_port = NULL; + + assert(ap_hdl); + assert(ap_eglimage); + assert(!ap_args); + + if (!debug_get_option_mesa_enable_omx_eglimage()) { + return OMX_FALSE; + } + + p_krn = tiz_get_krn(ap_hdl); + p_port = tiz_krn_get_port(p_krn, pid); + + const OMX_VIDEO_PORTDEFINITIONTYPE * p_video_portdef + = &(p_port->portdef_.format.video); + + if (!p_video_portdef->pNativeWindow) { + return OMX_FALSE; + } + + return OMX_TRUE; +} + OMX_ERRORTYPE OMX_ComponentInit (OMX_HANDLETYPE ap_hdl) { tiz_role_factory_t h264d_role; @@ -57,6 +91,11 @@ OMX_ERRORTYPE OMX_ComponentInit (OMX_HANDLETYPE ap_hdl) const tiz_type_factory_t * tf_list[] = {_inport_type, _outport_type, _type, _type, _inport_type}; + const tiz_eglimage_hook_t egl_validation_hook = { + OMX_VID_DEC_AVC_OUTPUT_PORT_INDEX, + egl_image_validation_hook, + NULL + }; /* Settings for roles */ strcpy ((OMX_STRING) h264d_role.role, OMX_VID_DEC_AVC_ROLE); @@ -108,5 +147,10 @@ OMX_ERRORTYPE OMX_ComponentInit (OMX_HANDLETYPE ap_hdl) /* Register the component roles */ tiz_comp_register_roles (ap_hdl, rf_list, 2); + /* Register egl image validation hook for the decoder */ + tiz_check_omx (tiz_comp_register_role_eglimage_hook + (ap_hdl, (const OMX_U8 *) OMX_VID_DEC_AVC_ROLE, + _validation_hook)); + return OMX_ErrorNone; } diff --git a/src/gallium/state_trackers/omx/tizonia/h264dprc.c b/src/gallium/state_trackers/omx/tizonia/h264dprc.c index 81773f4..cdbe509 100644 --- a/src/gallium/state_trackers/omx/tizonia/h264dprc.c +++ b/src/gallium/state_trackers/omx/tizonia/h264dprc.c @@ -37,10 +37,33 @@ #include "vl/vl_video_buffer.h" #include "vl/vl_compositor.h" +#include "util/u_hash_table.h" #include "util/u_surface.h" +#include "dri_screen.h" +#include "egl_dri2.h" + unsigned dec_frame_delta;
[Mesa-dev] [PATCH 2/6] st/omx/tizonia: Add --enable-omx-tizonia flag and build files
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. GSoC Project link: https://summerofcode.withgoogle.com/projects/#4737166321123328 Acked-by: Leo LiuReviewed-by: Julien Isorce --- configure.ac | 47 +- src/gallium/Makefile.am| 4 ++ src/gallium/state_trackers/omx/Makefile.am | 13 ++ src/gallium/state_trackers/omx/tizonia/Makefile.am | 36 + .../state_trackers/omx/tizonia/Makefile.sources| 1 + src/gallium/targets/omx/Makefile.am| 19 - src/gallium/targets/omx/omx.sym| 1 + 7 files changed, 117 insertions(+), 4 deletions(-) create mode 100644 src/gallium/state_trackers/omx/tizonia/Makefile.am create mode 100644 src/gallium/state_trackers/omx/tizonia/Makefile.sources diff --git a/configure.ac b/configure.ac index 7675a45..1f7b163 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.9.0 LIBVA_REQUIRED=0.38.0 VDPAU_REQUIRED=1.1 WAYLAND_REQUIRED=1.11 @@ -1298,14 +1299,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@:>@])], @@ -1357,11 +1363,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 @@ -2202,6 +2214,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 @@ -2211,6 +2227,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 @@ -2219,6 +2236,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]) @@ -2252,9 +2270,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
[Mesa-dev] [PATCH 3/6] st/omx/tizonia: Add entrypoint
Adds base files for adding components Acked-by: Leo LiuReviewed-by: Julien Isorce --- .../state_trackers/omx/tizonia/Makefile.sources| 4 ++- .../state_trackers/omx/tizonia/entrypoint.c| 37 ++ .../state_trackers/omx/tizonia/entrypoint.h| 35 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 src/gallium/state_trackers/omx/tizonia/entrypoint.c create mode 100644 src/gallium/state_trackers/omx/tizonia/entrypoint.h diff --git a/src/gallium/state_trackers/omx/tizonia/Makefile.sources b/src/gallium/state_trackers/omx/tizonia/Makefile.sources index 9103ca8..de6fcf9 100644 --- a/src/gallium/state_trackers/omx/tizonia/Makefile.sources +++ b/src/gallium/state_trackers/omx/tizonia/Makefile.sources @@ -1 +1,3 @@ -C_SOURCES := +C_SOURCES := \ + entrypoint.c \ + entrypoint.h diff --git a/src/gallium/state_trackers/omx/tizonia/entrypoint.c b/src/gallium/state_trackers/omx/tizonia/entrypoint.c new file mode 100644 index 000..c89bdfd --- /dev/null +++ b/src/gallium/state_trackers/omx/tizonia/entrypoint.c @@ -0,0 +1,37 @@ +/** + * + * Copyright 2013 Advanced Micro Devices, Inc. + * All Rights Reserved. + * + * 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, sub license, 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 +#include +#include + +#include "entrypoint.h" + +OMX_ERRORTYPE OMX_ComponentInit (OMX_HANDLETYPE ap_hdl) +{ + return OMX_ErrorNone; +} diff --git a/src/gallium/state_trackers/omx/tizonia/entrypoint.h b/src/gallium/state_trackers/omx/tizonia/entrypoint.h new file mode 100644 index 000..740a89d --- /dev/null +++ b/src/gallium/state_trackers/omx/tizonia/entrypoint.h @@ -0,0 +1,35 @@ +/** + * + * Copyright 2013 Advanced Micro Devices, Inc. + * All Rights Reserved. + * + * 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, sub license, 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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. + * + **/ + +#ifndef OMX_TIZ_ENTRYPOINT_H +#define OMX_TIZ_ENTRYPOINT_H + +#include "vl/vl_winsys.h" + +PUBLIC OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE ap_hdl); + +#endif -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/7] gallium: Refactor out vl_put_screen and vl_get_screen
On Mon, Jan 15, 2018 at 9:24 PM, Leo Liu <leo@amd.com> wrote: > Hi lists, > > > If there is no more questions, and no objection, I would like to commit > this new OMX st. to upstream. > > @Gurkipal, If you can send me or lists your rebased patches set for > committing, that would be appreciated. > I wanted to know if it's required to test the patches before sending them. I've since then switched to a laptop with NVIDIA card and have limited access to the desktop with the AMD card (that i used to work on during the project). So I'm unable to test the encoder on this machine right now. It could take a few weeks until I could do so. > > Leo > > On 12/04/2017 08:58 AM, Leo Liu wrote: > > > > On 12/03/2017 10:04 AM, Gurkirpal Singh wrote: > > I sent the modified patches in another thread a while ago. > Please review in case got missed. > > Please be patient for a few days to see if any other comments. > After then please rebase, add rb/ab to your patches, and send them to me, > I will commit them for you. > > Leo > > > > On Thu, Nov 30, 2017 at 7:35 PM, Leo Liu <leo@amd.com> wrote: > >> >> >> On 11/30/2017 06:22 AM, Julien Isorce wrote: >> >> Hi Gurkirpal, >> >> > Before refactoring process both the state trackers were in independent >> directories. >> > During earlier refactoring effort we decided to keep that directory >> structure so it made >> > sense to move them to auxiliary code. After that I moved them both >> under st/omx. >> > Since there could be a chance of it being useful out of st/omx, I left >> the decision to >> > keep it or move it back to st/omx to the mailing list. >> >> Yes please move it back to st/omx for the reasons you said, i.e. there >> will now 2 >> sub directories, st/omx/bellagio and st/omx/tizonia and common code in >> st/omx. >> >> Yes. Please move them back to st/omx. >> >> With that fixed, the series are: >> >> Acked-by: Leo Liu <leo@amd.com> <leo@amd.com> >> >> Thanks for the work! >> >> Leo >> >> >> >> >> Another reason is that the env var "OMX_RENDER_NODE" mentions OMX. >> >> Thx! >> Julien >> >> >> On 29 November 2017 at 04:02, Gurkirpal Singh <gurkirpal...@gmail.com> >> wrote: >> >>> --- >>> src/gallium/auxiliary/Makefile.sources | 2 + >>> src/gallium/auxiliary/vl/vl_screen.c | 107 >>> + >>> src/gallium/auxiliary/vl/vl_screen.h | 33 +++ >>> .../state_trackers/omx_bellagio/entrypoint.c | 83 >>> >>> .../state_trackers/omx_bellagio/entrypoint.h | 3 - >>> src/gallium/state_trackers/omx_bellagio/vid_dec.c | 5 +- >>> src/gallium/state_trackers/omx_bellagio/vid_enc.c | 5 +- >>> 7 files changed, 148 insertions(+), 90 deletions(-) >>> create mode 100644 src/gallium/auxiliary/vl/vl_screen.c >>> create mode 100644 src/gallium/auxiliary/vl/vl_screen.h >>> >>> diff --git a/src/gallium/auxiliary/Makefile.sources >>> b/src/gallium/auxiliary/Makefile.sources >>> index f40c472..35e89f9 100644 >>> --- a/src/gallium/auxiliary/Makefile.sources >>> +++ b/src/gallium/auxiliary/Makefile.sources >>> @@ -343,6 +343,8 @@ VL_SOURCES := \ >>> vl/vl_mpeg12_decoder.c \ >>> vl/vl_mpeg12_decoder.h \ >>> vl/vl_rbsp.h \ >>> + vl/vl_screen.c \ >>> + vl/vl_screen.h \ >>> vl/vl_types.h \ >>> vl/vl_vertex_buffers.c \ >>> vl/vl_vertex_buffers.h \ >>> diff --git a/src/gallium/auxiliary/vl/vl_screen.c >>> b/src/gallium/auxiliary/vl/vl_screen.c >>> new file mode 100644 >>> index 000..7192802 >>> --- /dev/null >>> +++ b/src/gallium/auxiliary/vl/vl_screen.c >>> @@ -0,0 +1,107 @@ >>> +/** >>> >>> + * >>> + * 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, sub license, and/or sell copies of the Software, and to >>> + * permit p
Re: [Mesa-dev] [PATCH 1/7] gallium: Refactor out vl_put_screen and vl_get_screen
I sent the modified patches in another thread a while ago. Please review in case got missed. On Thu, Nov 30, 2017 at 7:35 PM, Leo Liu <leo@amd.com> wrote: > > > On 11/30/2017 06:22 AM, Julien Isorce wrote: > > Hi Gurkirpal, > > > Before refactoring process both the state trackers were in independent > directories. > > During earlier refactoring effort we decided to keep that directory > structure so it made > > sense to move them to auxiliary code. After that I moved them both under > st/omx. > > Since there could be a chance of it being useful out of st/omx, I left > the decision to > > keep it or move it back to st/omx to the mailing list. > > Yes please move it back to st/omx for the reasons you said, i.e. there > will now 2 > sub directories, st/omx/bellagio and st/omx/tizonia and common code in > st/omx. > > Yes. Please move them back to st/omx. > > With that fixed, the series are: > > Acked-by: Leo Liu <leo@amd.com> <leo@amd.com> > > Thanks for the work! > > Leo > > > > > Another reason is that the env var "OMX_RENDER_NODE" mentions OMX. > > Thx! > Julien > > > On 29 November 2017 at 04:02, Gurkirpal Singh <gurkirpal...@gmail.com> > wrote: > >> --- >> src/gallium/auxiliary/Makefile.sources | 2 + >> src/gallium/auxiliary/vl/vl_screen.c | 107 >> + >> src/gallium/auxiliary/vl/vl_screen.h | 33 +++ >> .../state_trackers/omx_bellagio/entrypoint.c | 83 >> >> .../state_trackers/omx_bellagio/entrypoint.h | 3 - >> src/gallium/state_trackers/omx_bellagio/vid_dec.c | 5 +- >> src/gallium/state_trackers/omx_bellagio/vid_enc.c | 5 +- >> 7 files changed, 148 insertions(+), 90 deletions(-) >> create mode 100644 src/gallium/auxiliary/vl/vl_screen.c >> create mode 100644 src/gallium/auxiliary/vl/vl_screen.h >> >> diff --git a/src/gallium/auxiliary/Makefile.sources >> b/src/gallium/auxiliary/Makefile.sources >> index f40c472..35e89f9 100644 >> --- a/src/gallium/auxiliary/Makefile.sources >> +++ b/src/gallium/auxiliary/Makefile.sources >> @@ -343,6 +343,8 @@ VL_SOURCES := \ >> vl/vl_mpeg12_decoder.c \ >> vl/vl_mpeg12_decoder.h \ >> vl/vl_rbsp.h \ >> + vl/vl_screen.c \ >> + vl/vl_screen.h \ >> vl/vl_types.h \ >> vl/vl_vertex_buffers.c \ >> vl/vl_vertex_buffers.h \ >> diff --git a/src/gallium/auxiliary/vl/vl_screen.c >> b/src/gallium/auxiliary/vl/vl_screen.c >> new file mode 100644 >> index 000..7192802 >> --- /dev/null >> +++ b/src/gallium/auxiliary/vl/vl_screen.c >> @@ -0,0 +1,107 @@ >> +/** >> >> + * >> + * 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, sub license, 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 >> NON-INFRINGEMENT. >> + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS 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 >> +#include >> +#include >> + >> +#include "os/os_thread.h" >> +#include "util/u_memory.h" >> +#include "loader/loader.h" >> +#include "vl_screen.h" >> + >> +#if defined(HAVE_X11_PLATFORM) >> +#include >> +#else >> +#define XOpenDisplay(x) NULL >> +#define X
[Mesa-dev] [PATCH v2 2/6] st/omx/tizonia: Add --enable-omx-tizonia flag and build files
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. GSoC Project link: https://summerofcode.withgoogle.com/projects/#4737166321123328 --- configure.ac | 47 +- src/gallium/Makefile.am| 4 ++ src/gallium/state_trackers/omx/Makefile.am | 13 ++ src/gallium/state_trackers/omx/tizonia/Makefile.am | 36 + .../state_trackers/omx/tizonia/Makefile.sources| 1 + src/gallium/targets/omx/Makefile.am| 19 - src/gallium/targets/omx/omx.sym| 1 + 7 files changed, 117 insertions(+), 4 deletions(-) create mode 100644 src/gallium/state_trackers/omx/tizonia/Makefile.am create mode 100644 src/gallium/state_trackers/omx/tizonia/Makefile.sources diff --git a/configure.ac b/configure.ac index f127d24..5145818 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.9.0 LIBVA_REQUIRED=0.38.0 VDPAU_REQUIRED=1.1 WAYLAND_REQUIRED=1.11 @@ -1294,14 +1295,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@:>@])], @@ -1353,11 +1359,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 @@ -2198,6 +2210,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 @@ -2207,6 +2223,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 @@ -2215,6 +2232,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]) @@ -2248,9 +2266,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
[Mesa-dev] [PATCH v2 3/6] st/omx/tizonia: Add entrypoint
Adds base files for adding components --- .../state_trackers/omx/tizonia/Makefile.sources| 4 ++- .../state_trackers/omx/tizonia/entrypoint.c| 37 ++ .../state_trackers/omx/tizonia/entrypoint.h| 35 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 src/gallium/state_trackers/omx/tizonia/entrypoint.c create mode 100644 src/gallium/state_trackers/omx/tizonia/entrypoint.h diff --git a/src/gallium/state_trackers/omx/tizonia/Makefile.sources b/src/gallium/state_trackers/omx/tizonia/Makefile.sources index 9103ca8..de6fcf9 100644 --- a/src/gallium/state_trackers/omx/tizonia/Makefile.sources +++ b/src/gallium/state_trackers/omx/tizonia/Makefile.sources @@ -1 +1,3 @@ -C_SOURCES := +C_SOURCES := \ + entrypoint.c \ + entrypoint.h diff --git a/src/gallium/state_trackers/omx/tizonia/entrypoint.c b/src/gallium/state_trackers/omx/tizonia/entrypoint.c new file mode 100644 index 000..c89bdfd --- /dev/null +++ b/src/gallium/state_trackers/omx/tizonia/entrypoint.c @@ -0,0 +1,37 @@ +/** + * + * Copyright 2013 Advanced Micro Devices, Inc. + * All Rights Reserved. + * + * 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, sub license, 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 +#include +#include + +#include "entrypoint.h" + +OMX_ERRORTYPE OMX_ComponentInit (OMX_HANDLETYPE ap_hdl) +{ + return OMX_ErrorNone; +} diff --git a/src/gallium/state_trackers/omx/tizonia/entrypoint.h b/src/gallium/state_trackers/omx/tizonia/entrypoint.h new file mode 100644 index 000..740a89d --- /dev/null +++ b/src/gallium/state_trackers/omx/tizonia/entrypoint.h @@ -0,0 +1,35 @@ +/** + * + * Copyright 2013 Advanced Micro Devices, Inc. + * All Rights Reserved. + * + * 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, sub license, 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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. + * + **/ + +#ifndef OMX_TIZ_ENTRYPOINT_H +#define OMX_TIZ_ENTRYPOINT_H + +#include "vl/vl_winsys.h" + +PUBLIC OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE ap_hdl); + +#endif -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH v2 6/6] st/omx/tizonia/h264d: Add EGLImage support
Example Gstreamer pipeline : MESA_ENABLE_OMX_EGLIMAGE=1 GST_GL_API=gles2 GST_GL_PLATFORM=egl gst-launch-1.0 filesrc location=movie.mp4 ! qtdemux ! h264parse ! omxh264dec ! glimagesink --- src/gallium/state_trackers/omx/Makefile.am | 1 + src/gallium/state_trackers/omx/tizonia/Makefile.am | 13 +++ .../state_trackers/omx/tizonia/entrypoint.c| 44 src/gallium/state_trackers/omx/tizonia/h264dprc.c | 116 - src/gallium/state_trackers/omx/vid_dec_common.c| 38 +++ src/gallium/state_trackers/omx/vid_dec_common.h| 3 + 6 files changed, 211 insertions(+), 4 deletions(-) diff --git a/src/gallium/state_trackers/omx/Makefile.am b/src/gallium/state_trackers/omx/Makefile.am index de6eb64..fbde8e0 100644 --- a/src/gallium/state_trackers/omx/Makefile.am +++ b/src/gallium/state_trackers/omx/Makefile.am @@ -37,6 +37,7 @@ SUBDIRS = tizonia AM_CFLAGS = \ $(GALLIUM_CFLAGS) \ + $(LIBDRM_CFLAGS) \ $(VISIBILITY_CFLAGS) \ $(VL_CFLAGS) \ $(XCB_DRI3_CFLAGS) \ diff --git a/src/gallium/state_trackers/omx/tizonia/Makefile.am b/src/gallium/state_trackers/omx/tizonia/Makefile.am index 0f72e39..3149afa 100644 --- a/src/gallium/state_trackers/omx/tizonia/Makefile.am +++ b/src/gallium/state_trackers/omx/tizonia/Makefile.am @@ -22,8 +22,21 @@ include Makefile.sources include $(top_srcdir)/src/gallium/Automake.inc AM_CFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/src/mapi \ + -I$(top_srcdir)/src/mesa \ + -I$(top_builddir)/src/mesa/drivers/dri/common \ + -I$(top_srcdir)/src/mesa/drivers/dri/common \ + -I$(top_srcdir)/src/egl/drivers/dri2 \ + -I$(top_srcdir)/src/egl/wayland/wayland-egl \ + -I$(top_srcdir)/src/egl/main \ + -I$(top_srcdir)/src/gbm/main \ + -I$(top_srcdir)/src/loader \ + -I$(top_srcdir)/src/gbm/backends/dri \ + -I$(top_srcdir)/src/gallium/state_trackers/dri \ -I$(top_srcdir)/src/gallium/state_trackers/omx \ $(GALLIUM_CFLAGS) \ + $(LIBDRM_CFLAGS) \ $(VISIBILITY_CFLAGS) \ $(VL_CFLAGS) \ $(XCB_DRI3_CFLAGS) \ diff --git a/src/gallium/state_trackers/omx/tizonia/entrypoint.c b/src/gallium/state_trackers/omx/tizonia/entrypoint.c index 72d955b..b896447 100644 --- a/src/gallium/state_trackers/omx/tizonia/entrypoint.c +++ b/src/gallium/state_trackers/omx/tizonia/entrypoint.c @@ -44,6 +44,40 @@ #include "h264eoutport.h" #include "names.h" +#include "util/u_debug.h" + +DEBUG_GET_ONCE_BOOL_OPTION(mesa_enable_omx_eglimage, + "MESA_ENABLE_OMX_EGLIMAGE", + false) + +static OMX_BOOL egl_image_validation_hook(const OMX_HANDLETYPE ap_hdl, + OMX_U32 pid, OMX_PTR ap_eglimage, + void *ap_args) +{ + const void * p_krn = NULL; + const tiz_port_t * p_port = NULL; + + assert(ap_hdl); + assert(ap_eglimage); + assert(!ap_args); + + if (!debug_get_option_mesa_enable_omx_eglimage()) { + return OMX_FALSE; + } + + p_krn = tiz_get_krn(ap_hdl); + p_port = tiz_krn_get_port(p_krn, pid); + + const OMX_VIDEO_PORTDEFINITIONTYPE * p_video_portdef + = &(p_port->portdef_.format.video); + + if (!p_video_portdef->pNativeWindow) { + return OMX_FALSE; + } + + return OMX_TRUE; +} + OMX_ERRORTYPE OMX_ComponentInit (OMX_HANDLETYPE ap_hdl) { tiz_role_factory_t h264d_role; @@ -57,6 +91,11 @@ OMX_ERRORTYPE OMX_ComponentInit (OMX_HANDLETYPE ap_hdl) const tiz_type_factory_t * tf_list[] = {_inport_type, _outport_type, _type, _type, _inport_type}; + const tiz_eglimage_hook_t egl_validation_hook = { + OMX_VID_DEC_AVC_OUTPUT_PORT_INDEX, + egl_image_validation_hook, + NULL + }; /* Settings for roles */ strcpy ((OMX_STRING) h264d_role.role, OMX_VID_DEC_AVC_ROLE); @@ -108,5 +147,10 @@ OMX_ERRORTYPE OMX_ComponentInit (OMX_HANDLETYPE ap_hdl) /* Register the component roles */ tiz_comp_register_roles (ap_hdl, rf_list, 2); + /* Register egl image validation hook for the decoder */ + tiz_check_omx (tiz_comp_register_role_eglimage_hook + (ap_hdl, (const OMX_U8 *) OMX_VID_DEC_AVC_ROLE, + _validation_hook)); + return OMX_ErrorNone; } diff --git a/src/gallium/state_trackers/omx/tizonia/h264dprc.c b/src/gallium/state_trackers/omx/tizonia/h264dprc.c index f5c5d659..96f95b9 100644 --- a/src/gallium/state_trackers/omx/tizonia/h264dprc.c +++ b/src/gallium/state_trackers/omx/tizonia/h264dprc.c @@ -38,10 +38,33 @@ #include "vl/vl_video_buffer.h" #include "vl/vl_compositor.h" +#include "util/u_hash_table.h" #include "util/u_surface.h" +#include "dri_screen.h" +#include "egl_dri2.h" + unsigned dec_frame_delta; +#define PTR_TO_UINT(x) ((unsigned)((intptr_t)(x))) + +static unsigned handle_hash(void
[Mesa-dev] [PATCH v2 5/6] st/omx/tizonia: Add H.264 encoder
v2: Refactor out screen functions to st/omx Example Gstreamer pipeline : gst-launch-1.0 filesrc location=movie.mp4 ! qtdemux ! h264parse ! avdec_h264 ! videoconvert ! omxh264enc ! h264parse ! avdec_h264 ! videoconvert ! ximagesink --- src/gallium/state_trackers/omx/Makefile.sources| 4 +- src/gallium/state_trackers/omx/bellagio/vid_enc.c | 355 +-- src/gallium/state_trackers/omx/bellagio/vid_enc.h | 48 -- .../state_trackers/omx/tizonia/Makefile.sources| 11 + .../state_trackers/omx/tizonia/entrypoint.c| 40 +- src/gallium/state_trackers/omx/tizonia/h264e.c | 184 ++ src/gallium/state_trackers/omx/tizonia/h264e.h | 55 ++ .../state_trackers/omx/tizonia/h264einport.c | 216 +++ .../state_trackers/omx/tizonia/h264einport.h | 31 + .../state_trackers/omx/tizonia/h264einport_decls.h | 48 ++ .../state_trackers/omx/tizonia/h264eoutport.c | 143 + .../state_trackers/omx/tizonia/h264eoutport.h | 31 + .../omx/tizonia/h264eoutport_decls.h | 48 ++ src/gallium/state_trackers/omx/tizonia/h264eprc.c | 689 + src/gallium/state_trackers/omx/tizonia/h264eprc.h | 31 + src/gallium/state_trackers/omx/vid_enc_common.c| 387 src/gallium/state_trackers/omx/vid_enc_common.h| 175 ++ 17 files changed, 2094 insertions(+), 402 deletions(-) create mode 100644 src/gallium/state_trackers/omx/tizonia/h264e.c create mode 100644 src/gallium/state_trackers/omx/tizonia/h264e.h create mode 100644 src/gallium/state_trackers/omx/tizonia/h264einport.c create mode 100644 src/gallium/state_trackers/omx/tizonia/h264einport.h create mode 100644 src/gallium/state_trackers/omx/tizonia/h264einport_decls.h create mode 100644 src/gallium/state_trackers/omx/tizonia/h264eoutport.c create mode 100644 src/gallium/state_trackers/omx/tizonia/h264eoutport.h create mode 100644 src/gallium/state_trackers/omx/tizonia/h264eoutport_decls.h create mode 100644 src/gallium/state_trackers/omx/tizonia/h264eprc.c create mode 100644 src/gallium/state_trackers/omx/tizonia/h264eprc.h create mode 100644 src/gallium/state_trackers/omx/vid_enc_common.c create mode 100644 src/gallium/state_trackers/omx/vid_enc_common.h diff --git a/src/gallium/state_trackers/omx/Makefile.sources b/src/gallium/state_trackers/omx/Makefile.sources index ba9b0be..0fb1d9a 100644 --- a/src/gallium/state_trackers/omx/Makefile.sources +++ b/src/gallium/state_trackers/omx/Makefile.sources @@ -4,4 +4,6 @@ C_SOURCES := \ vid_dec_h264_common.c \ vid_dec_h264_common.h \ vid_omx_common.c \ - vid_omx_common.h + vid_omx_common.h \ + vid_enc_common.c \ + vid_enc_common.h diff --git a/src/gallium/state_trackers/omx/bellagio/vid_enc.c b/src/gallium/state_trackers/omx/bellagio/vid_enc.c index 64ff624..9f94a1c 100644 --- a/src/gallium/state_trackers/omx/bellagio/vid_enc.c +++ b/src/gallium/state_trackers/omx/bellagio/vid_enc.c @@ -49,32 +49,11 @@ #include "pipe/p_screen.h" #include "pipe/p_video_codec.h" #include "util/u_memory.h" -#include "vl/vl_video_buffer.h" #include "entrypoint.h" #include "vid_enc.h" #include "vid_omx_common.h" - -struct encode_task { - struct list_head list; - - struct pipe_video_buffer *buf; - unsigned pic_order_cnt; - struct pipe_resource *bitstream; - void *feedback; -}; - -struct input_buf_private { - struct list_head tasks; - - struct pipe_resource *resource; - struct pipe_transfer *transfer; -}; - -struct output_buf_private { - struct pipe_resource *bitstream; - struct pipe_transfer *transfer; -}; +#include "vid_enc_common.h" static OMX_ERRORTYPE vid_enc_Constructor(OMX_COMPONENTTYPE *comp, OMX_STRING name); static OMX_ERRORTYPE vid_enc_Destructor(OMX_COMPONENTTYPE *comp); @@ -94,8 +73,6 @@ static OMX_ERRORTYPE vid_enc_AllocateOutBuffer(omx_base_PortType *comp, OMX_INOU static OMX_ERRORTYPE vid_enc_FreeOutBuffer(omx_base_PortType *port, OMX_U32 idx, OMX_BUFFERHEADERTYPE *buf); static void vid_enc_BufferEncoded(OMX_COMPONENTTYPE *comp, OMX_BUFFERHEADERTYPE* input, OMX_BUFFERHEADERTYPE* output); -static void enc_ReleaseTasks(struct list_head *head); - OMX_ERRORTYPE vid_enc_LoaderComponent(stLoaderComponentType *comp) { comp->componentVersion.s.nVersionMajor = 0; @@ -616,66 +593,6 @@ static OMX_ERRORTYPE vid_enc_GetConfig(OMX_HANDLETYPE handle, OMX_INDEXTYPE idx, return OMX_ErrorNone; } -static enum pipe_video_profile enc_TranslateOMXProfileToPipe(unsigned omx_profile) -{ - switch (omx_profile) { - case OMX_VIDEO_AVCProfileBaseline: - return PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE; - case OMX_VIDEO_AVCProfileMain: - return PIPE_VIDEO_PROFILE_MPEG4_AVC_MAIN; - case OMX_VIDEO_AVCProfileExtended: - return PIPE_VIDEO_PROFILE_MPEG4_AVC_EXTENDED; - case OMX_VIDEO_AVCProfileHigh: - return PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH; - case OMX_VIDEO_AVCProfileHigh10: - return
Re: [Mesa-dev] Refactored st/omx/tizonia commits
If you are referring to earlier discussion about having tizonia build problems then it was about disabling some extra CPU intensive features like the tizonia player which isn't needed here. This was only required if you wanted to build from source instead of downloading it. Later Juan added an option to do the same https://github.com/tizonia/tizonia-openmax-il/commit/9ab5ecea12ee4dfe6ee058274c8e1a96d4d051e6 Other than that any changes that were needed in the tizonia omxil code were pushed to the main branch before the project officially ended in august. On Wed, Nov 29, 2017 at 10:59 PM, Leo Liu <leo@amd.com> wrote: > > > On 11/29/2017 12:23 PM, Christian König wrote: > > Am 29.11.2017 um 18:08 schrieb Gurkirpal Singh: > > > > On Wed, Nov 29, 2017 at 3:20 PM, Christian König < > ckoenig.leichtzumer...@gmail.com> wrote: > >> Am 29.11.2017 um 05:02 schrieb Gurkirpal Singh: >> >>> These are the refactored commits related to the GSoC project involving >>> adding a st/omx state tracker using tizonia. >>> There are still some parts of code that i didn't refactor yet as >>> explained below: >>> 1) I wasn't sure if it's okay to use #if-#else declaratives for function >>> declarations. For eg: One function accepts omx_base_PortType and the >>> other >>> one vid_dec_PrivateType >>> 2) Because of the argument type differences there is excessive amounts of >>> #if-#else pairs will be needed >>> So I decided to wait for review before making those changes. >>> >> >> Looks really good to me and I think as well that we should avoid >> excessive #if-#else pairs even if that means we have a bit of code >> duplication. >> >> One question I have is why do you move the vl screen helpers into the >> auxiliary code in the first patch and not just keep it as common code under >> the st/omx directory? > > >> I mean could make sense to use that somewhere else, but we currently >> don't do this and your solution for the rest of the code looks, e.g. the >> H264 decoder, looks really nice to me. > > Before refactoring process both the state trackers were in independet > directories. During earlier refactoring effort we decided to keep that > directory structure so it made sense to move > them to auxiliary code. After that I moved them both under st/omx. Since > there could be a chance of it being useful out of st/omx, I left the > decision to keep it or move it back to st/omx > to the mailing list. > > > Fine with me. > > Leo any more comments on this? Otherwise I'm going to give it a few more > days on the list and push it if nobody objects. > > I just had a quick look, it's pretty good to me as well. > > @Gurkirpal, do we still need some changes from Tizonia in order to get it > built/run? > > Leo > > > > Regards, > Christian. > > >> And the EGL image stuff really works? Well that is extremely cool. >> > I double checked the EGL feature with "top" and it shows significantly > less CPU usage compared to when not using this feature. > Thanks to Julien for helping out a lot with this one when he was mentoring > me. > >> >> Regards, >> Christian. >> >> ___ >>> mesa-dev mailing list >>> mesa-dev@lists.freedesktop.org >>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev >>> >> >> > > > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 7/7] st/omx/tizonia/h264d: Add EGLImage support
Example Gstreamer pipeline : MESA_ENABLE_OMX_EGLIMAGE=1 GST_GL_API=gles2 GST_GL_PLATFORM=egl gst-launch-1.0 filesrc location=movie.mp4 ! qtdemux ! h264parse ! omxh264dec ! glimagesink --- src/gallium/state_trackers/omx/Makefile.am | 1 + src/gallium/state_trackers/omx/tizonia/Makefile.am | 13 +++ .../state_trackers/omx/tizonia/entrypoint.c| 44 src/gallium/state_trackers/omx/tizonia/h264dprc.c | 116 - src/gallium/state_trackers/omx/vid_dec_common.c| 38 +++ src/gallium/state_trackers/omx/vid_dec_common.h| 3 + 6 files changed, 211 insertions(+), 4 deletions(-) diff --git a/src/gallium/state_trackers/omx/Makefile.am b/src/gallium/state_trackers/omx/Makefile.am index de6eb64..fbde8e0 100644 --- a/src/gallium/state_trackers/omx/Makefile.am +++ b/src/gallium/state_trackers/omx/Makefile.am @@ -37,6 +37,7 @@ SUBDIRS = tizonia AM_CFLAGS = \ $(GALLIUM_CFLAGS) \ + $(LIBDRM_CFLAGS) \ $(VISIBILITY_CFLAGS) \ $(VL_CFLAGS) \ $(XCB_DRI3_CFLAGS) \ diff --git a/src/gallium/state_trackers/omx/tizonia/Makefile.am b/src/gallium/state_trackers/omx/tizonia/Makefile.am index 0f72e39..3149afa 100644 --- a/src/gallium/state_trackers/omx/tizonia/Makefile.am +++ b/src/gallium/state_trackers/omx/tizonia/Makefile.am @@ -22,8 +22,21 @@ include Makefile.sources include $(top_srcdir)/src/gallium/Automake.inc AM_CFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/src/mapi \ + -I$(top_srcdir)/src/mesa \ + -I$(top_builddir)/src/mesa/drivers/dri/common \ + -I$(top_srcdir)/src/mesa/drivers/dri/common \ + -I$(top_srcdir)/src/egl/drivers/dri2 \ + -I$(top_srcdir)/src/egl/wayland/wayland-egl \ + -I$(top_srcdir)/src/egl/main \ + -I$(top_srcdir)/src/gbm/main \ + -I$(top_srcdir)/src/loader \ + -I$(top_srcdir)/src/gbm/backends/dri \ + -I$(top_srcdir)/src/gallium/state_trackers/dri \ -I$(top_srcdir)/src/gallium/state_trackers/omx \ $(GALLIUM_CFLAGS) \ + $(LIBDRM_CFLAGS) \ $(VISIBILITY_CFLAGS) \ $(VL_CFLAGS) \ $(XCB_DRI3_CFLAGS) \ diff --git a/src/gallium/state_trackers/omx/tizonia/entrypoint.c b/src/gallium/state_trackers/omx/tizonia/entrypoint.c index 72d955b..b896447 100644 --- a/src/gallium/state_trackers/omx/tizonia/entrypoint.c +++ b/src/gallium/state_trackers/omx/tizonia/entrypoint.c @@ -44,6 +44,40 @@ #include "h264eoutport.h" #include "names.h" +#include "util/u_debug.h" + +DEBUG_GET_ONCE_BOOL_OPTION(mesa_enable_omx_eglimage, + "MESA_ENABLE_OMX_EGLIMAGE", + false) + +static OMX_BOOL egl_image_validation_hook(const OMX_HANDLETYPE ap_hdl, + OMX_U32 pid, OMX_PTR ap_eglimage, + void *ap_args) +{ + const void * p_krn = NULL; + const tiz_port_t * p_port = NULL; + + assert(ap_hdl); + assert(ap_eglimage); + assert(!ap_args); + + if (!debug_get_option_mesa_enable_omx_eglimage()) { + return OMX_FALSE; + } + + p_krn = tiz_get_krn(ap_hdl); + p_port = tiz_krn_get_port(p_krn, pid); + + const OMX_VIDEO_PORTDEFINITIONTYPE * p_video_portdef + = &(p_port->portdef_.format.video); + + if (!p_video_portdef->pNativeWindow) { + return OMX_FALSE; + } + + return OMX_TRUE; +} + OMX_ERRORTYPE OMX_ComponentInit (OMX_HANDLETYPE ap_hdl) { tiz_role_factory_t h264d_role; @@ -57,6 +91,11 @@ OMX_ERRORTYPE OMX_ComponentInit (OMX_HANDLETYPE ap_hdl) const tiz_type_factory_t * tf_list[] = {_inport_type, _outport_type, _type, _type, _inport_type}; + const tiz_eglimage_hook_t egl_validation_hook = { + OMX_VID_DEC_AVC_OUTPUT_PORT_INDEX, + egl_image_validation_hook, + NULL + }; /* Settings for roles */ strcpy ((OMX_STRING) h264d_role.role, OMX_VID_DEC_AVC_ROLE); @@ -108,5 +147,10 @@ OMX_ERRORTYPE OMX_ComponentInit (OMX_HANDLETYPE ap_hdl) /* Register the component roles */ tiz_comp_register_roles (ap_hdl, rf_list, 2); + /* Register egl image validation hook for the decoder */ + tiz_check_omx (tiz_comp_register_role_eglimage_hook + (ap_hdl, (const OMX_U8 *) OMX_VID_DEC_AVC_ROLE, + _validation_hook)); + return OMX_ErrorNone; } diff --git a/src/gallium/state_trackers/omx/tizonia/h264dprc.c b/src/gallium/state_trackers/omx/tizonia/h264dprc.c index 612c9f5..5544f51 100644 --- a/src/gallium/state_trackers/omx/tizonia/h264dprc.c +++ b/src/gallium/state_trackers/omx/tizonia/h264dprc.c @@ -37,11 +37,34 @@ #include "vl/vl_video_buffer.h" #include "vl/vl_compositor.h" +#include "util/u_hash_table.h" #include "util/u_surface.h" #include "vl/vl_screen.h" +#include "dri_screen.h" +#include "egl_dri2.h" + unsigned dec_frame_delta; +#define PTR_TO_UINT(x) ((unsigned)((intptr_t)(x))) + +static
[Mesa-dev] [PATCH 6/7] st/omx/tizonia: Add H.264 encoder
Example Gstreamer pipeline : gst-launch-1.0 filesrc location=movie.mp4 ! qtdemux ! h264parse ! avdec_h264 ! videoconvert ! omxh264enc ! h264parse ! avdec_h264 ! videoconvert ! ximagesink --- src/gallium/state_trackers/omx/Makefile.sources| 4 +- src/gallium/state_trackers/omx/bellagio/vid_enc.c | 356 +-- src/gallium/state_trackers/omx/bellagio/vid_enc.h | 48 -- .../state_trackers/omx/tizonia/Makefile.sources| 11 + .../state_trackers/omx/tizonia/entrypoint.c| 40 +- src/gallium/state_trackers/omx/tizonia/h264e.c | 184 ++ src/gallium/state_trackers/omx/tizonia/h264e.h | 55 ++ .../state_trackers/omx/tizonia/h264einport.c | 216 +++ .../state_trackers/omx/tizonia/h264einport.h | 31 + .../state_trackers/omx/tizonia/h264einport_decls.h | 48 ++ .../state_trackers/omx/tizonia/h264eoutport.c | 143 + .../state_trackers/omx/tizonia/h264eoutport.h | 31 + .../omx/tizonia/h264eoutport_decls.h | 48 ++ src/gallium/state_trackers/omx/tizonia/h264eprc.c | 689 + src/gallium/state_trackers/omx/tizonia/h264eprc.h | 31 + src/gallium/state_trackers/omx/vid_enc_common.c| 387 src/gallium/state_trackers/omx/vid_enc_common.h| 175 ++ 17 files changed, 2095 insertions(+), 402 deletions(-) create mode 100644 src/gallium/state_trackers/omx/tizonia/h264e.c create mode 100644 src/gallium/state_trackers/omx/tizonia/h264e.h create mode 100644 src/gallium/state_trackers/omx/tizonia/h264einport.c create mode 100644 src/gallium/state_trackers/omx/tizonia/h264einport.h create mode 100644 src/gallium/state_trackers/omx/tizonia/h264einport_decls.h create mode 100644 src/gallium/state_trackers/omx/tizonia/h264eoutport.c create mode 100644 src/gallium/state_trackers/omx/tizonia/h264eoutport.h create mode 100644 src/gallium/state_trackers/omx/tizonia/h264eoutport_decls.h create mode 100644 src/gallium/state_trackers/omx/tizonia/h264eprc.c create mode 100644 src/gallium/state_trackers/omx/tizonia/h264eprc.h create mode 100644 src/gallium/state_trackers/omx/vid_enc_common.c create mode 100644 src/gallium/state_trackers/omx/vid_enc_common.h diff --git a/src/gallium/state_trackers/omx/Makefile.sources b/src/gallium/state_trackers/omx/Makefile.sources index d69d7c6..95bccdd 100644 --- a/src/gallium/state_trackers/omx/Makefile.sources +++ b/src/gallium/state_trackers/omx/Makefile.sources @@ -2,4 +2,6 @@ C_SOURCES := \ vid_dec_common.c \ vid_dec_common.h \ vid_dec_h264_common.c \ - vid_dec_h264_common.h + vid_dec_h264_common.h \ + vid_enc_common.c \ + vid_enc_common.h diff --git a/src/gallium/state_trackers/omx/bellagio/vid_enc.c b/src/gallium/state_trackers/omx/bellagio/vid_enc.c index 40e7a0f..6adb1bb 100644 --- a/src/gallium/state_trackers/omx/bellagio/vid_enc.c +++ b/src/gallium/state_trackers/omx/bellagio/vid_enc.c @@ -49,32 +49,11 @@ #include "pipe/p_screen.h" #include "pipe/p_video_codec.h" #include "util/u_memory.h" -#include "vl/vl_video_buffer.h" #include "vl/vl_screen.h" #include "entrypoint.h" #include "vid_enc.h" - -struct encode_task { - struct list_head list; - - struct pipe_video_buffer *buf; - unsigned pic_order_cnt; - struct pipe_resource *bitstream; - void *feedback; -}; - -struct input_buf_private { - struct list_head tasks; - - struct pipe_resource *resource; - struct pipe_transfer *transfer; -}; - -struct output_buf_private { - struct pipe_resource *bitstream; - struct pipe_transfer *transfer; -}; +#include "vid_enc_common.h" static OMX_ERRORTYPE vid_enc_Constructor(OMX_COMPONENTTYPE *comp, OMX_STRING name); static OMX_ERRORTYPE vid_enc_Destructor(OMX_COMPONENTTYPE *comp); @@ -94,8 +73,6 @@ static OMX_ERRORTYPE vid_enc_AllocateOutBuffer(omx_base_PortType *comp, OMX_INOU static OMX_ERRORTYPE vid_enc_FreeOutBuffer(omx_base_PortType *port, OMX_U32 idx, OMX_BUFFERHEADERTYPE *buf); static void vid_enc_BufferEncoded(OMX_COMPONENTTYPE *comp, OMX_BUFFERHEADERTYPE* input, OMX_BUFFERHEADERTYPE* output); -static void enc_ReleaseTasks(struct list_head *head); - OMX_ERRORTYPE vid_enc_LoaderComponent(stLoaderComponentType *comp) { comp->componentVersion.s.nVersionMajor = 0; @@ -616,66 +593,6 @@ static OMX_ERRORTYPE vid_enc_GetConfig(OMX_HANDLETYPE handle, OMX_INDEXTYPE idx, return OMX_ErrorNone; } -static enum pipe_video_profile enc_TranslateOMXProfileToPipe(unsigned omx_profile) -{ - switch (omx_profile) { - case OMX_VIDEO_AVCProfileBaseline: - return PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE; - case OMX_VIDEO_AVCProfileMain: - return PIPE_VIDEO_PROFILE_MPEG4_AVC_MAIN; - case OMX_VIDEO_AVCProfileExtended: - return PIPE_VIDEO_PROFILE_MPEG4_AVC_EXTENDED; - case OMX_VIDEO_AVCProfileHigh: - return PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH; - case OMX_VIDEO_AVCProfileHigh10: - return PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH10; - case OMX_VIDEO_AVCProfileHigh422:
[Mesa-dev] [PATCH 4/7] st/omx/tizonia: Add entrypoint
Adds base files for adding components --- .../state_trackers/omx/tizonia/Makefile.sources| 4 ++- .../state_trackers/omx/tizonia/entrypoint.c| 37 ++ .../state_trackers/omx/tizonia/entrypoint.h| 35 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 src/gallium/state_trackers/omx/tizonia/entrypoint.c create mode 100644 src/gallium/state_trackers/omx/tizonia/entrypoint.h diff --git a/src/gallium/state_trackers/omx/tizonia/Makefile.sources b/src/gallium/state_trackers/omx/tizonia/Makefile.sources index 9103ca8..de6fcf9 100644 --- a/src/gallium/state_trackers/omx/tizonia/Makefile.sources +++ b/src/gallium/state_trackers/omx/tizonia/Makefile.sources @@ -1 +1,3 @@ -C_SOURCES := +C_SOURCES := \ + entrypoint.c \ + entrypoint.h diff --git a/src/gallium/state_trackers/omx/tizonia/entrypoint.c b/src/gallium/state_trackers/omx/tizonia/entrypoint.c new file mode 100644 index 000..c89bdfd --- /dev/null +++ b/src/gallium/state_trackers/omx/tizonia/entrypoint.c @@ -0,0 +1,37 @@ +/** + * + * Copyright 2013 Advanced Micro Devices, Inc. + * All Rights Reserved. + * + * 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, sub license, 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 +#include +#include + +#include "entrypoint.h" + +OMX_ERRORTYPE OMX_ComponentInit (OMX_HANDLETYPE ap_hdl) +{ + return OMX_ErrorNone; +} diff --git a/src/gallium/state_trackers/omx/tizonia/entrypoint.h b/src/gallium/state_trackers/omx/tizonia/entrypoint.h new file mode 100644 index 000..740a89d --- /dev/null +++ b/src/gallium/state_trackers/omx/tizonia/entrypoint.h @@ -0,0 +1,35 @@ +/** + * + * Copyright 2013 Advanced Micro Devices, Inc. + * All Rights Reserved. + * + * 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, sub license, 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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. + * + **/ + +#ifndef OMX_TIZ_ENTRYPOINT_H +#define OMX_TIZ_ENTRYPOINT_H + +#include "vl/vl_winsys.h" + +PUBLIC OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE ap_hdl); + +#endif -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/7] st/omx/tizonia: Add --enable-omx-tizonia flag and build files
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. GSoC Project link: https://summerofcode.withgoogle.com/projects/#4737166321123328 --- configure.ac | 46 +- src/gallium/Makefile.am| 4 ++ src/gallium/state_trackers/omx/Makefile.am | 13 ++ src/gallium/state_trackers/omx/tizonia/Makefile.am | 36 + .../state_trackers/omx/tizonia/Makefile.sources| 1 + src/gallium/targets/omx/Makefile.am| 19 - src/gallium/targets/omx/omx.sym| 1 + 7 files changed, 116 insertions(+), 4 deletions(-) create mode 100644 src/gallium/state_trackers/omx/tizonia/Makefile.am create mode 100644 src/gallium/state_trackers/omx/tizonia/Makefile.sources diff --git a/configure.ac b/configure.ac index ee55363..68cea46 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.9.0 LIBVA_REQUIRED=0.38.0 VDPAU_REQUIRED=1.1 WAYLAND_REQUIRED=1.11 @@ -1293,14 +1294,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@:>@])], @@ -1352,11 +1358,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 @@ -2197,6 +2209,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 @@ -2206,6 +,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 @@ -2214,6 +2231,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]) @@ -2247,9 +2265,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
[Mesa-dev] [PATCH 1/7] gallium: Refactor out vl_put_screen and vl_get_screen
--- src/gallium/auxiliary/Makefile.sources | 2 + src/gallium/auxiliary/vl/vl_screen.c | 107 + src/gallium/auxiliary/vl/vl_screen.h | 33 +++ .../state_trackers/omx_bellagio/entrypoint.c | 83 .../state_trackers/omx_bellagio/entrypoint.h | 3 - src/gallium/state_trackers/omx_bellagio/vid_dec.c | 5 +- src/gallium/state_trackers/omx_bellagio/vid_enc.c | 5 +- 7 files changed, 148 insertions(+), 90 deletions(-) create mode 100644 src/gallium/auxiliary/vl/vl_screen.c create mode 100644 src/gallium/auxiliary/vl/vl_screen.h diff --git a/src/gallium/auxiliary/Makefile.sources b/src/gallium/auxiliary/Makefile.sources index f40c472..35e89f9 100644 --- a/src/gallium/auxiliary/Makefile.sources +++ b/src/gallium/auxiliary/Makefile.sources @@ -343,6 +343,8 @@ VL_SOURCES := \ vl/vl_mpeg12_decoder.c \ vl/vl_mpeg12_decoder.h \ vl/vl_rbsp.h \ + vl/vl_screen.c \ + vl/vl_screen.h \ vl/vl_types.h \ vl/vl_vertex_buffers.c \ vl/vl_vertex_buffers.h \ diff --git a/src/gallium/auxiliary/vl/vl_screen.c b/src/gallium/auxiliary/vl/vl_screen.c new file mode 100644 index 000..7192802 --- /dev/null +++ b/src/gallium/auxiliary/vl/vl_screen.c @@ -0,0 +1,107 @@ +/** + * + * 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, sub license, 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS 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 +#include +#include + +#include "os/os_thread.h" +#include "util/u_memory.h" +#include "loader/loader.h" +#include "vl_screen.h" + +#if defined(HAVE_X11_PLATFORM) +#include +#else +#define XOpenDisplay(x) NULL +#define XCloseDisplay(x) +#define Display void +#endif + +static mtx_t st_lock = _MTX_INITIALIZER_NP; +static Display *st_display = NULL; +static struct vl_screen *st_screen = NULL; +static unsigned st_usecount = 0; +static const char *st_render_node = NULL; +static int drm_fd; + +struct vl_screen *vl_get_screen(const char* render_node) +{ + static bool first_time = true; + mtx_lock(_lock); + + if (!st_screen) { + if (first_time) { + st_render_node = debug_get_option(render_node, NULL); + first_time = false; + } + if (st_render_node) { + drm_fd = loader_open_device(st_render_node); + if (drm_fd < 0) +goto error; + + st_screen = vl_drm_screen_create(drm_fd); + if (!st_screen) { +close(drm_fd); +goto error; + } + } else { + st_display = XOpenDisplay(NULL); + if (!st_display) +goto error; + + st_screen = vl_dri3_screen_create(st_display, 0); + if (!st_screen) +st_screen = vl_dri2_screen_create(st_display, 0); + if (!st_screen) { +XCloseDisplay(st_display); +goto error; + } + } + } + + ++st_usecount; + + mtx_unlock(_lock); + return st_screen; + +error: + mtx_unlock(_lock); + return NULL; +} + +void vl_put_screen(void) +{ + mtx_lock(_lock); + if ((--st_usecount) == 0) { + st_screen->destroy(st_screen); + st_screen = NULL; + + if (st_render_node) + close(drm_fd); + else + XCloseDisplay(st_display); + } + mtx_unlock(_lock); +} diff --git a/src/gallium/auxiliary/vl/vl_screen.h b/src/gallium/auxiliary/vl/vl_screen.h new file mode 100644 index 000..1e14775 --- /dev/null +++ b/src/gallium/auxiliary/vl/vl_screen.h @@ -0,0 +1,33 @@ +/** + * + * 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
[Mesa-dev] Refactored st/omx/tizonia commits
These are the refactored commits related to the GSoC project involving adding a st/omx state tracker using tizonia. There are still some parts of code that i didn't refactor yet as explained below: 1) I wasn't sure if it's okay to use #if-#else declaratives for function declarations. For eg: One function accepts omx_base_PortType and the other one vid_dec_PrivateType 2) Because of the argument type differences there is excessive amounts of #if-#else pairs will be needed So I decided to wait for review before making those changes. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/2] st/omx_tizonia: add --enable-omx-tizonia flag and build files
Hi, The target tizonia is available with gst-omx on current git https://cgit.freedesktop.org/gstreamer/gst-omx/commit/?id=ae14bb362a26bb1b48f7f99c7fc2350e0fa50ffa The option --with-omx-target=tizonia should work. Cheers On Thu, Aug 17, 2017 at 4:39 AM, Andy Furniss <adf.li...@gmail.com> wrote: > Thanks, I'll try something similar. > > One more question - WRT gst-omx, what target should I build - > generic or is something else/patch needed? I don't see tizonia with > current git. > > > Gurkirpal Singh wrote: > >> Hi, >> >> It is a known issue that the player is hard to build. Juan suggested to >> remove it from the build files >> https://github.com/tizonia/tizonia-openmax-il/issues/248#iss >> uecomment-232406388 >> > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/2] st/omx_tizonia: add --enable-omx-tizonia flag and build files
Hi, It is a known issue that the player is hard to build. Juan suggested to remove it from the build files https://github.com/tizonia/tizonia-openmax-il/issues/248#issuecomment-232406388 These are the changes that I make while building tizonia for use with mesa: diff --git a/Makefile.am b/Makefile.am index 9499b8b..eef0dcd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -23,7 +23,7 @@ # it can be manually configured and built. # SUBDIRS = config include libtizplatform rm libtizcore libtizonia plugins tizonia docs -SUBDIRS = config include clients libtizplatform rm libtizcore libtizonia plugins player config +SUBDIRS = config include clients libtizplatform rm libtizcore libtizonia plugins config # NOTE: A cscope target is included in automake since api 1.12 diff --git a/configure.ac b/configure.ac index f453f0e..3df710e 100644 --- a/configure.ac +++ b/configure.ac @@ -41,6 +41,5 @@ AC_CONFIG_SUBDIRS([include libtizcore libtizonia plugins - player config]) AC_OUTPUT diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 95458a6..db4f05e 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -17,12 +17,6 @@ SUBDIRS = \ - aac_decoder \ - file_reader \ - file_writer \ - flac_decoder \ - http_renderer \ - http_source \ mp3_decoder \ mp3_encoder \ mp3_metadata \ @@ -34,7 +28,6 @@ SUBDIRS = \ pcm_decoder \ pcm_renderer_alsa \ pcm_renderer_pa \ - spotify_source \ vorbis_decoder \ vp8_decoder \ webm_demuxer \ diff --git a/plugins/configure.ac b/plugins/configure.ac index 7dc191b..7d89f75 100644 --- a/plugins/configure.ac +++ b/plugins/configure.ac @@ -49,13 +49,7 @@ PKG_CHECK_MODULES([CHECK], [check >= 0.9.4]) AC_CONFIG_FILES([Makefile]) -AC_CONFIG_SUBDIRS([aac_decoder - file_reader - file_writer - flac_decoder - http_renderer - http_source - mp3_decoder +AC_CONFIG_SUBDIRS([mp3_decoder mp3_encoder mp3_metadata mpeg_audio_decoder @@ -66,7 +60,6 @@ AC_CONFIG_SUBDIRS([aac_decoder pcm_decoder pcm_renderer_alsa pcm_renderer_pa - spotify_source vorbis_decoder vp8_decoder webm_demuxer Cheers, Gurkirpal On Thu, Aug 17, 2017 at 2:25 AM, Andy Furniss <adf.li...@gmail.com> wrote: > Christian König wrote: > >> Am 11.08.2017 um 14:32 schrieb Emil Velikov: >> >>> Hi Gurkirpal, >>> >>> Thanks for working on this. I believe Christian has some good points. >>> There's only one small question + suggestion from me. >>> >>> On 11 August 2017 at 05:31, Gurkirpal Singh <gurkirpal...@gmail.com> >>> wrote: >>> >>> +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]) >>>> >>> I cannot find any tizonia packages for Debian, Fedora or Arch - are >>> there any? >>> >> >> Well Ubuntu/Debian can be found here https://github.com/tizonia/tiz >> onia-openmax-il >> > > Is there a way/place to build/get just what is needed for mesa? > > That seems to be a player - I gave up trying to build once it got to > requiring pulseaudio. > > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2 2/4] st/omx_tizonia: Add --enable-omx-tizonia flag and build files
On Mon, Aug 14, 2017 at 10:05 PM, Leo Liu <leo@amd.com> wrote: > > > On 08/14/2017 12:25 PM, Gurkirpal Singh wrote: > > > > On Mon, Aug 14, 2017 at 8:55 PM, Leo Liu <leo@amd.com> wrote: > >> >> >> On 08/14/2017 11:19 AM, Gurkirpal Singh wrote: >> >> >> >> On Mon, Aug 14, 2017 at 8:05 PM, Leo Liu <leo@amd.com> wrote: >> >>> >>> >>> On 08/14/2017 05:46 AM, Julien Isorce wrote: >>> >>> Hi Leo, >>> >>> >It would be better if you can extract the common code between bellagio >>> and tizonia to avoid the duplication. >>> >>> This is something Gurkirpal and me discussed, like having >>> state_trackers/omx/common, state_trackers/omx/bellagio, >>> state_trackers/omx/tizonia. To anticipate that Gurkirpal sent an email >>> https://www.mail-archive.com/mesa-dev@lists.freedeskto >>> p.org/msg153562.html during the Community Bonding period in May (a few >>> weeks from the date (early May) students are officially accepted to the >>> date (end May) where student actually starts working) >>> >>> The problem with the directory layout above is that it would look like >>> it will be built together in the same shared library. This is not good >>> because it is suppose to export OMX_ComponentInit for each target. Of >>> course this would still be possible to have 2 shared libs but I believe in >>> state_trackers dir, all sub dir are for one target. Also we were afraid >>> that there would be other limitations so we decided to go for a separate >>> directory. >>> And since there were no objections in Gurkirpal's mail above we went >>> this way. >>> >>> Now if I look into state_trackers/omx_tizonia, in fact the common code >>> with state_trackers/omx_bellagio does not have anything to do with omx. For >>> example "slice_header". Maybe it can be moved to gallium/auxiliary/vl/ like >>> it is done already for vl_rbsp_init. Same for omx_get_screen. >>> >>> So I suggest this 'factorization' to be not a blocker for merging >>> state_trackers/omx_tizonia into usptream. But later on we can move >>> gradually bits from state_trackers/omx_bellagio to gallium/auxiliary. And >>> then make state_trackers/omx_tizonia use it as well. >>> This way you will only bother about maintaining >>> state_trackers/omx_bellagio the time being. This also allows to not slowly >>> get its work lost. >>> >>> Of course we would have done differently if we knew advance. But as >>> today Gurkirpal won't have enough time to do this factorization/move as the >>> project ends in 1 week. Having all of this merged in upstream is not >>> mandatory to succeed the project but Gurkirpal will need some rest after >>> these 3 months of hard work. And who knows what happens after, whether he >>> will still be around after sometimes or not. And this is entirely up to him. >>> >>> So again I suggest this factorization/move not to be a blocker for the >>> reasons above. What do you think? >>> >>> >>> When the whole project will be completed, as least same status as >>> bellagio? Is there anyone keep working on this project after this step 1? >>> >> Hi, I plan on continuing working on this after the GSoC project ends. >> >> >> Is the GSoC project done with your current patches? >> >> Apart from these patches, at least two more will be needed for the > project. One for adding H.264 enc and other for adding EGLImage support to > H.264 dec. > Since I keep revising the commits quite frequently I'll give the link to > the branch https://github.com/gpalsingh/mesa/commits/gsoc > > Good to see them, then why did you send them to review as well? not > working well or other reason? > Indeed they still got a little bit of work. For instance the enc fails at EOS https://github.com/gpalsingh/mesa/issues/4 and using EGLImage shows wrong colours https://github.com/gpalsingh/mesa/issues/6 Also Julien suggested that we make it step by step i.e. Fix decoder and then get it reviewed and then same steps for enc and EGLImage. > And why don't you include mpeg2 and hevc to your project, and then after > performance test, it could be replacing bellagio completely. > The major aim of this project was to add EGLImage support. Except the two components adding other components was optional from the start. Also hasn't been as straightforward as expected. Significant amount of time was spent on making gst-omx OMX IL 1.2 conformant.
Re: [Mesa-dev] [PATCH v2 2/4] st/omx_tizonia: Add --enable-omx-tizonia flag and build files
On Mon, Aug 14, 2017 at 8:55 PM, Leo Liu <leo@amd.com> wrote: > > > On 08/14/2017 11:19 AM, Gurkirpal Singh wrote: > > > > On Mon, Aug 14, 2017 at 8:05 PM, Leo Liu <leo@amd.com> wrote: > >> >> >> On 08/14/2017 05:46 AM, Julien Isorce wrote: >> >> Hi Leo, >> >> >It would be better if you can extract the common code between bellagio >> and tizonia to avoid the duplication. >> >> This is something Gurkirpal and me discussed, like having >> state_trackers/omx/common, state_trackers/omx/bellagio, >> state_trackers/omx/tizonia. To anticipate that Gurkirpal sent an email >> https://www.mail-archive.com/mesa-dev@lists.freedeskto >> p.org/msg153562.html during the Community Bonding period in May (a few >> weeks from the date (early May) students are officially accepted to the >> date (end May) where student actually starts working) >> >> The problem with the directory layout above is that it would look like it >> will be built together in the same shared library. This is not good because >> it is suppose to export OMX_ComponentInit for each target. Of course this >> would still be possible to have 2 shared libs but I believe in >> state_trackers dir, all sub dir are for one target. Also we were afraid >> that there would be other limitations so we decided to go for a separate >> directory. >> And since there were no objections in Gurkirpal's mail above we went this >> way. >> >> Now if I look into state_trackers/omx_tizonia, in fact the common code >> with state_trackers/omx_bellagio does not have anything to do with omx. For >> example "slice_header". Maybe it can be moved to gallium/auxiliary/vl/ like >> it is done already for vl_rbsp_init. Same for omx_get_screen. >> >> So I suggest this 'factorization' to be not a blocker for merging >> state_trackers/omx_tizonia into usptream. But later on we can move >> gradually bits from state_trackers/omx_bellagio to gallium/auxiliary. And >> then make state_trackers/omx_tizonia use it as well. >> This way you will only bother about maintaining >> state_trackers/omx_bellagio the time being. This also allows to not slowly >> get its work lost. >> >> Of course we would have done differently if we knew advance. But as today >> Gurkirpal won't have enough time to do this factorization/move as the >> project ends in 1 week. Having all of this merged in upstream is not >> mandatory to succeed the project but Gurkirpal will need some rest after >> these 3 months of hard work. And who knows what happens after, whether he >> will still be around after sometimes or not. And this is entirely up to him. >> >> So again I suggest this factorization/move not to be a blocker for the >> reasons above. What do you think? >> >> >> When the whole project will be completed, as least same status as >> bellagio? Is there anyone keep working on this project after this step 1? >> > Hi, I plan on continuing working on this after the GSoC project ends. > > > Is the GSoC project done with your current patches? > > Apart from these patches, at least two more will be needed for the project. One for adding H.264 enc and other for adding EGLImage support to H.264 dec. Since I keep revising the commits quite frequently I'll give the link to the branch https://github.com/gpalsingh/mesa/commits/gsoc Cheers > > Regards, > Leo > > > >> The left stuff compared to bellagio are codecs of mpeg2 and hevc, and >> encoding that is more important, since the most usage for omx currently is >> to use transcoding from one codec to another. >> >> Other is the transcoding performance, at least meet the performance of >> bellagio's. >> >> If the above could be addressed at early time, we could remove Bellagio >> completely, then there is no need to do any refactor now. >> > The original plan was this but making gst-omx OMX IL 1.2 compatible has > been a bit time consuming. > >> >> >> BTW what's the plan for new feature like EGL Images? >> > We've been able to make it work but with wrong colours in output. I've > written more about it and the performance comparison in my blog post here > https://singhcodes.wordpress.com/2017/08/04/gsoc-2017-third-phase-starts/ > But recently the EGLImage hook stopped working and I've opened the issue > https://github.com/gpalsingh/mesa/issues/15 to keep track of it. > This happened after we fixed another issue which made changes to gst-omx > which might be the cause https://github.com/gpalsingh/mesa/issues/2# > issuecomment-321839195 > I'm still looking
Re: [Mesa-dev] [PATCH v2 2/4] st/omx_tizonia: Add --enable-omx-tizonia flag and build files
On Sun, Aug 13, 2017 at 8:47 AM, Leo Liu <leo@amd.com> wrote: > Where is the patch 1? Sorry for the patches got messed up somehow while sending, I could only see two patches on mail-archive but three on patchwork. Tried two times and same result. About the first one I got a mail saying that it was too large has been put aside for mod approval. The changes I made were to just rename the st/omx directory to st/omx_bellagio (the reason it became large) and renaming bits in the configure.ac and Makefiles. > > > > On 08/12/2017 12:07 PM, Gurkirpal Singh wrote: > >> 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. >> >> v2: Show error message when --enable-omx is used (Christian) >> Use single PKG_CHECK_MODULES for omx_tizonia checks (Emil) >> Use spaces instead of tabs >> Add checks around omx-tizonia >> >> GSoC Project link: https://summerofcode.withgoogl >> e.com/projects/#4737166321123328 >> >> Signed-off-by: Gurkirpal Singh <gurkirpal...@gmail.com> >> Reviewed-and-Tested-by: Julien Isorce <julien.iso...@gmail.com> >> --- >> configure.ac| 40 ++- >> 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, 132 insertions(+), 2 deletions(-) >> 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 38af96a..5669695 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.9.0 >> LIBVA_REQUIRED=0.38.0 >> VDPAU_REQUIRED=1.1 >> WAYLAND_REQUIRED=1.11 >> @@ -1216,14 +1217,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.])], >> > > Is this in patch 1? Yes, it is so. > > > + [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@:>@])], >> @@ -1275,6 +1281,7 @@ 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]) >> @@ -2121,6 +2128,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 >
[Mesa-dev] [PATCH v2 3/4] st/omx_tizonia: Add entrypoint
Adds common structure for adding components and screen creation v2: Separate commits for entrypoint and decoder (Christian) Preserve copyright for copied files (Emil) Signed-off-by: Gurkirpal Singh <gurkirpal...@gmail.com> Reviewed-and-Tested-by: Julien Isorce <julien.iso...@gmail.com> --- src/gallium/state_trackers/omx_tizonia/Makefile.am | 35 ++ .../state_trackers/omx_tizonia/Makefile.sources| 3 + .../state_trackers/omx_tizonia/entrypoint.c| 120 + .../state_trackers/omx_tizonia/entrypoint.h| 38 +++ 4 files changed, 196 insertions(+) create mode 100644 src/gallium/state_trackers/omx_tizonia/Makefile.am create mode 100644 src/gallium/state_trackers/omx_tizonia/Makefile.sources create mode 100644 src/gallium/state_trackers/omx_tizonia/entrypoint.c create mode 100644 src/gallium/state_trackers/omx_tizonia/entrypoint.h diff --git a/src/gallium/state_trackers/omx_tizonia/Makefile.am b/src/gallium/state_trackers/omx_tizonia/Makefile.am new file mode 100644 index 000..932929b --- /dev/null +++ b/src/gallium/state_trackers/omx_tizonia/Makefile.am @@ -0,0 +1,35 @@ +# 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 = \ + $(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 index 000..de6fcf9 --- /dev/null +++ b/src/gallium/state_trackers/omx_tizonia/Makefile.sources @@ -0,0 +1,3 @@ +C_SOURCES := \ + entrypoint.c \ + entrypoint.h diff --git a/src/gallium/state_trackers/omx_tizonia/entrypoint.c b/src/gallium/state_trackers/omx_tizonia/entrypoint.c new file mode 100644 index 000..8a38707 --- /dev/null +++ b/src/gallium/state_trackers/omx_tizonia/entrypoint.c @@ -0,0 +1,120 @@ +/** + * + * Copyright 2013 Advanced Micro Devices, Inc. + * All Rights Reserved. + * + * 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, sub license, 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 +#include +#include + +#include +#include +#include + +#include "os/os_thread.h" +#include "util/u_memory.h" +#include "loader/loader.h" + +#include "entrypoint.h" + +#if defined(HAVE_X11_PLATFORM) +#include +#else +#define XOpenDisplay(x) NULL +#define XCloseDisplay(x) +
[Mesa-dev] [PATCH v2 0/4] gallium/st: Add Tizonia based state tracker
Sending patches in separate thread since I can't see some patches in reply to the original thread. Gurkirpal Singh (4): st/omx_bellagio: Rename state tracker and option st/omx_tizonia: Add --enable-omx-tizonia flag and build files st/omx_tizonia: Add entrypoint st/omx_tizonia: Add H.264 decoder configure.ac | 85 +- src/gallium/Makefile.am|8 +- src/gallium/state_trackers/omx/Makefile.am | 35 - src/gallium/state_trackers/omx/Makefile.sources| 10 - src/gallium/state_trackers/omx/entrypoint.c| 152 -- src/gallium/state_trackers/omx/entrypoint.h| 48 - src/gallium/state_trackers/omx/vid_dec.c | 665 src/gallium/state_trackers/omx/vid_dec.h | 148 -- src/gallium/state_trackers/omx/vid_dec_h264.c | 1032 src/gallium/state_trackers/omx/vid_dec_h265.c | 1013 src/gallium/state_trackers/omx/vid_dec_mpeg12.c| 383 - src/gallium/state_trackers/omx/vid_enc.c | 1278 --- src/gallium/state_trackers/omx/vid_enc.h | 96 -- .../state_trackers/omx_bellagio/Makefile.am| 35 + .../state_trackers/omx_bellagio/Makefile.sources | 10 + .../state_trackers/omx_bellagio/entrypoint.c | 152 ++ .../state_trackers/omx_bellagio/entrypoint.h | 48 + src/gallium/state_trackers/omx_bellagio/vid_dec.c | 665 src/gallium/state_trackers/omx_bellagio/vid_dec.h | 148 ++ .../state_trackers/omx_bellagio/vid_dec_h264.c | 1032 .../state_trackers/omx_bellagio/vid_dec_h265.c | 1013 .../state_trackers/omx_bellagio/vid_dec_mpeg12.c | 383 + src/gallium/state_trackers/omx_bellagio/vid_enc.c | 1278 +++ src/gallium/state_trackers/omx_bellagio/vid_enc.h | 96 ++ src/gallium/state_trackers/omx_tizonia/Makefile.am | 35 + .../state_trackers/omx_tizonia/Makefile.sources| 12 + .../state_trackers/omx_tizonia/entrypoint.c| 162 ++ .../state_trackers/omx_tizonia/entrypoint.h| 38 + src/gallium/state_trackers/omx_tizonia/h264d.c | 173 ++ src/gallium/state_trackers/omx_tizonia/h264d.h | 57 + .../state_trackers/omx_tizonia/h264dinport.c | 147 ++ .../state_trackers/omx_tizonia/h264dinport.h | 31 + .../state_trackers/omx_tizonia/h264dinport_decls.h | 48 + src/gallium/state_trackers/omx_tizonia/h264dprc.c | 1711 src/gallium/state_trackers/omx_tizonia/h264dprc.h | 31 + .../state_trackers/omx_tizonia/h264dprc_decls.h| 110 ++ src/gallium/state_trackers/omx_tizonia/names.h | 30 + src/gallium/targets/omx-bellagio/Makefile.am | 75 + src/gallium/targets/omx-bellagio/omx.sym | 11 + src/gallium/targets/omx-bellagio/target.c |2 + src/gallium/targets/omx-tizonia/Makefile.am| 77 + src/gallium/targets/omx-tizonia/omx.sym| 11 + src/gallium/targets/omx-tizonia/target.c |2 + src/gallium/targets/omx/Makefile.am| 75 - src/gallium/targets/omx/omx.sym| 11 - src/gallium/targets/omx/target.c |2 - 46 files changed, 7692 insertions(+), 4972 deletions(-) delete mode 100644 src/gallium/state_trackers/omx/Makefile.am delete mode 100644 src/gallium/state_trackers/omx/Makefile.sources delete mode 100644 src/gallium/state_trackers/omx/entrypoint.c delete mode 100644 src/gallium/state_trackers/omx/entrypoint.h delete mode 100644 src/gallium/state_trackers/omx/vid_dec.c delete mode 100644 src/gallium/state_trackers/omx/vid_dec.h delete mode 100644 src/gallium/state_trackers/omx/vid_dec_h264.c delete mode 100644 src/gallium/state_trackers/omx/vid_dec_h265.c delete mode 100644 src/gallium/state_trackers/omx/vid_dec_mpeg12.c delete mode 100644 src/gallium/state_trackers/omx/vid_enc.c delete mode 100644 src/gallium/state_trackers/omx/vid_enc.h create mode 100644 src/gallium/state_trackers/omx_bellagio/Makefile.am create mode 100644 src/gallium/state_trackers/omx_bellagio/Makefile.sources create mode 100644 src/gallium/state_trackers/omx_bellagio/entrypoint.c create mode 100644 src/gallium/state_trackers/omx_bellagio/entrypoint.h create mode 100644 src/gallium/state_trackers/omx_bellagio/vid_dec.c create mode 100644 src/gallium/state_trackers/omx_bellagio/vid_dec.h create mode 100644 src/gallium/state_trackers/omx_bellagio/vid_dec_h264.c create mode 100644 src/gallium/state_trackers/omx_bellagio/vid_dec_h265.c create mode 100644 src/gallium/state_trackers/omx_bellagio/vid_dec_mpeg12.c create mode 100644 src/gallium/state_trackers/omx_bellagio/vid_enc.c create mode 100644 src/gallium/state_trackers/omx_bellagio/vid_enc.h create mode 100644 src/gallium/state_trackers/omx_tizonia/Makefile.am create mode 100644 src/gallium/state_trackers/omx_tizonia/Makefile.sources create mode 100644 src/gallium/state_trackers
[Mesa-dev] [PATCH v2 2/4] st/omx_tizonia: Add --enable-omx-tizonia flag and build files
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. v2: Show error message when --enable-omx is used (Christian) Use single PKG_CHECK_MODULES for omx_tizonia checks (Emil) Use spaces instead of tabs Add checks around omx-tizonia GSoC Project link: https://summerofcode.withgoogle.com/projects/#4737166321123328 Signed-off-by: Gurkirpal Singh <gurkirpal...@gmail.com> Reviewed-and-Tested-by: Julien Isorce <julien.iso...@gmail.com> --- configure.ac| 40 ++- 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, 132 insertions(+), 2 deletions(-) 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 38af96a..5669695 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.9.0 LIBVA_REQUIRED=0.38.0 VDPAU_REQUIRED=1.1 WAYLAND_REQUIRED=1.11 @@ -1216,14 +1217,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@:>@])], @@ -1275,6 +1281,7 @@ 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]) @@ -2121,6 +2128,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 @@ -2130,6 +2141,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 @@ -2138,6 +2150,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 PKG_CHECK_MODULES([VL], [x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED]) need_gallium_vl_winsys=yes @@ -2172,6 +2185,18 @@ if test "x$enable_omx_bellagio" = xyes; then 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 &g
[Mesa-dev] [PATCH v2 2/4] st/omx_tizonia: Add --enable-omx-tizonia flag and build files
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. v2: Show error message when --enable-omx is used (Christian) Use single PKG_CHECK_MODULES for omx_tizonia checks (Emil) Use spaces instead of tabs Add checks around omx-tizonia GSoC Project link: https://summerofcode.withgoogle.com/projects/#4737166321123328 Signed-off-by: Gurkirpal Singh <gurkirpal...@gmail.com> Reviewed-and-Tested-by: Julien Isorce <julien.iso...@gmail.com> --- configure.ac| 40 ++- 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, 132 insertions(+), 2 deletions(-) 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 38af96a..5669695 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.9.0 LIBVA_REQUIRED=0.38.0 VDPAU_REQUIRED=1.1 WAYLAND_REQUIRED=1.11 @@ -1216,14 +1217,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@:>@])], @@ -1275,6 +1281,7 @@ 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]) @@ -2121,6 +2128,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 @@ -2130,6 +2141,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 @@ -2138,6 +2150,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 PKG_CHECK_MODULES([VL], [x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED]) need_gallium_vl_winsys=yes @@ -2172,6 +2185,18 @@ if test "x$enable_omx_bellagio" = xyes; then 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 &g
[Mesa-dev] [PATCH v2 3/4] st/omx_tizonia: Add entrypoint
Adds common structure for adding components and screen creation v2: Separate commits for entrypoint and decoder (Christian) Preserve copyright for copied files (Emil) Signed-off-by: Gurkirpal Singh <gurkirpal...@gmail.com> Reviewed-and-Tested-by: Julien Isorce <julien.iso...@gmail.com> --- src/gallium/state_trackers/omx_tizonia/Makefile.am | 35 ++ .../state_trackers/omx_tizonia/Makefile.sources| 3 + .../state_trackers/omx_tizonia/entrypoint.c| 120 + .../state_trackers/omx_tizonia/entrypoint.h| 38 +++ 4 files changed, 196 insertions(+) create mode 100644 src/gallium/state_trackers/omx_tizonia/Makefile.am create mode 100644 src/gallium/state_trackers/omx_tizonia/Makefile.sources create mode 100644 src/gallium/state_trackers/omx_tizonia/entrypoint.c create mode 100644 src/gallium/state_trackers/omx_tizonia/entrypoint.h diff --git a/src/gallium/state_trackers/omx_tizonia/Makefile.am b/src/gallium/state_trackers/omx_tizonia/Makefile.am new file mode 100644 index 000..932929b --- /dev/null +++ b/src/gallium/state_trackers/omx_tizonia/Makefile.am @@ -0,0 +1,35 @@ +# 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 = \ + $(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 index 000..de6fcf9 --- /dev/null +++ b/src/gallium/state_trackers/omx_tizonia/Makefile.sources @@ -0,0 +1,3 @@ +C_SOURCES := \ + entrypoint.c \ + entrypoint.h diff --git a/src/gallium/state_trackers/omx_tizonia/entrypoint.c b/src/gallium/state_trackers/omx_tizonia/entrypoint.c new file mode 100644 index 000..8a38707 --- /dev/null +++ b/src/gallium/state_trackers/omx_tizonia/entrypoint.c @@ -0,0 +1,120 @@ +/** + * + * Copyright 2013 Advanced Micro Devices, Inc. + * All Rights Reserved. + * + * 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, sub license, 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 +#include +#include + +#include +#include +#include + +#include "os/os_thread.h" +#include "util/u_memory.h" +#include "loader/loader.h" + +#include "entrypoint.h" + +#if defined(HAVE_X11_PLATFORM) +#include +#else +#define XOpenDisplay(x) NULL +#define XCloseDisplay(x) +
[Mesa-dev] [PATCH 2/2] st/omx_tizonia: Add AVC decoder
Signed-off-by: Gurkirpal Singh <gurkirpal...@gmail.com> --- src/gallium/state_trackers/omx_tizonia/Makefile.am | 35 + .../state_trackers/omx_tizonia/Makefile.sources|9 + .../state_trackers/omx_tizonia/entrypoint.c| 152 ++ .../state_trackers/omx_tizonia/entrypoint.h| 35 + src/gallium/state_trackers/omx_tizonia/h264d.c | 173 ++ src/gallium/state_trackers/omx_tizonia/h264d.h | 54 + src/gallium/state_trackers/omx_tizonia/h264dprc.c | 1713 src/gallium/state_trackers/omx_tizonia/h264dprc.h | 31 + .../state_trackers/omx_tizonia/h264dprc_decls.h| 108 ++ src/gallium/state_trackers/omx_tizonia/names.h | 30 + 10 files changed, 2340 insertions(+) create mode 100644 src/gallium/state_trackers/omx_tizonia/Makefile.am create mode 100644 src/gallium/state_trackers/omx_tizonia/Makefile.sources create mode 100644 src/gallium/state_trackers/omx_tizonia/entrypoint.c create mode 100644 src/gallium/state_trackers/omx_tizonia/entrypoint.h create mode 100644 src/gallium/state_trackers/omx_tizonia/h264d.c create mode 100644 src/gallium/state_trackers/omx_tizonia/h264d.h create mode 100644 src/gallium/state_trackers/omx_tizonia/h264dprc.c create mode 100644 src/gallium/state_trackers/omx_tizonia/h264dprc.h create mode 100644 src/gallium/state_trackers/omx_tizonia/h264dprc_decls.h create mode 100644 src/gallium/state_trackers/omx_tizonia/names.h diff --git a/src/gallium/state_trackers/omx_tizonia/Makefile.am b/src/gallium/state_trackers/omx_tizonia/Makefile.am new file mode 100644 index 000..932929b --- /dev/null +++ b/src/gallium/state_trackers/omx_tizonia/Makefile.am @@ -0,0 +1,35 @@ +# 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 = \ + $(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 index 000..7bb08b9 --- /dev/null +++ b/src/gallium/state_trackers/omx_tizonia/Makefile.sources @@ -0,0 +1,9 @@ +C_SOURCES := \ + entrypoint.c \ + entrypoint.h \ + h264d.c \ + h264d.h \ + h264dprc.c \ + h264dprc.h \ + names.h \ + h264prc_decls.h diff --git a/src/gallium/state_trackers/omx_tizonia/entrypoint.c b/src/gallium/state_trackers/omx_tizonia/entrypoint.c new file mode 100644 index 000..95094cf --- /dev/null +++ b/src/gallium/state_trackers/omx_tizonia/entrypoint.c @@ -0,0 +1,152 @@ +/** + * + * 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, sub license, 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILI
[Mesa-dev] [PATCH 1/2] st/omx_tizonia: add --enable-omx-tizonia flag and build files
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. GSoC Project link: https://summerofcode.withgoogle.com/projects/#4737166321123328 Signed-off-by: Gurkirpal Singh <gurkirpal...@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 +
[Mesa-dev] How to write using EGLImage?
Hi, As a part of my GSoC project[1] I'm working on adding OMX_UseEGLImage support in gallium/st/omx. I have an egl_display[1] (OMX_NATIVE_WINDOWTYPE) and the EGLImage[2] in the H.264 decoder component. I'm looking some sort of method to get mesa pipe screen pointer (or some other pipe structure) from the egl_display and from which I can get struct pipe_surface and eglimage pointer/id. [1] https://summerofcode.withgoogle.com/projects/#4737166321123328 [2] https://github.com/gpalsingh/mesa/blob/gsoc-dev/src/gallium/state_trackers/omx_tizonia/h264dprc.c#L205 Thanks, Gurkirpal ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [GSOC] Community bonding discussion
Hi, I was recently accepted as a Google Summer of Code (GSoC) student to work on adding omx state tracker in Mesa/Gallium that uses tizonia instead of bellagio. My mentor for this project, Julien Isorce, suggested that I should take this opportunity to interact with the mesa community and core maintainers. Our first idea was to completely replace the existing state tracker but due to not yet implemented backward compatibility support in tizonia it's not yet feasible. So we decided to add a new component in st/omx_tizonia for the time being and then later replace the bellagio based state tracker. Any suggestions about a better directory tree would be great to hear. Project draft: https://docs.google.com/document/d/1BM1LdSPVAQRsle1O_jj9Ssq52Z0HHlY8XwYY5y9j6Lk/edit?usp=sharing GSoC project link: https://summerofcode.withgoogle.com/projects/#4737166321123328 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/2 v2] mesa/st: Silence unused variable warning
v2: Use MAYBE_UNUSED Changed commit tag (Suggested by Ian Romanick) Signed-off-by: Gurkirpal Singh <gurkirpal...@gmail.com> --- src/mesa/state_tracker/st_glsl_to_nir.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index a880564..2cdb7b6 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -46,6 +46,8 @@ #include "compiler/glsl/glsl_to_nir.h" #include "compiler/glsl/ir.h" +#include "util/macros.h" + /* Depending on PIPE_CAP_TGSI_TEXCOORD (st->needs_texcoord_semantic) we * may need to fix up varying slots so the glsl->nir path is aligned @@ -169,7 +171,7 @@ st_nir_assign_uniform_locations(struct gl_program *prog, if (uniform->type->is_sampler()) { unsigned val; - bool found = shader_program->UniformHash->get(val, uniform->name); + MAYBE_UNUSED bool found = shader_program->UniformHash->get(val, uniform->name); loc = shaderidx++; assert(found); /* this ensure that nir_lower_samplers looks at the correct -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/2 v2] gallium: Silence unused variable warnings
v2: Use MAYBE_UNUSED as suggested by Ian Romanick Signed-off-by: Gurkirpal Singh <gurkirpal...@gmail.com> --- src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp | 4 +++- src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 4 +++- src/gallium/drivers/nouveau/nv50/nv98_video.c | 4 +++- src/gallium/drivers/nouveau/nvc0/nvc0_video.c | 8 +--- src/gallium/drivers/softpipe/sp_state_shader.c| 3 ++- src/gallium/state_trackers/xvmc/surface.c | 5 +++-- src/gallium/state_trackers/xvmc/tests/xvmc_bench.c| 8 +--- 7 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp index 0fe399b..9fc7c5a 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp @@ -23,6 +23,8 @@ #include "codegen/nv50_ir.h" #include "codegen/nv50_ir_target_nv50.h" +#include "util/macros.h" + namespace nv50_ir { #define NV50_OP_ENC_LONG 0 @@ -621,7 +623,7 @@ void CodeEmitterNV50::emitLOAD(const Instruction *i) { DataFile sf = i->src(0).getFile(); - int32_t offset = i->getSrc(0)->reg.data.offset; + MAYBE_UNUSED int32_t offset = i->getSrc(0)->reg.data.offset; switch (sf) { case FILE_SHADER_INPUT: diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp index 3213188..6a60a7b 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp @@ -24,6 +24,8 @@ #include "codegen/nv50_ir_target.h" #include "codegen/nv50_ir_build_util.h" +#include "util/macros.h" + extern "C" { #include "util/u_math.h" } @@ -2963,7 +2965,7 @@ NV50PostRaConstantFolding::visit(BasicBlock *bb) i->setSrc(1, def->getSrc(0)); } else { ImmediateValue val; - bool ret = def->src(0).getImmediate(val); + MAYBE_UNUSED bool ret = def->src(0).getImmediate(val); assert(ret); if (i->getSrc(1)->reg.data.id & 1) val.reg.data.u32 >>= 16; diff --git a/src/gallium/drivers/nouveau/nv50/nv98_video.c b/src/gallium/drivers/nouveau/nv50/nv98_video.c index 177a7e0..d348807 100644 --- a/src/gallium/drivers/nouveau/nv50/nv98_video.c +++ b/src/gallium/drivers/nouveau/nv50/nv98_video.c @@ -24,6 +24,7 @@ #include "util/u_sampler.h" #include "util/u_format.h" +#include "util/macros.h" #include @@ -40,7 +41,8 @@ nv98_decoder_decode_bitstream(struct pipe_video_codec *decoder, uint32_t comm_seq = ++dec->fence_seq; union pipe_desc desc; - unsigned vp_caps, is_ref, ret; + unsigned vp_caps, is_ref; + MAYBE_UNUSED unsigned ret; struct nouveau_vp3_video_buffer *refs[16] = {}; desc.base = picture; diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_video.c b/src/gallium/drivers/nouveau/nvc0/nvc0_video.c index a9fd1d2..10cb31e 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_video.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_video.c @@ -24,6 +24,7 @@ #include "util/u_sampler.h" #include "util/u_format.h" +#include "util/macros.h" static void nvc0_decoder_begin_frame(struct pipe_video_codec *decoder, @@ -32,7 +33,7 @@ nvc0_decoder_begin_frame(struct pipe_video_codec *decoder, { struct nouveau_vp3_decoder *dec = (struct nouveau_vp3_decoder *)decoder; uint32_t comm_seq = ++dec->fence_seq; - unsigned ret = 0; + MAYBE_UNUSED unsigned ret = 0; assert(dec); assert(target); @@ -53,7 +54,7 @@ nvc0_decoder_decode_bitstream(struct pipe_video_codec *decoder, { struct nouveau_vp3_decoder *dec = (struct nouveau_vp3_decoder *)decoder; uint32_t comm_seq = dec->fence_seq; - unsigned ret = 0; + MAYBE_UNUSED unsigned ret = 0; assert(decoder); @@ -72,7 +73,8 @@ nvc0_decoder_end_frame(struct pipe_video_codec *decoder, uint32_t comm_seq = dec->fence_seq; union pipe_desc desc; - unsigned vp_caps, is_ref, ret; + unsigned vp_caps, is_ref; + MAYBE_UNUSED unsigned ret; struct nouveau_vp3_video_buffer *refs[16] = {}; desc.base = picture; diff --git a/src/gallium/drivers/softpipe/sp_state_shader.c b/src/gallium/drivers/softpipe/sp_state_shader.c index a745662..d02727f 100644 --- a/src/gallium/drivers/softpipe/sp_state_shader.c +++ b/src/gallium/drivers/softpipe/sp_state_shader.c @@ -34,6 +34,7 @@ #include "util/u_memory.h" #include "util/u_inlines.h" #include "util/u_pstipple.h" +#include "util/macros.h" #include "draw/draw_context.h" #include "draw/draw_vs.h" #include &quo
[Mesa-dev] [PATCH 2/2] mesa: Silence unused variable warning
Signed-off-by: Gurkirpal Singh <gurkirpal...@gmail.com> --- src/mesa/state_tracker/st_glsl_to_nir.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index a880564..a914c8d 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -172,6 +172,7 @@ st_nir_assign_uniform_locations(struct gl_program *prog, bool found = shader_program->UniformHash->get(val, uniform->name); loc = shaderidx++; assert(found); + (void) found; /* this ensure that nir_lower_samplers looks at the correct * shader_program->UniformStorage[location]: */ -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/2] gallium: Silence unused variable warnings
Signed-off-by: Gurkirpal Singh <gurkirpal...@gmail.com> --- src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp | 2 ++ src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 1 + src/gallium/drivers/nouveau/nv50/nv98_video.c | 1 + src/gallium/drivers/nouveau/nvc0/nvc0_video.c | 3 +++ src/gallium/drivers/softpipe/sp_state_shader.c| 1 + src/gallium/state_trackers/xvmc/surface.c | 2 ++ src/gallium/state_trackers/xvmc/tests/xvmc_bench.c| 4 7 files changed, 14 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp index 0fe399b..d5479a7 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp @@ -637,6 +637,7 @@ CodeEmitterNV50::emitLOAD(const Instruction *i) case FILE_MEMORY_SHARED: if (targ->getChipset() >= 0x84) { assert(offset <= (int32_t)(0x3fff * typeSizeof(i->sType))); + (void) offset; code[0] = 0x1001; code[1] = 0x4000; @@ -646,6 +647,7 @@ CodeEmitterNV50::emitLOAD(const Instruction *i) emitLoadStoreSizeCS(i->sType); } else { assert(offset <= (int32_t)(0x1f * typeSizeof(i->sType))); + (void) offset; code[0] = 0x1001; code[1] = 0x0020 | (i->lanes << 14); emitLoadStoreSizeCS(i->sType); diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp index 3213188..e92cfea 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp @@ -2965,6 +2965,7 @@ NV50PostRaConstantFolding::visit(BasicBlock *bb) ImmediateValue val; bool ret = def->src(0).getImmediate(val); assert(ret); + (void) ret; if (i->getSrc(1)->reg.data.id & 1) val.reg.data.u32 >>= 16; val.reg.data.u32 &= 0x; diff --git a/src/gallium/drivers/nouveau/nv50/nv98_video.c b/src/gallium/drivers/nouveau/nv50/nv98_video.c index 177a7e0..ce86399 100644 --- a/src/gallium/drivers/nouveau/nv50/nv98_video.c +++ b/src/gallium/drivers/nouveau/nv50/nv98_video.c @@ -53,6 +53,7 @@ nv98_decoder_decode_bitstream(struct pipe_video_codec *decoder, /* did we decode bitstream correctly? */ assert(ret == 2); + (void) ret; nv98_decoder_vp(dec, desc, target, comm_seq, vp_caps, is_ref, refs); nv98_decoder_ppp(dec, desc, target, comm_seq); diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_video.c b/src/gallium/drivers/nouveau/nvc0/nvc0_video.c index a9fd1d2..d83f2a9 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_video.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_video.c @@ -41,6 +41,7 @@ nvc0_decoder_begin_frame(struct pipe_video_codec *decoder, ret = nvc0_decoder_bsp_begin(dec, comm_seq); assert(ret == 2); + (void) ret; } static void @@ -60,6 +61,7 @@ nvc0_decoder_decode_bitstream(struct pipe_video_codec *decoder, ret = nvc0_decoder_bsp_next(dec, comm_seq, num_buffers, data, num_bytes); assert(ret == 2); + (void) ret; } static void @@ -81,6 +83,7 @@ nvc0_decoder_end_frame(struct pipe_video_codec *decoder, /* did we decode bitstream correctly? */ assert(ret == 2); + (void) ret; nvc0_decoder_vp(dec, desc, target, comm_seq, vp_caps, is_ref, refs); nvc0_decoder_ppp(dec, desc, target, comm_seq); diff --git a/src/gallium/drivers/softpipe/sp_state_shader.c b/src/gallium/drivers/softpipe/sp_state_shader.c index a745662..d3abd9d 100644 --- a/src/gallium/drivers/softpipe/sp_state_shader.c +++ b/src/gallium/drivers/softpipe/sp_state_shader.c @@ -424,6 +424,7 @@ softpipe_delete_compute_state(struct pipe_context *pipe, struct sp_compute_shader *state = (struct sp_compute_shader *)cs; assert(softpipe->cs != state); + (void) softpipe; tgsi_free_tokens(state->tokens); FREE(state); } diff --git a/src/gallium/state_trackers/xvmc/surface.c b/src/gallium/state_trackers/xvmc/surface.c index 199712b..8e9e079 100644 --- a/src/gallium/state_trackers/xvmc/surface.c +++ b/src/gallium/state_trackers/xvmc/surface.c @@ -270,6 +270,8 @@ Status XvMCRenderSurface(Display *dpy, XvMCContext *context, unsigned int pictur assert(target_surface_priv->context == context); assert(!past_surface || past_surface_priv->context == context); assert(!future_surface || future_surface_priv->context == context); + (void) past_surface_priv; + (void) future_surface_priv; // call end frame on all referenced frames if (past_surface) diff --git a/src/gallium/state_trackers/xvmc/tests/xvmc_bench.c b/src/gallium/state_trackers/xvmc/tests/xvmc_bench.c index 4dc95ba..ec7ecc8 1006
[Mesa-dev] [PATCH] st/va: Check NULL pointer
Call to handle_table_get in vlVaDestroySurfaces can return NULL on failure. CID: 1243522 Signed-off-by: Gurkirpal Singh <gurkirpal...@gmail.com> --- src/gallium/state_trackers/va/surface.c | 4 1 file changed, 4 insertions(+) diff --git a/src/gallium/state_trackers/va/surface.c b/src/gallium/state_trackers/va/surface.c index 5efb893..3e74353 100644 --- a/src/gallium/state_trackers/va/surface.c +++ b/src/gallium/state_trackers/va/surface.c @@ -71,6 +71,10 @@ vlVaDestroySurfaces(VADriverContextP ctx, VASurfaceID *surface_list, int num_sur pipe_mutex_lock(drv->mutex); for (i = 0; i < num_surfaces; ++i) { vlVaSurface *surf = handle_table_get(drv->htab, surface_list[i]); + if (!surf) { + pipe_mutex_unlock(drv->mutex); + return VA_STATUS_ERROR_INVALID_SURFACE; + } if (surf->buffer) surf->buffer->destroy(surf->buffer); util_dynarray_fini(>subpics); -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] gbm: Fix comments
--- src/gbm/main/gbm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gbm/main/gbm.c b/src/gbm/main/gbm.c index 0f4657a..31202ed 100644 --- a/src/gbm/main/gbm.c +++ b/src/gbm/main/gbm.c @@ -132,7 +132,7 @@ _gbm_mesa_get_device(int fd) * the file descriptor returned when opening a device such as \c * /dev/dri/card0 * - * \param fd The file descriptor for an backend specific device + * \param fd The file descriptor for a backend specific device * \return The newly created struct gbm_device. The resources associated with * the device should be freed with gbm_device_destroy() when it is no longer * needed. If the creation of the device failed NULL will be returned. @@ -249,7 +249,7 @@ gbm_bo_get_fd(struct gbm_bo *bo) /** Write data into the buffer object * * If the buffer object was created with the GBM_BO_USE_WRITE flag, - * this function can used to write data into the buffer object. The + * this function can be used to write data into the buffer object. The * data is copied directly into the object and it's the responsiblity * of the caller to make sure the data represents valid pixel data, * according to the width, height, stride and format of the buffer object. @@ -522,7 +522,7 @@ gbm_surface_release_buffer(struct gbm_surface *surf, struct gbm_bo *bo) * * Before starting a new frame, the surface must have a buffer * available for rendering. Initially, a gbm surface will have a free - * buffer, but after one of more buffers have been locked (\sa + * buffer, but after one or more buffers have been locked (\sa * gbm_surface_lock_front_buffer()), the application must check for a * free buffer before rendering. * -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev