From 5cd0256faa43e376dcd5b5f2c2edd2515aff9c04 Mon Sep 17 00:00:00 2001 From: Zhaowei Yuan Date: Mon, 3 Dec 2018 11:08:44 +0800 Subject: EGL: Add support for weston Add support for wayland & drm platforms which are used by weston. Select EGL platform for weston by setting environment variable: export EGL_PLATFORM=wayland Modifications to mesa.spec: Add platforms wayland and drm which is needed by weston Enable gbm and pack it into RPM package Modifications to egl_dri2.h Since tizen, drm and wayland are all supported now, remove the duplicate definition of "color_buffers" and "back" for tizen to avoid from building error. Change-Id: I339b850399c29df2b3f7698ebf1c77895ce3b463 Signed-off-by: Zhaowei Yuan --- packaging/mesa.spec | 6 ++++-- src/egl/drivers/dri2/egl_dri2.h | 18 ++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packaging/mesa.spec b/packaging/mesa.spec index 315293bff00..2d3d21bed6b 100644 --- a/packaging/mesa.spec +++ b/packaging/mesa.spec @@ -28,6 +28,7 @@ BuildRequires: pkgconfig(libdrm) >= 2.4.75 BuildRequires: pkgconfig(libudev) > 150 BuildRequires: pkgconfig(wayland-client) BuildRequires: pkgconfig(wayland-server) +BuildRequires: pkgconfig(wayland-protocols) BuildRequires: pkgconfig(tpl-egl) BuildRequires: pkgconfig(libtbm) BuildRequires: pkgconfig(libtdm) @@ -68,8 +69,8 @@ cp %{SOURCE1002} . --disable-dri3 \ --enable-gles2 \ --enable-shared-glapi \ - --disable-gbm \ - --with-platforms=tizen \ + --enable-gbm \ + --with-platforms=tizen,wayland,drm \ %ifarch %ix86 x86_64 --with-dri-drivers="i915,swrast" \ --with-gallium-drivers="i915,swrast" @@ -101,4 +102,5 @@ cp 99-GPU-Acceleration.rules %{buildroot}/etc/udev/rules.d %{_libdir}/libglapi* %{_libdir}/driver/* %{_libdir}/dri/* +%{_libdir}/libgbm* /etc/udev/rules.d/99-GPU-Acceleration.rules diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h index 1e128d02691..c82923fef6d 100644 --- a/src/egl/drivers/dri2/egl_dri2.h +++ b/src/egl/drivers/dri2/egl_dri2.h @@ -315,19 +315,10 @@ struct dri2_egl_surface __DRIimage *dri_image_back; __DRIimage *dri_image_front; - /* Used to record all the tbm_surface created by tpl_surface and their ages. - * Usually Tizen uses at most triple buffers in tpl_surface (tbm_surface_queue) - * so hardcode the number of color_buffers to 3. - */ - struct { - tbm_surface_h tbm_surface; - int age; - } color_buffers[3], *back; - int buffer_count; #endif -#if defined(HAVE_WAYLAND_PLATFORM) || defined(HAVE_DRM_PLATFORM) +#if defined(HAVE_WAYLAND_PLATFORM) || defined(HAVE_DRM_PLATFORM) || defined(HAVE_TIZEN_PLATFORM) struct { #ifdef HAVE_WAYLAND_PLATFORM struct wl_buffer *wl_buffer; @@ -341,6 +332,13 @@ struct dri2_egl_surface #endif #ifdef HAVE_DRM_PLATFORM struct gbm_bo *bo; +#endif +#ifdef HAVE_TIZEN_PLATFORM + /* Used to record all the tbm_surface created by tpl_surface and their ages. + * Usually Tizen uses at most triple buffers in tpl_surface (tbm_surface_queue) + * so hardcode the number of color_buffers to 3. + */ + tbm_surface_h tbm_surface; #endif bool locked; int age; -- cgit v1.2.3