Understanding waylaid-ivi-extension 1.9.0 APIs usage

Noda, Hiroshi (NEUTRAL; ADITJ/SWG) hnoda at jp.adit-jv.com
Tue Mar 15 05:25:12 EDT 2016


Hi Vikas,

I can do it correctly without notification.
To do this, please call wl_display_flush between ilm_surfaceCreate and ilm_init.

ilm_surfaceCreate calls ivi_application_surface_create internally.
However, the request does not reach weston.
This is because nobody calls wl_display_flush until eglSwapBuffers is called later.
Therefore, nothing is reflected even if call ilm_surface API.

Best regards,
Hiroshi Noda

> -----Original Message-----
> Date: Tue, 15 Mar 2016 12:58:15 +0530
> From: Vikas Patil <vikasmpatil at gmail.com>
> To: "Ucan, Emre (ADITG/SW1)" <eucan at de.adit-jv.com>
> Cc: "genivi-meta-ivi at lists.genivi.org"
> 	<genivi-meta-ivi at lists.genivi.org>,
> 	"genivi-ivi-layer-management at lists.genivi.org"
> 	<genivi-ivi-layer-management at lists.genivi.org>
> Subject: Re: Understanding waylaid-ivi-extension 1.9.0 APIs usage
> Message-ID:
> 	<CA+kt3u3X2MVy+svuV2vGyn+hcKG1PJ1vh1y6O4k8cNbZ_GFJ2A at mail.gmail.
> com>
> Content-Type: text/plain; charset=UTF-8
> 
> Hi,
> 
> However if I do it after "surface notification" inside callbak then it 
> works. Does this means it is the correct sequence and I can't do it without notification?
> 
> e.g. 
> ilm_surfaceAddNotification(ilmSurfaceId,&surfaceCallbackFunction);
> 
> I also could not find any example program which uses the client, 
> common and control apis together.
> 
> Regards,
> Vikash
> 
> On Fri, Mar 11, 2016 at 1:54 PM, Vikas Patil <vikasmpatil at gmail.com> wrote:
> > Hi Emre Ucan,
> >
> > Any call I make to change the properties of the surface it fails 
> > with error (ILM_FAILED) after the ilm_commitChnages a shown below. 
> > Not sure why is this happening?
> >
> >     ilmClient_init((t_ilm_nativedisplay)wlDisplay)
> >
> >     ilm_surfaceCreate((t_ilm_nativehandle)wlSurface,
> >                              width, height,
> >                              ILM_PIXELFORMAT_RGBA_8888, 
> > &ilmSurfaceId);
> >
> >     ilm_init();
> >     ilm_layerCreateWithDimension(&ilmLayerId, width, height);
> >     ilm_layerSetVisibility(ilmLayerId, ILM_TRUE);
> >     ilm_displaySetRenderOrder((t_ilm_display) 0, &ilmLayerId, 1);
> >     ilm_layerSetRenderOrder(ilmLayerId, &ilmSurfaceId, 1);
> >
> >     /* ilm_surfaceAddNotification(ilmSurfaceId,&surfaceCallbackFunction); */
> >     ilm_commitChanges();
> >
> >    -----------> here it fails: ilm 
> > _surfaceSetVisibility(ilmSurfaceId,
> > ILM_TRUE); (any othe surface call also fails.)
> >
> >
> >
> > Thanks & regards,
> > Vikash
> >
> > On Fri, Mar 11, 2016 at 12:56 PM, Ucan, Emre (ADITG/SW1) 
> > <eucan at de.adit-jv.com> wrote:
> >> Hi Vikas,
> >>
> >> I am not sure. The surface is not on the layer.
> >>
> >> Maybe ilm_layerAddSurface failed ?
> >>
> >> Please check return values of ilm APIs.
> >>
> >> Best regards
> >>
> >> Emre Ucan
> >> Software Group I (ADITG/SW1)
> >>
> >> Tel. +49 5121 49 6937
> >>
> >>> -----Original Message-----
> >>> From: Vikas Patil [mailto:vikasmpatil at gmail.com]
> >>> Sent: Freitag, 11. M?rz 2016 05:52
> >>> To: Ucan, Emre (ADITG/SW1)
> >>> Cc: genivi-ivi-layer-management at lists.genivi.org; genivi-meta- 
> >>> ivi at lists.genivi.org
> >>> Subject: Re: Understanding waylaid-ivi-extension 1.9.0 APIs usage
> >>>
> >>> Hi,
> >>>
> >>> Is this an issue or expected behavior or my implementation missing 
> >>> something?
> >>>
> >>> Thanks & Regards,
> >>> Vikash
> >>>
> >>> On Wed, Mar 9, 2016 at 5:55 PM, Vikas Patil <vikasmpatil at gmail.com> wrote:
> >>> > Hi Emre Ucan,
> >>> >
> >>> > Thanks for your comments.
> >>> >
> >>> > However when I try to create surface and also set the surface 
> >>> > properties in one process (single application), application do 
> >>> > not work. Am I missing something here? Any clues will be very helpful.
> >>> > Attached here the main.c (application code) for reference.
> >>> >
> >>> > If I do following sequence of calls in application, it don't 
> >>> > show up on display and analyze command says surface is not on layer.
> >>> >
> >>> > ilmClient_init((t_ilm_nativedisplay)wlDisplay);
> >>> >
> >>> >     ilm_surfaceCreate((t_ilm_nativehandle)wlSurface,
> >>> >                              width, height,
> >>> >                              ILM_PIXELFORMAT_RGBA_8888, 
> >>> > &ilmSurfaceId);
> >>> >
> >>> >
> >>> >     ilm_init();
> >>> >
> >>> >     ilm_layerCreateWithDimension(&ilmLayerId, width, height);
> >>> >     ilm_layerSetVisibility(ilmLayerId, ILM_TRUE);
> >>> >     ilm_displaySetRenderOrder((t_ilm_display) 0, &ilmLayerId, 1);
> >>> >     ilm_layerSetRenderOrder(ilmLayerId, &ilmSurfaceId, 1);
> >>> >
> >>> >     /*
> >>> > ilm_surfaceAddNotification(ilmSurfaceId,&surfaceCallbackFunction
> >>> > );
> >>> */
> >>> >     ilm_commitChanges();
> >>> >
> >>> >     ilm_surfaceSetDestinationRectangle(ilmSurfaceId, 0, 0, width, height);
> >>> >     ilm_surfaceSetSourceRectangle(ilmSurfaceId, 0, 0, width, height);
> >>> >     ilm_surfaceSetVisibility(ilmSurfaceId, ILM_TRUE);
> >>> >     ilm_surfaceSetOpacity(ilmSurfaceId, 1.0f);
> >>> >
> >>> >     ilm_layerAddSurface(ilmLayerId, ilmSurfaceId);
> >>> >     ilm_commitChanges();
> >>> >
> >>> >
> >>> > root at linux123:~# LayerManagerControl analyze surface 60
> >>> > Surface existance         | OK      |
> >>> > Surface on layer          | PROBLEM | Surface 60 is not on any layer
> >>> > root at orinoco-9939-a1:~#
> >>> >
> >>> > root at linux123:~# LayerManagerControl get scene screen 0 (0x0)
> >>> > ---------------------------------------
> >>> > - resolution:           x=800, y=480
> >>> > - hardware layer count: 0
> >>> > - layer render order:   1000(0x3e8),
> >>> >
> >>> >     layer 1000 (0x3e8)
> >>> >     ---------------------------------------
> >>> >     - created by pid:       0
> >>> >     - original size:        x=800, y=480
> >>> >     - destination region:   x=0, y=0, w=800, h=480
> >>> >     - source region:        x=0, y=0, w=800, h=480
> >>> >     - orientation:          0 (up is top)
> >>> >     - opacity:              1
> >>> >     - visibility:           1
> >>> >     - type:                 0 (unknown)
> >>> >     - surface render order:
> >>> >     - on screen:            0(0x0)
> >>> >
> >>> >
> >>> > Also if i use "ilm_initWithNativedisplay" instead of "ilm_init", 
> >>> > in that case also application don't show up on display and also 
> >>> > "LayerManagerControl"  do not work. Could you plase help me to 
> >>> > do this right?
> >>> >
> >>> > root at linux123:~# LayerManagerControl get scene unknown object 
> >>> > (16), message layer(?o) Failed to initialize wayland connection:
> >>> > Invalid argument [Warning] The ilm_control_context is already 
> >>> > destroyed Interpreter error: failed
> >>> >
> >>> >
> >>> > However if I enable "ilm_surfaceAddNotification" and set the 
> >>> > surface properties in callback "surfaceCallbackFunction" then it 
> >>> > work with ilm_init. Also in this case if I use 
> >>> > ilm_initWithNativedisplay instead of ilm_init then application 
> >>> > works but "LayerManagerControl" do not work.
> >>> >
> >>> > Thanks & Regards,
> >>> > Vikash
> >>> >
> >>> > On Wed, Mar 9, 2016 at 3:23 PM, Ucan, Emre (ADITG/SW1) 
> >>> > <eucan at de.adit-jv.com> wrote:
> >>> >> Hello Vikas,
> >>> >>
> >>> >> My answers are below
> >>> >>
> >>> >>> -----Original Message-----
> >>> >>> From: genivi-ivi-layer-management-bounces at lists.genivi.org
> >>> [mailto:genivi-
> >>> >>> ivi-layer-management-bounces at lists.genivi.org] On Behalf Of 
> >>> >>> Vikas Patil
> >>> >>> Sent: Dienstag, 8. M?rz 2016 11:25
> >>> >>> To: genivi-ivi-layer-management at lists.genivi.org; genivi-meta- 
> >>> >>> ivi at lists.genivi.org
> >>> >>> Subject: Understanding waylaid-ivi-extension 1.9.0 APIs usage
> >>> >>>
> >>> >>> Dear All,
> >>> >>>
> >>> >>> I am trying to upgrade as follows. With this I am trying to 
> >>> >>> run the simple-
> >>> egl
> >>> >>> (weston example test) (which I have modified to include apis 
> >>> >>> from
> >>> ilmClient,
> >>> >>> ilmControl and ilmCommon to avoid the need for using any 
> >>> >>> commands
> >>> using
> >>> >>> "LayermanagerControl"
> >>> >>> to get it working correctly and displaying). It was working 
> >>> >>> fine previously
> >>> but
> >>> >>> after upgrade it is not working as expected.
> >>> >>>
> >>> >>> upgrade:
> >>> >>> - from wayland/weston 1.8.0/18.0   to   1.9.0/1.9.0
> >>> >>> - from wayland-ivi-extension 1.4.0   to   1.9.0
> >>> >>>
> >>> >>> However I was able to make work my sample app working in two ways 1.
> >>> >>> After using the layer-add-surface.
> >>> >>> 2. Using
> >>> >>> "ilm_surfaceAddNotification(ilmSurfaceId,&surfaceCallbackFunction)"
> >>> >>> and doing all surface related calls after configure event.
> >>> >>>
> >>> >>> I think I know bit and pieces (after looking at the commit 
> >>> >>> logs) but not
> >>> the
> >>> >>> complete design and flow. Could you please elaborate what 
> >>> >>> exactly has
> >>> been
> >>> >>> changed and how should it be used?
> >>> >>>
> >>> >>> It would be very helpful if someone can answer following queries too:
> >>> >>>
> >>> >>> 1. How to use ilmClient and ilmControl within single source/process?
> >>> >>> 2. Will LayermanagerControl also works if I use the client and 
> >>> >>> control in
> >>> single
> >>> >>> process?
> >>> >>> 3. How to decide which following apis to use ? Could it be 
> >>> >>> used in single process?
> >>> >>>
> >>> >>> ilmClient_init()
> >>> >>
> >>> >> This API is only required when you want to create surfaces.
> >>> >>>
> >>> >>> ilm_init()
> >>> >>> ilm_initWithNativedisplay()
> >>> >>
> >>> >> These are basically very similar. Ilm_initWithNativedisplay 
> >>> >> uses the
> >>> pregiven wl_display and ilm_init creates a wl_display itself
> >>> >>
> >>> >>> ilmControl_init()
> >>> >> You should not call this API directly. Ilm_init and 
> >>> >> ilm_initWithNativedisplay
> >>> calls this API internally.
> >>> >>
> >>> >> If you want to have ilmClient and ilmControl API in one 
> >>> >> precess, you have
> >>> to call:
> >>> >> - ilmClient_init
> >>> >> - ilm_init or ilm_initWithNativedisplay
> >>> >>
> >>> >>>
> >>> >>> 4. Is it must to use following apis to add surface to layer 
> >>> >>> and changing
> >>> other
> >>> >>> surface properties as shown in layer-add-surface.c? or Without 
> >>> >>> this also I
> >>> can
> >>> >>> use the client and control APIs and make application working properly?
> >>> >>>
> >>> >>> ilm_surfaceAddNotification()
> >>> >>> ilm_registerNotification()
> >>> >>
> >>> >> You need this API to notify your HMI for creation of surfaces/layers.
> >>> >>
> >>> >> If your HMI is creating its own surfaces, you do not need to 
> >>> >> use these
> >>> APIs.
> >>> >>>
> >>> >>>
> >>> >>> Sometime I also see following error when trying 
> >>> >>> LayermanagerControl
> >>> while
> >>> >>> using (ilm_initWithNativedisplay(), ilmControl_init()) inside 
> >>> >>> application,
> >>> what
> >>> >>> does it signifies?
> >>> >>>
> >>> >>> LayerManagerControl analyze surface 70 unknown object (17), 
> >>> >>> message layer(?o) Failed to initialize wayland connection:
> >>> >>> Invalid argument [Warning] The ilm_control_context is already 
> >>> >>> destroyed Interpreter error: failed
> >>> >>
> >>> >> This error means that the wayland compositor does not respond.
> >>> >>
> >>> >>>
> >>> >>> Thanks & Regards,
> >>> >>> Vikash
> >>> >>> _______________________________________________
> >>> >>> genivi-ivi-layer-management mailing list genivi-ivi-layer- 
> >>> >>> management at lists.genivi.org 
> >>> >>> https://lists.genivi.org/mailman/listinfo/genivi-ivi-layer-man
> >>> >>> ag
> >>> >>> ement
> >>> >>
> >>> >> Best regards
> >>> >>
> >>> >> Emre Ucan
> >>> >> Software Group I (ADITG/SW1)
> >>> >>
> >>> >> Tel. +49 5121 49 6937


More information about the genivi-ivi-layer-management mailing list