From: Emil Velikov <[email protected]> As suggested by Daniel, since libwayland-egl.so is effectively a vendor neutral frontend library with well defined backend ABI, it makes sense to move it to the Wayland repository.
Cc: Daniel Stone <[email protected]> Cc: Miguel A. Vico <[email protected]> Signed-off-by: Emil Velikov <[email protected]> --- The Wayland changes can be seen here [1] and have not landed yet. Once is in we can respin this patch fixing the version check - $FOO. [1] https://patchwork.freedesktop.org/series/30415/ --- configure.ac | 6 +- src/Makefile.am | 5 - src/egl/Makefile.am | 2 +- src/egl/wayland/wayland-egl/Makefile.am | 24 --- .../wayland/wayland-egl/wayland-egl-abi-check.c | 235 --------------------- src/egl/wayland/wayland-egl/wayland-egl-priv.h | 68 ------ .../wayland/wayland-egl/wayland-egl-symbols-check | 16 -- src/egl/wayland/wayland-egl/wayland-egl.c | 97 --------- src/egl/wayland/wayland-egl/wayland-egl.pc.in | 11 - 9 files changed, 5 insertions(+), 459 deletions(-) delete mode 100644 src/egl/wayland/wayland-egl/Makefile.am delete mode 100644 src/egl/wayland/wayland-egl/wayland-egl-abi-check.c delete mode 100644 src/egl/wayland/wayland-egl/wayland-egl-priv.h delete mode 100755 src/egl/wayland/wayland-egl/wayland-egl-symbols-check delete mode 100644 src/egl/wayland/wayland-egl/wayland-egl.c delete mode 100644 src/egl/wayland/wayland-egl/wayland-egl.pc.in diff --git a/configure.ac b/configure.ac index d0d4c0dfd1d..1b7bd9cef62 100644 --- a/configure.ac +++ b/configure.ac @@ -1705,6 +1705,10 @@ for plat in $platforms; do case "$plat" in wayland) + if test "x$enable_egl" = xyes; then + PKG_CHECK_MODULES([WAYLAND_EGL_BACKEND], [wayland-egl-backend >= $FOO]) + fi + PKG_CHECK_MODULES([WAYLAND], [wayland-client >= $WAYLAND_REQUIRED wayland-server >= $WAYLAND_REQUIRED]) if test "x$WAYLAND_SCANNER" = "x:"; then @@ -2823,8 +2827,6 @@ AC_CONFIG_FILES([Makefile src/egl/Makefile src/egl/main/egl.pc src/egl/wayland/wayland-drm/Makefile - src/egl/wayland/wayland-egl/Makefile - src/egl/wayland/wayland-egl/wayland-egl.pc src/gallium/Makefile src/gallium/auxiliary/Makefile src/gallium/auxiliary/pipe-loader/Makefile diff --git a/src/Makefile.am b/src/Makefile.am index e055cb8e701..6362e4642e1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -101,11 +101,6 @@ if HAVE_GBM SUBDIRS += gbm endif -## Optionally required by EGL -if HAVE_PLATFORM_WAYLAND -SUBDIRS += egl/wayland/wayland-egl -endif - if HAVE_EGL SUBDIRS += egl endif diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am index 8ff1ffaba18..edd7de9c185 100644 --- a/src/egl/Makefile.am +++ b/src/egl/Makefile.am @@ -105,11 +105,11 @@ dri2_backend_FILES += drivers/dri2/platform_android.c endif AM_CFLAGS += \ + $(WAYLAND_EGL_BACKEND_CFLAGS) \ -I$(top_srcdir)/src/loader \ -I$(top_builddir)/src/egl/drivers/dri2 \ -I$(top_srcdir)/src/egl/drivers/dri2 \ -I$(top_srcdir)/src/gbm/backends/dri \ - -I$(top_srcdir)/src/egl/wayland/wayland-egl \ -I$(top_builddir)/src/egl/wayland/wayland-drm \ -I$(top_srcdir)/src/egl/wayland/wayland-drm \ -DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" \ diff --git a/src/egl/wayland/wayland-egl/Makefile.am b/src/egl/wayland/wayland-egl/Makefile.am deleted file mode 100644 index 846fa6247b2..00000000000 --- a/src/egl/wayland/wayland-egl/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = wayland-egl.pc - -AM_CFLAGS = $(DEFINES) \ - $(VISIBILITY_CFLAGS) \ - $(WAYLAND_CFLAGS) - -lib_LTLIBRARIES = libwayland-egl.la -noinst_HEADERS = wayland-egl-priv.h -libwayland_egl_la_SOURCES = wayland-egl.c -libwayland_egl_la_LDFLAGS = \ - -no-undefined \ - -version-info 1 \ - $(GC_SECTIONS) \ - $(LD_NO_UNDEFINED) - -TESTS = wayland-egl-symbols-check \ - wayland-egl-abi-check - -EXTRA_DIST = wayland-egl-symbols-check - -check_PROGRAMS = wayland-egl-abi-check - -include $(top_srcdir)/install-lib-links.mk diff --git a/src/egl/wayland/wayland-egl/wayland-egl-abi-check.c b/src/egl/wayland/wayland-egl/wayland-egl-abi-check.c deleted file mode 100644 index 4ea38542a38..00000000000 --- a/src/egl/wayland/wayland-egl/wayland-egl-abi-check.c +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#include <stddef.h> // offsetof -#include <stdio.h> // printf - -#include "wayland-egl-priv.h" // Current struct wl_egl_window implementation - -/* - * Following are previous implementations of wl_egl_window. - * - * DO NOT EVER CHANGE! - */ - -/* From: 214fc6e850 - Benjamin Franzke : egl: Implement libwayland-egl */ -struct wl_egl_window_v0 { - struct wl_surface *surface; - - int width; - int height; - int dx; - int dy; - - int attached_width; - int attached_height; -}; - -/* From: ca3ed3e024 - Ander Conselvan de Oliveira : egl/wayland: Don't invalidate drawable on swap buffers */ -struct wl_egl_window_v1 { - struct wl_surface *surface; - - int width; - int height; - int dx; - int dy; - - int attached_width; - int attached_height; - - void *private; - void (*resize_callback)(struct wl_egl_window *, void *); -}; - -/* From: 690ead4a13 - Stencel, Joanna : egl/wayland-egl: Fix for segfault in dri2_wl_destroy_surface. */ -#define WL_EGL_WINDOW_VERSION_v2 2 -struct wl_egl_window_v2 { - struct wl_surface *surface; - - int width; - int height; - int dx; - int dy; - - int attached_width; - int attached_height; - - void *private; - void (*resize_callback)(struct wl_egl_window *, void *); - void (*destroy_window_callback)(void *); -}; - -/* From: 2d5d61bc49 - Miguel A. Vico : wayland-egl: Make wl_egl_window a versioned struct */ -#define WL_EGL_WINDOW_VERSION_v3 3 -struct wl_egl_window_v3 { - const intptr_t version; - - int width; - int height; - int dx; - int dy; - - int attached_width; - int attached_height; - - void *private; - void (*resize_callback)(struct wl_egl_window *, void *); - void (*destroy_window_callback)(void *); - - struct wl_surface *surface; -}; - - -/* This program checks we keep a backwards-compatible struct wl_egl_window - * definition whenever it is modified in wayland-egl-priv.h. - * - * The previous definition should be added above as a new struct - * wl_egl_window_vN, and the appropriate checks should be added below - */ - -#define MEMBER_SIZE(type, member) sizeof(((type *)0)->member) - -#define CHECK_RENAMED_MEMBER(a_ver, b_ver, a_member, b_member) \ - do { \ - if (offsetof(struct wl_egl_window ## a_ver, a_member) != \ - offsetof(struct wl_egl_window ## b_ver, b_member)) { \ - printf("Backards incompatible change detected!\n " \ - "offsetof(struct wl_egl_window" #a_ver "::" #a_member ") != " \ - "offsetof(struct wl_egl_window" #b_ver "::" #b_member ")\n"); \ - return 1; \ - } \ - \ - if (MEMBER_SIZE(struct wl_egl_window ## a_ver, a_member) != \ - MEMBER_SIZE(struct wl_egl_window ## b_ver, b_member)) { \ - printf("Backards incompatible change detected!\n " \ - "MEMBER_SIZE(struct wl_egl_window" #a_ver "::" #a_member ") != " \ - "MEMBER_SIZE(struct wl_egl_window" #b_ver "::" #b_member ")\n"); \ - return 1; \ - } \ - } while (0) - -#define CHECK_MEMBER(a_ver, b_ver, member) CHECK_RENAMED_MEMBER(a_ver, b_ver, member, member) -#define CHECK_MEMBER_CURRENT(a_ver, member) CHECK_MEMBER(a_ver,, member) - -#define CHECK_SIZE(a_ver, b_ver) \ - do { \ - if (sizeof(struct wl_egl_window ## a_ver) > \ - sizeof(struct wl_egl_window ## b_ver)) { \ - printf("Backards incompatible change detected!\n " \ - "sizeof(struct wl_egl_window" #a_ver ") > " \ - "sizeof(struct wl_egl_window" #b_ver ")\n"); \ - return 1; \ - } \ - } while (0) - -#define CHECK_SIZE_CURRENT(a_ver) \ - do { \ - if (sizeof(struct wl_egl_window ## a_ver) != \ - sizeof(struct wl_egl_window)) { \ - printf("Backards incompatible change detected!\n " \ - "sizeof(struct wl_egl_window" #a_ver ") != " \ - "sizeof(struct wl_egl_window)\n"); \ - return 1; \ - } \ - } while (0) - -#define CHECK_VERSION(a_ver, b_ver) \ - do { \ - if ((WL_EGL_WINDOW_VERSION ## a_ver) >= \ - (WL_EGL_WINDOW_VERSION ## b_ver)) { \ - printf("Backards incompatible change detected!\n " \ - "WL_EGL_WINDOW_VERSION" #a_ver " >= " \ - "WL_EGL_WINDOW_VERSION" #b_ver "\n"); \ - return 1; \ - } \ - } while (0) - -#define CHECK_VERSION_CURRENT(a_ver) \ - do { \ - if ((WL_EGL_WINDOW_VERSION ## a_ver) != \ - (WL_EGL_WINDOW_VERSION)) { \ - printf("Backards incompatible change detected!\n " \ - "WL_EGL_WINDOW_VERSION" #a_ver " != " \ - "WL_EGL_WINDOW_VERSION\n"); \ - return 1; \ - } \ - } while (0) - -int main(int argc, char **argv) -{ - /* Check wl_egl_window_v1 ABI against wl_egl_window_v0 */ - CHECK_MEMBER(_v0, _v1, surface); - CHECK_MEMBER(_v0, _v1, width); - CHECK_MEMBER(_v0, _v1, height); - CHECK_MEMBER(_v0, _v1, dx); - CHECK_MEMBER(_v0, _v1, dy); - CHECK_MEMBER(_v0, _v1, attached_width); - CHECK_MEMBER(_v0, _v1, attached_height); - - CHECK_SIZE(_v0, _v1); - - /* Check wl_egl_window_v2 ABI against wl_egl_window_v1 */ - CHECK_MEMBER(_v1, _v2, surface); - CHECK_MEMBER(_v1, _v2, width); - CHECK_MEMBER(_v1, _v2, height); - CHECK_MEMBER(_v1, _v2, dx); - CHECK_MEMBER(_v1, _v2, dy); - CHECK_MEMBER(_v1, _v2, attached_width); - CHECK_MEMBER(_v1, _v2, attached_height); - CHECK_MEMBER(_v1, _v2, private); - CHECK_MEMBER(_v1, _v2, resize_callback); - - CHECK_SIZE(_v1, _v2); - - /* Check wl_egl_window_v3 ABI against wl_egl_window_v2 */ - CHECK_RENAMED_MEMBER(_v2, _v3, surface, version); - CHECK_MEMBER (_v2, _v3, width); - CHECK_MEMBER (_v2, _v3, height); - CHECK_MEMBER (_v2, _v3, dx); - CHECK_MEMBER (_v2, _v3, dy); - CHECK_MEMBER (_v2, _v3, attached_width); - CHECK_MEMBER (_v2, _v3, attached_height); - CHECK_MEMBER (_v2, _v3, private); - CHECK_MEMBER (_v2, _v3, resize_callback); - CHECK_MEMBER (_v2, _v3, destroy_window_callback); - - CHECK_SIZE (_v2, _v3); - CHECK_VERSION(_v2, _v3); - - /* Check current wl_egl_window ABI against wl_egl_window_v3 */ - CHECK_MEMBER_CURRENT(_v3, version); - CHECK_MEMBER_CURRENT(_v3, width); - CHECK_MEMBER_CURRENT(_v3, height); - CHECK_MEMBER_CURRENT(_v3, dx); - CHECK_MEMBER_CURRENT(_v3, dy); - CHECK_MEMBER_CURRENT(_v3, attached_width); - CHECK_MEMBER_CURRENT(_v3, attached_height); - CHECK_MEMBER_CURRENT(_v3, private); - CHECK_MEMBER_CURRENT(_v3, resize_callback); - CHECK_MEMBER_CURRENT(_v3, destroy_window_callback); - CHECK_MEMBER_CURRENT(_v3, surface); - - CHECK_SIZE_CURRENT (_v3); - CHECK_VERSION_CURRENT(_v3); - - return 0; -} diff --git a/src/egl/wayland/wayland-egl/wayland-egl-priv.h b/src/egl/wayland/wayland-egl/wayland-egl-priv.h deleted file mode 100644 index 3b59908cc16..00000000000 --- a/src/egl/wayland/wayland-egl/wayland-egl-priv.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright © 2011 Benjamin Franzke - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Authors: - * Benjamin Franzke <[email protected]> - */ - -#ifndef _WAYLAND_EGL_PRIV_H -#define _WAYLAND_EGL_PRIV_H - -/* GCC visibility */ -#if defined(__GNUC__) -#define WL_EGL_EXPORT __attribute__ ((visibility("default"))) -#else -#define WL_EGL_EXPORT -#endif - -#include <wayland-client.h> - -#ifdef __cplusplus -extern "C" { -#endif - -#define WL_EGL_WINDOW_VERSION 3 - -struct wl_egl_window { - const intptr_t version; - - int width; - int height; - int dx; - int dy; - - int attached_width; - int attached_height; - - void *private; - void (*resize_callback)(struct wl_egl_window *, void *); - void (*destroy_window_callback)(void *); - - struct wl_surface *surface; -}; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/egl/wayland/wayland-egl/wayland-egl-symbols-check b/src/egl/wayland/wayland-egl/wayland-egl-symbols-check deleted file mode 100755 index e7105ea5793..00000000000 --- a/src/egl/wayland/wayland-egl/wayland-egl-symbols-check +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -FUNCS=$(nm -D --defined-only ${1-.libs/libwayland-egl.so} | grep -o "T .*" | cut -c 3- | while read func; do -( grep -q "^$func$" || echo $func ) <<EOF -wl_egl_window_resize -wl_egl_window_create -wl_egl_window_destroy -wl_egl_window_get_attached_size -_fini -_init -EOF -done) - -test ! -n "$FUNCS" || echo $FUNCS -test ! -n "$FUNCS" - diff --git a/src/egl/wayland/wayland-egl/wayland-egl.c b/src/egl/wayland/wayland-egl/wayland-egl.c deleted file mode 100644 index f16324c9f61..00000000000 --- a/src/egl/wayland/wayland-egl/wayland-egl.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright © 2011 Kristian Høgsberg - * Copyright © 2011 Benjamin Franzke - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Authors: - * Kristian Høgsberg <[email protected]> - * Benjamin Franzke <[email protected]> - */ - -#include <stdlib.h> -#include <string.h> - -#include <wayland-client.h> -#include "wayland-egl.h" -#include "wayland-egl-priv.h" - -WL_EGL_EXPORT void -wl_egl_window_resize(struct wl_egl_window *egl_window, - int width, int height, - int dx, int dy) -{ - if (width <= 0 || height <= 0) - return; - - egl_window->width = width; - egl_window->height = height; - egl_window->dx = dx; - egl_window->dy = dy; - - if (egl_window->resize_callback) - egl_window->resize_callback(egl_window, egl_window->private); -} - -WL_EGL_EXPORT struct wl_egl_window * -wl_egl_window_create(struct wl_surface *surface, - int width, int height) -{ - struct wl_egl_window _INIT_ = { .version = WL_EGL_WINDOW_VERSION }; - struct wl_egl_window *egl_window; - - if (width <= 0 || height <= 0) - return NULL; - - egl_window = malloc(sizeof *egl_window); - if (!egl_window) - return NULL; - - memcpy(egl_window, &_INIT_, sizeof *egl_window); - - egl_window->surface = surface; - egl_window->private = NULL; - egl_window->resize_callback = NULL; - egl_window->destroy_window_callback = NULL; - wl_egl_window_resize(egl_window, width, height, 0, 0); - egl_window->attached_width = 0; - egl_window->attached_height = 0; - - return egl_window; -} - -WL_EGL_EXPORT void -wl_egl_window_destroy(struct wl_egl_window *egl_window) -{ - if (egl_window->destroy_window_callback) - egl_window->destroy_window_callback(egl_window->private); - 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; -} diff --git a/src/egl/wayland/wayland-egl/wayland-egl.pc.in b/src/egl/wayland/wayland-egl/wayland-egl.pc.in deleted file mode 100644 index 8a40cfac5aa..00000000000 --- a/src/egl/wayland/wayland-egl/wayland-egl.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: wayland-egl -Description: Mesa wayland-egl library -Version: @VERSION@ -Requires: wayland-client -Libs: -L${libdir} -lwayland-egl -Cflags: -I${includedir} -- 2.14.1 _______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
