[Mesa-dev] [PATCH v2 2/9] egl/dri2: Add some member variables for tizen platform on dri2_egl_display and dri2_egl_surface
Gwan-gyeong Mun
elongbug at gmail.com
Sun Sep 17 18:01:00 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 2667aa5d64..a2c2b120ef 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -899,6 +899,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.");
@@ -993,6 +998,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 4a52b490a8..4b29b0d406 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 */
+
#include "eglconfig.h"
#include "eglcontext.h"
#include "egldisplay.h"
@@ -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;
};
@@ -323,6 +335,13 @@ struct dri2_egl_surface
} color_buffers[3], *back;
#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;
@@ -418,6 +437,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.1
More information about the mesa-dev
mailing list