- libwayland-egl and its devel packages will be provided by wayland.
- Removed what existed to build wayland-egl.
- wayland-egl-priv.h is replaced to wayland-egl-backend.h which provided by wayland.
Change-Id: I29a669f06b4d3502b0da2472de61639a9873418c
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
[with_wayland=yes])
AS_IF([test "${with_wayland}" = "yes" || test "${with_wayland}" = "1"],
- [PKG_CHECK_MODULES([TPL_WL], [libtdm-client wayland-tbm-client wayland-tbm-server tizen-surface-client glib-2.0])
+ [PKG_CHECK_MODULES([TPL_WL], [libtdm-client wayland-tbm-client wayland-tbm-server tizen-surface-client glib-2.0 wayland-egl wayland-egl-backend])
TPL_CFLAGS+="$TPL_WL_CFLAGS"
TPL_CFLAGS+=" -DTPL_WINSYS_WL=1 "
TPL_LIBS+="$TPL_WL_LIBS"],
src/wayland-egl/Makefile
pkgconfig/Makefile
pkgconfig/tpl-egl.pc
- pkgconfig/wayland-egl.pc
pkgconfig/wayland-egl-tizen.pc
])
%define ENABLE_TPL_TEST 0
%define ENABLE_TPL_TEST_GCOV 0
-#WAYLAND-EGL VERSION MACROS
-%define WL_EGL_VERSION_MAJOR 1
-%define WL_EGL_VERSION_MINOR 2
-%define WL_EGL_VERSION_PATCH 4
-%define WL_EGL_VERSION %{WL_EGL_VERSION_MAJOR}.%{WL_EGL_VERSION_MINOR}.%{WL_EGL_VERSION_PATCH}
-
#WAYLAND-EGL-TIZEN VERSION MACROS
%define WL_EGL_TIZEN_VERSION_MAJOR 1
%define WL_EGL_TIZEN_VERSION_MINOR 0
BuildRequires: pkgconfig(wayland-tbm-server)
BuildRequires: pkgconfig(tizen-surface-client)
BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(wayland-egl)
+BuildRequires: pkgconfig(wayland-egl-backend)
%endif
%if "%{ENABLE_TTRACE}" == "1"
Summary: Development files for TPL
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
-%if "%{TPL_WINSYS}" == "WL"
-Requires: libwayland-egl-devel
-%endif
%description devel
This package contains the development libraries and header files needed by
the GPU Vendor DDK's EGL.
%if "%{TPL_WINSYS}" == "WL"
-%package -n libwayland-egl
-Version: %{WL_EGL_VERSION}
-Release: 0
-Summary: Wayland EGL backend
-
-%description -n libwayland-egl
-Wayland EGL backend
-
-%package -n libwayland-egl-devel
-Version: %{WL_EGL_VERSION}
-Release: 0
-Summary: Development header files for use with Wayland protocol
-Requires: libwayland-egl
-
-%description -n libwayland-egl-devel
-Development header files for use with Wayland protocol
-
%package -n libwayland-egl-tizen
Version: %{WL_EGL_TIZEN_VERSION}
Release: 0
Summary: Wayland EGL TIZEN backend
%description -n libwayland-egl-tizen
-This package provides tizen specific extension fo wayland-egl.
+This package provides tizen specific extension of wayland-egl.
%package -n libwayland-egl-tizen-devel
Version: %{WL_EGL_TIZEN_VERSION}
export TPL_VERSION_MINOR=%{TPL_VERSION_MINOR}
export TPL_VERSION_PATCH=%{TPL_VERSION_PATCH}
-export WL_EGL_VERSION_MAJOR=%{WL_EGL_VERSION_MAJOR}
-export WL_EGL_VERSION_MINOR=%{WL_EGL_VERSION_MINOR}
-export WL_EGL_VERSION_PATCH=%{WL_EGL_VERSION_PATCH}
-
export WL_EGL_TIZEN_VERSION_MAJOR=%{WL_EGL_TIZEN_VERSION_MAJOR}
export WL_EGL_TIZEN_VERSION_MINOR=%{WL_EGL_TIZEN_VERSION_MINOR}
export WL_EGL_TIZEN_VERSION_PATCH=%{WL_EGL_TIZEN_VERSION_PATCH}
%postun -p /sbin/ldconfig
%if "%{TPL_WINSYS}" == "WL"
-%post -n libwayland-egl -p /sbin/ldconfig
-%postun -n libwayland-egl -p /sbin/ldconfig
%post -n libwayland-egl-tizen -p /sbin/ldconfig
%postun -n libwayland-egl-tizen -p /sbin/ldconfig
%endif
%{_libdir}/libtpl-egl.so
%if "%{TPL_WINSYS}" == "WL"
-%files -n libwayland-egl
-%manifest packaging/libwayland-egl.manifest
-%license COPYING
-%defattr(-,root,root,-)
-%{_libdir}/libwayland-egl.so*
-
-%files -n libwayland-egl-devel
-%defattr(-,root,root,-)
-%{_includedir}/wayland-egl-tizen.h
-%{_libdir}/libwayland-egl.so
-%{_libdir}/pkgconfig/wayland-egl.pc
-
%files -n libwayland-egl-tizen
%manifest packaging/libwayland-egl-tizen.manifest
%license COPYING
+++ /dev/null
-<manifest>
- <request>
- <domain name="_"/>
- </request>
-</manifest>
pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = tpl-egl.pc wayland-egl.pc wayland-egl-tizen.pc
+pkgconfig_DATA = tpl-egl.pc wayland-egl-tizen.pc
+++ /dev/null
-prefix=/usr
-exec_prefix=${prefix}
-libdir=${exec_prefix}/@LIB@
-includedir=${prefix}/include
-
-Name: wayland-egl
-Description: Wayland EGL Protocol for TIZEN (from Mesa)
-Version: 10.2.0
-Requires: wayland-client
-Libs: -L${libdir} -lwayland-egl
-Cflags: -I${includedir}
#define inline __inline__
#include <wayland-client.h>
-
-#include "wayland-egl/wayland-egl-priv.h"
+#include <wayland-egl-backend.h>
+#include "wayland-egl/wayland-egl-tizen.h"
#include "wayland-egl/wayland-egl-tizen-priv.h"
#undef inline
__cb_client_window_get_rotation_capability(struct wl_egl_window *wl_egl_window,
void *private)
{
- int rotation_capability = WL_EGL_WINDOW_CAPABILITY_NONE;
+ int rotation_capability = WL_EGL_WINDOW_TIZEN_CAPABILITY_NONE;
TPL_ASSERT(private);
TPL_ASSERT(wl_egl_window);
struct tizen_private *tizen_private = (struct tizen_private *)private;
tpl_surface_t *surface = (tpl_surface_t *)tizen_private->data;
if (TPL_TRUE == surface->rotation_capability)
- rotation_capability = WL_EGL_WINDOW_CAPABILITY_ROTATION_SUPPORTED;
+ rotation_capability = WL_EGL_WINDOW_TIZEN_CAPABILITY_ROTATION_SUPPORTED;
else
- rotation_capability = WL_EGL_WINDOW_CAPABILITY_ROTATION_UNSUPPORTED;
+ rotation_capability = WL_EGL_WINDOW_TIZEN_CAPABILITY_ROTATION_UNSUPPORTED;
return rotation_capability;
}
#include <glib.h>
#include <glib-unix.h>
#include <tizen-surface-client-protocol.h>
+#include <wayland-egl-backend.h>
#include "tpl_utils.h"
#include "tpl_internal.h"
-#include "wayland-egl/wayland-egl-priv.h"
+#include "wayland-egl/wayland-egl-tizen.h"
#include "wayland-egl/wayland-egl-tizen-priv.h"
#include "tpl_wayland_egl_thread.h"
#include "wayland-vulkan/wayland-vulkan-client-protocol.h"
TPL_ASSERT(private);
TPL_ASSERT(wl_egl_window);
- int rotation_capability = WL_EGL_WINDOW_CAPABILITY_NONE;
+ int rotation_capability = WL_EGL_WINDOW_TIZEN_CAPABILITY_NONE;
twe_wl_surf_source *source = (twe_wl_surf_source *)private;
if (source->rotation_capability == TPL_TRUE)
- rotation_capability = WL_EGL_WINDOW_CAPABILITY_ROTATION_SUPPORTED;
+ rotation_capability = WL_EGL_WINDOW_TIZEN_CAPABILITY_ROTATION_SUPPORTED;
else
- rotation_capability = WL_EGL_WINDOW_CAPABILITY_ROTATION_UNSUPPORTED;
+ rotation_capability = WL_EGL_WINDOW_TIZEN_CAPABILITY_ROTATION_UNSUPPORTED;
return rotation_capability;
}
-libwayland_egl_la_LTLIBRARIES = libwayland-egl.la
-libwayland_egl_ladir = $(libdir)
-
-libwayland_egl_lainclude_HEADERS = wayland-egl-tizen.h
-libwayland_egl_laincludedir = $(includedir)
-
-libwayland_egl_la_CFLAGS = -I$(srcdir) \
- @WL_EGL_CFLAGS@
-
-if ENABLE_GCOV
-libwayland_egl_la_CFLAGS += -DTIZEN_TEST_GCOV
-endif
-
-libwayland_egl_la_LIBADD = @WL_EGL_LIBS@
-libwayland_egl_la_LDFLAGS = -version-number @WL_EGL_VERSION_MAJOR@:@WL_EGL_VERSION_MINOR@:@WL_EGL_VERSION_PATCH@
-libwayland_egl_la_SOURCES = wayland-egl.c
-
libwayland_egl_tizen_la_LTLIBRARIES = libwayland-egl-tizen.la
libwayland_egl_tizen_ladir = $(libdir)
libwayland_egl_tizen_la_CFLAGS = -I$(srcdir) \
@WL_EGL_TIZEN_CFLAGS@
-if ENABLE_GCOV
-libwayland_egl_la_CFLAGS += -DTIZEN_TEST_GCOV
-endif
libwayland_egl_tizen_la_LIBADD = @WL_EGL_TIZEN_LIBS@
libwayland_egl_tizen_la_LDFLAGS = -version-number @WL_EGL_TIZEN_VERSION_MAJOR@:@WL_EGL_TIZEN_VERSION_MINOR@:@WL_EGL_TIZEN_VERSION_PATCH@
+++ /dev/null
-#ifndef _WAYLAND_EGL_PRIV_H
-#define _WAYLAND_EGL_PRIV_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* GCC visibility */
-#if defined(__GNUC__) && __GNUC__ >= 4
-#define WL_EGL_EXPORT __attribute__ ((visibility("default")))
-#else
-#define WL_EGL_EXPORT
-#endif
-
-#include <wayland-client.h>
-#include <wayland-egl.h>
-
-#define WL_EGL_WINDOW_VERSION 3
-
-struct wl_egl_window {
- const intptr_t version;
- struct wl_surface *surface;
-
- int width;
- int height;
- int dx;
- int dy;
-
- int attached_width;
- int attached_height;
-
- void *driver_private;
-
- /* Tizen specific datas */
- wl_egl_window_rotation rotation;
- int frontbuffer_mode;
- int transform;
- int window_transform;
- unsigned int serial;
-
- void (*destroy_window_callback)(void *);
- void (*resize_callback)(struct wl_egl_window *, void *);
- void (*rotate_callback)(struct wl_egl_window *, void *);
- int (*get_rotation_capability)(struct wl_egl_window *, void *);
- void (*set_frontbuffer_callback)(struct wl_egl_window *, void *, int);
- void (*set_window_serial_callback)(struct wl_egl_window *, void *, unsigned int);
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
#include <wayland-egl.h>
+#include <wayland-egl-backend.h>
#include "wayland-egl-tizen.h"
-#include "wayland-egl-priv.h"
#include "wayland-egl-tizen-priv.h"
#define WL_EGL_DEBUG 1
wl_egl_window_tizen_get_capabilities(struct wl_egl_window *egl_window)
{
struct tizen_private *private = NULL;
- int capabilities = WL_EGL_WINDOW_CAPABILITY_NONE;
+ int capabilities = WL_EGL_WINDOW_TIZEN_CAPABILITY_NONE;
if (egl_window == NULL) {
WL_EGL_ERR("egl_window is NULL");
if (private->get_rotation_capability)
capabilities = private->get_rotation_capability(egl_window, egl_window->driver_private);
else
- capabilities = WL_EGL_WINDOW_CAPABILITY_ROTATION_UNKNOWN;
+ capabilities = WL_EGL_WINDOW_TIZEN_CAPABILITY_ROTATION_UNKNOWN;
return capabilities;
}
+++ /dev/null
-#include <stdlib.h>
-
-#include "wayland-egl-tizen.h"
-#include "wayland-egl-priv.h"
-
-#define WL_EGL_DEBUG 1
-#if WL_EGL_DEBUG
-
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/syscall.h>
-#include <sys/types.h>
-#include <signal.h>
-
-unsigned int wl_egl_log_level;
-
-/* WL-EGL Log Level - 0:unintialized, 1:initialized(no logging), 2:min log, 3:more log */
-#define WL_EGL_LOG(lvl, f, x...) { \
- if (wl_egl_log_level == 1) { \
- } \
- else if (wl_egl_log_level > 1) { \
- if (wl_egl_log_level <= lvl) \
- WL_EGL_LOG_PRINT(f, ##x) \
- } \
- else { \
- char *env = getenv("WL_EGL_LOG_LEVEL"); \
- if (env == NULL) \
- wl_egl_log_level = 1; \
- else \
- wl_egl_log_level = atoi(env); \
- \
- if (wl_egl_log_level > 1 && wl_egl_log_level <= lvl)\
- WL_EGL_LOG_PRINT(f, ##x) \
- } \
- }
-
-#define WL_EGL_LOG_PRINT(fmt, args...) { \
- printf("[\x1b[32mWL-EGL\x1b[0m %d:%d|\x1b[32m%s\x1b[0m|%d] " fmt "\n", \
- getpid(), (int)syscall(SYS_gettid), __func__, __LINE__, ##args); \
- }
-
-#define WL_EGL_ERR(f, x...) { \
- printf("[\x1b[31mWL-EGL_ERR\x1b[0m %d:%d|\x1b[31m%s\x1b[0m|%d] " f "\n",\
- getpid(), (int)syscall(SYS_gettid), __func__, __LINE__, ##x); \
- }
-
-#else
-#define WL_EGL_LOG(lvl, f, x...)
-#endif
-
-WL_EGL_EXPORT void
-wl_egl_window_resize(struct wl_egl_window *egl_window,
- int width, int height,
- int dx, int dy)
-{
- if (egl_window == NULL) {
- WL_EGL_ERR("egl_window is NULL");
- return;
- }
-
- egl_window->dx = dx;
- egl_window->dy = dy;
-
- if ((egl_window->width == width) && (egl_window->height == height)) return;
-
- egl_window->width = width;
- egl_window->height = height;
-
- if (egl_window->resize_callback)
- egl_window->resize_callback(egl_window, egl_window->driver_private);
-
- WL_EGL_LOG(2, "egl_win:%10p WxH:%dx%d dx:%d dy:%d rsz_cb:%10p",
- egl_window, width, height, egl_window->dx, egl_window->dy,
- egl_window->resize_callback);
-}
-
-WL_EGL_EXPORT struct wl_egl_window *
-wl_egl_window_create(struct wl_surface *surface,
- int width, int height)
-{
- struct wl_egl_window *egl_window;
-
- if (width <= 0 || height <= 0)
- return NULL;
- if (!surface)
- return NULL;
-
- egl_window = malloc(sizeof *egl_window);
- if (!egl_window) {
- WL_EGL_ERR("failed to allocate memory for egl_window");
- return NULL;
- }
- intptr_t *version = (intptr_t *)&egl_window->version;
- *version = WL_EGL_WINDOW_VERSION;
-
- egl_window->surface = surface;
-
- egl_window->width = width;
- egl_window->height = height;
-
- egl_window->resize_callback = NULL;
- wl_egl_window_resize(egl_window, width, height, 0, 0);
-
- egl_window->attached_width = 0;
- egl_window->attached_height = 0;
-
- egl_window->rotation = ROTATION_0;
- egl_window->frontbuffer_mode = 0;
- egl_window->transform = 0;
- egl_window->window_transform = 0;
- egl_window->serial = 0;
-
- egl_window->driver_private = NULL;
- egl_window->rotate_callback = NULL;
- egl_window->get_rotation_capability = NULL;
-
- egl_window->destroy_window_callback = NULL;
-
- WL_EGL_LOG(2, "surf:%10p WxH:%dx%d egl_win:%10p priv:%10p",
- surface, width, height, egl_window, egl_window->driver_private);
-
- return egl_window;
-}
-
-WL_EGL_EXPORT void
-wl_egl_window_destroy(struct wl_egl_window *egl_window)
-{
- if (egl_window == NULL) {
- WL_EGL_ERR("egl_window is NULL");
- return;
- }
-
- if (egl_window->destroy_window_callback)
- egl_window->destroy_window_callback(egl_window->driver_private);
-
- WL_EGL_LOG(2, "egl_win:%10p", egl_window);
-
- free(egl_window);
-}
-
-WL_EGL_EXPORT void
-wl_egl_window_get_attached_size(struct wl_egl_window *egl_window,
- int *width, int *height)
-{
- if (width)
- *width = egl_window->attached_width;
- if (height)
- *height = egl_window->attached_height;
-
- WL_EGL_LOG(2, "egl_win:%10p w:%10p h:%10p att_w:%d att_h:%d",
- egl_window, width, height, egl_window->attached_width,
- egl_window->attached_height);
-}
-
-WL_EGL_EXPORT void
-wl_egl_window_set_rotation(struct wl_egl_window *egl_window,
- wl_egl_window_rotation rotation)
-{
- if (egl_window == NULL) {
- WL_EGL_ERR("egl_window is NULL");
- return;
- }
-
- if (egl_window->rotation == rotation) {
- WL_EGL_LOG(2, "rotation(%d) egl_window->rotation(%d) already rotated",
- rotation, egl_window->rotation);
- return;
- }
-
- egl_window->rotation = rotation;
-
- if (egl_window->rotate_callback)
- egl_window->rotate_callback(egl_window, egl_window->driver_private);
-}
-
-WL_EGL_EXPORT void
-wl_egl_window_set_buffer_transform(struct wl_egl_window *egl_window,
- int wl_output_transform)
-{
- if (egl_window == NULL) {
- WL_EGL_ERR("egl_window is NULL");
- return;
- }
-
- if (egl_window->transform == wl_output_transform) {
- WL_EGL_LOG(2,
- "wl_output_transform(%d) egl_window->transform(%d) already rotated",
- wl_output_transform, egl_window->transform);
- return;
- }
-
- egl_window->transform = wl_output_transform;
-}
-
-WL_EGL_EXPORT int
-wl_egl_window_get_capabilities(struct wl_egl_window *egl_window)
-{
- int capabilities = WL_EGL_WINDOW_CAPABILITY_NONE;
- if (egl_window == NULL) {
- WL_EGL_ERR("egl_window is NULL");
- return capabilities;
- }
-
- if (egl_window->get_rotation_capability)
- capabilities = egl_window->get_rotation_capability(egl_window, egl_window->driver_private);
- else
- capabilities = WL_EGL_WINDOW_CAPABILITY_ROTATION_UNKNOWN;
-
- return capabilities;
-}
-
-WL_EGL_EXPORT void
-wl_egl_window_set_frontbuffer_mode(struct wl_egl_window *egl_window,
- int set)
-{
- if (egl_window == NULL) {
- WL_EGL_ERR("egl_window is NULL");
- return;
- }
-
- egl_window->frontbuffer_mode = set;
-
- if (egl_window->set_frontbuffer_callback)
- egl_window->set_frontbuffer_callback(egl_window, egl_window->driver_private,
- set);
-}
-
-WL_EGL_EXPORT void
-wl_egl_window_set_window_transform(struct wl_egl_window *egl_window,
- int window_transform)
-{
- if (egl_window == NULL) {
- WL_EGL_ERR("egl_window is NULL");
- return;
- }
-
- if (egl_window->window_transform == window_transform) {
- WL_EGL_LOG(2,
- "window_transform(%d) already rotated",
- window_transform);
- return;
- }
-
- egl_window->window_transform = window_transform;
-}