Wayland in Embedded linux/10. Wayland buffer sharing(ivi-share)

ivi-share mechanism

Onionfra 2017. 6. 11. 22:42
1. Shared surface(the surface whose ID is set of simple-ivi-share argument) does eglSwapBuffers          
2. The ivi-share catchs attach event and get buffer object by using libgbm.
3. By using libdrm, ivi-share gets drm_gem_flink. The gem is the drm object which represent the buffer.
4. The ivi-share sends drm_gem_flink.name to simple-ivi-share app.
5. The simple-ivi-share app calls EglCreateImageKHR() to get eglImage.
6. The simple-ivi-share app calls GLEglImageTargetTexture2DOES() to create EGLImage target(texture object)
(
EGLImage target is referenced object of native image “eglImageOES

7. The simple-ivi-share app calls eglSwapBuffers



/*

  Create an EGLImage from an existing image resource(buffer)

*/

EGLImageKHR eglCreateImageKHR(

  EGLDisplay dpy,  // EGL display

  EGLContext ctx,   // EGL client API context

  EGLenum target,   // Type of resource being used as EGLImage source

  EGLClientBuffer buffer,     // Name of a resource to be used as EGLImage source

  const EGLint *attrib_list  // List of attribute-value which is used to select EGLImage source

)

/*

  Newly specified texture object will created that “EGLImage target” of the specified eglImageOES

*/

void EGLImageTargetTexture2DOES(

 

  enum target,  // Set to TEXTURE_EXTERNAL_OES,

    // defines the currently bound external texture object to be a target sibling of image

  eglImageOES image  // Must be the handle of a valid EGLImage resource

);