[Mesa-dev] [PATCH v4 02/10] egl/dri2: Add some member variables for tizen platform on dri2_egl_display and dri2_egl_surface (v2)

Gwan-gyeong Mun elongbug at gmail.com
Fri Oct 6 22:03:19 UTC 2017


It adds some member variables for tizen platform on dri2_egl_display and dri2_egl_surface.
  - tpl_display stores a object which encapsulates native disply (wl_display,
    gbm_device, tbm_bufmgr) for tizen platfom.
  - native_win stores native window (wl_surface, gbm_surface, tbm_surface_queue_h
  - tpl_surface stores a object which encapsulates native drawable object
    (wl_surface, gbm_surface, tbm_surface_queue_h) for tizen platfom.
  - tbm_surface stores a native platform buffer.
    tpl-egl exposes the native platform buffer as a tbm_surface.

And it adds routines of initialize and finalize for tizen platform.

Signed-off-by: Mun Gwan-gyeong <elongbug at gmail.com>
---
 src/egl/drivers/dri2/egl_dri2.c | 11 +++++++++++
 src/egl/drivers/dri2/egl_dri2.h | 22 ++++++++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index fd55dba7de..36b12ea2d5 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -910,6 +910,11 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp)
    case _EGL_PLATFORM_ANDROID:
       ret = dri2_initialize_android(drv, disp);
       break;
+#endif
+#ifdef HAVE_TIZEN_PLATFORM
+   case _EGL_PLATFORM_TIZEN:
+      ret = dri2_initialize_tizen(drv, disp);
+      break;
 #endif
    default:
       _eglLog(_EGL_WARNING, "No EGL platform enabled.");
@@ -1004,6 +1009,12 @@ dri2_display_destroy(_EGLDisplay *disp)
          wl_display_disconnect(dri2_dpy->wl_dpy);
       }
       break;
+#endif
+#ifdef HAVE_TIZEN_PLATFORM
+   case _EGL_PLATFORM_TIZEN:
+      if (dri2_dpy->tpl_display)
+         tpl_object_unreference((tpl_object_t *)(dri2_dpy->tpl_display));
+      break;
 #endif
    default:
       break;
diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h
index 0f4ef763bd..4e1fead46b 100644
--- a/src/egl/drivers/dri2/egl_dri2.h
+++ b/src/egl/drivers/dri2/egl_dri2.h
@@ -65,6 +65,14 @@ struct zwp_linux_dmabuf_v1;
 
 #endif /* HAVE_ANDROID_PLATFORM */
 
+#ifdef HAVE_TIZEN_PLATFORM
+#include <tpl.h>
+#include <tbm_bufmgr.h>
+#include <tbm_drm_helper.h>
+#include <tbm_surface.h>
+#include <tbm_surface_internal.h>
+#endif /* HAVE_TIZEN_PLATFORM */
+
 #if defined(HAVE_WAYLAND_PLATFORM) || defined(HAVE_DRM_PLATFORM)
 #define COLOR_BUFFERS_SIZE 4
 #else
@@ -241,6 +249,10 @@ struct dri2_egl_display
    const gralloc_module_t *gralloc;
 #endif
 
+#ifdef HAVE_TIZEN_PLATFORM
+   tpl_display_t            *tpl_display;
+#endif
+
    bool                      is_render_node;
    bool                      is_different_gpu;
 };
@@ -320,6 +332,13 @@ struct dri2_egl_surface
    struct ANativeWindowBuffer *buffer;
 #endif
 
+#ifdef HAVE_TIZEN_PLATFORM
+   void                  *native_win;
+   tpl_surface_t         *tpl_surface;
+   tbm_surface_h          tbm_surface;
+   tbm_format             tbm_format;
+#endif
+
 #if defined(HAVE_SURFACELESS_PLATFORM)
       __DRIimage           *front;
       unsigned int         visual;
@@ -417,6 +436,9 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp);
 EGLBoolean
 dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *disp);
 
+EGLBoolean
+dri2_initialize_tizen(_EGLDriver *drv, _EGLDisplay *disp);
+
 EGLBoolean
 dri2_initialize_surfaceless(_EGLDriver *drv, _EGLDisplay *disp);
 
-- 
2.14.2



More information about the mesa-dev mailing list