[Mesa-dev] [PATCH v5 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
Wed Oct 25 16:50:55 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 e4ecd4ec09..355329d669 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -933,6 +933,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.");
@@ -1027,6 +1032,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 26d0ee986e..3c1f7524e4 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 */
+
#ifdef HAVE_ANDROID_PLATFORM
/* Usually Android uses at most triple buffers in ANativeWindow so hardcode
* the number of color_buffers to 3.
@@ -234,6 +242,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;
};
@@ -311,6 +323,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;
@@ -408,6 +427,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