summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel A. Vico2019-08-26 14:21:31 -0700
committerMiguel A. Vico2019-08-26 14:29:48 -0700
commite734459dd41c81d42ee01a6ce2272107c605bba4 (patch)
tree69a5fe1659d277a4a1bcef613670342d82c5f02c
parent5469d28233451ebb81bb54db871436c515c87384 (diff)
downloadaur-weston-eglstream.tar.gz
Update to weston 7.0.0
-rw-r--r--.SRCINFO23
-rw-r--r--0001-gl-renderer-Add-EGLDevice-enumeration-support.patch30
-rw-r--r--0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch100
-rw-r--r--0003-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch58
-rw-r--r--0004-backend-drm-Gracefully-handle-vblank-and-flip-invali.patch (renamed from 0004-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch)20
-rw-r--r--0005-backend-drm-Add-support-for-EGLDevice-EGLOutput.patch (renamed from 0005-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch)257
-rw-r--r--0006-compositor-Process-stream-attach-requests-with-wl_eg.patch133
-rw-r--r--PKGBUILD27
8 files changed, 322 insertions, 326 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 0baa1b54c50..ae20dc84331 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = weston-eglstream
pkgdesc = Reference implementation of a Wayland compositor with EGLStream support
- pkgver = 6.0.1
+ pkgver = 7.0.0
pkgrel = 1
url = https://wayland.freedesktop.org/
arch = x86_64
@@ -18,23 +18,24 @@ pkgbase = weston-eglstream
depends = libva
depends = libxcursor
depends = colord
+ depends = pipewire
depends = egl-wayland
provides = weston
conflicts = weston
- source = https://wayland.freedesktop.org/releases/weston-6.0.1.tar.xz
+ source = https://wayland.freedesktop.org/releases/weston-7.0.0.tar.xz
source = 0001-gl-renderer-Add-EGLDevice-enumeration-support.patch
source = 0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch
source = 0003-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch
- source = 0004-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch
- source = 0005-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch
+ source = 0004-backend-drm-Gracefully-handle-vblank-and-flip-invali.patch
+ source = 0005-backend-drm-Add-support-for-EGLDevice-EGLOutput.patch
source = 0006-compositor-Process-stream-attach-requests-with-wl_eg.patch
- sha256sums = bf2f6d5aae2e11cabb6bd69a76bcf9edb084f8c3e14ca769bea7234a513155b4
- sha256sums = 77f798bbed2dfadfdfc3d47631dc9e315570445b247a905466e5b4970e920ced
- sha256sums = c351c903a09ad2608e853e9b052bef6ad9f99478d1940a217cb9854f275ccf08
- sha256sums = 11b744a32b299bab5ac71e86e087f51f0db0aa3e9093c9ca4c88ab79f2e4ea64
- sha256sums = c2781950d5afeeee7ac35027093291242d7dd81295a34d258f80627f86927da9
- sha256sums = 8bc0b1ce255de1c4901c949d6ecac2101820da678d4de43678c8e04b001814af
- sha256sums = e5ddf3567225470a0a8c358374404f1abdf6f5af05be304afd0376b408027c8d
+ sha256sums = a00a6d207b6a45f95f4401c604772a307c3767e5e2beecf3d879110c43909a64
+ sha256sums = 6e22c17327701c1252d57219718bc7dc818161e9d5a3835af30b28ac1dd36a54
+ sha256sums = 1ae44092510c16149bc2717a7847925e73a838ebcee321413bfed9fc5bf1573d
+ sha256sums = 6caacbd301301ae7f4bff61d406531ba094199ecb865edeffe610f7d8e32d6bd
+ sha256sums = f1fd377069025fc7ee904a917bfb5c280c125f2507cf96f755004eb0311176a8
+ sha256sums = 3f310a2a6d0529761ed75b269f3f312b8d16679f3ddac41ba06283d37b3199aa
+ sha256sums = 2d06853eca2d5533213ee46cda60cd3bfebdddbee61ef922af873764b11566a9
pkgname = weston-eglstream
diff --git a/0001-gl-renderer-Add-EGLDevice-enumeration-support.patch b/0001-gl-renderer-Add-EGLDevice-enumeration-support.patch
index bd66c116b69..5f6a4b9bb88 100644
--- a/0001-gl-renderer-Add-EGLDevice-enumeration-support.patch
+++ b/0001-gl-renderer-Add-EGLDevice-enumeration-support.patch
@@ -1,4 +1,4 @@
-From 368a44faef065d4c45415f13c9b51be0d618b3d5 Mon Sep 17 00:00:00 2001
+From 78f72e9eb8e42b2791099c519cf8c47e89c4143f Mon Sep 17 00:00:00 2001
From: "Miguel A. Vico" <mvicomoya@nvidia.com>
Date: Mon, 2 May 2016 15:56:37 +0200
Subject: [PATCH 1/6] gl-renderer: Add EGLDevice enumeration support
@@ -17,15 +17,15 @@ Reviewed-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: Adam Cheney <acheney@nvidia.com>
Reviewed-by: James Jones <jajones@nvidia.com>
---
- libweston/gl-renderer.c | 89 ++++++++++++++++++++++++++++++++++++++++-
- libweston/gl-renderer.h | 8 ++++
+ libweston/renderer-gl/gl-renderer.c | 89 ++++++++++++++++++++++++++++-
+ libweston/renderer-gl/gl-renderer.h | 8 +++
2 files changed, 96 insertions(+), 1 deletion(-)
-diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c
-index a03e45ea..74315347 100644
---- a/libweston/gl-renderer.c
-+++ b/libweston/gl-renderer.c
-@@ -3990,6 +3990,90 @@ gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface)
+diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c
+index 54f8b1cd..a6be2b7b 100644
+--- a/libweston/renderer-gl/gl-renderer.c
++++ b/libweston/renderer-gl/gl-renderer.c
+@@ -4084,6 +4084,90 @@ gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface)
return 0;
}
@@ -116,7 +116,7 @@ index a03e45ea..74315347 100644
WL_EXPORT struct gl_renderer_interface gl_renderer_interface = {
.opaque_attribs = gl_renderer_opaque_attribs,
.alpha_attribs = gl_renderer_alpha_attribs,
-@@ -4001,5 +4085,8 @@ WL_EXPORT struct gl_renderer_interface gl_renderer_interface = {
+@@ -4095,5 +4179,8 @@ WL_EXPORT struct gl_renderer_interface gl_renderer_interface = {
.output_surface = gl_renderer_output_surface,
.output_set_border = gl_renderer_output_set_border,
.create_fence_fd = gl_renderer_create_fence_fd,
@@ -126,11 +126,11 @@ index a03e45ea..74315347 100644
+ .get_devices = gl_renderer_get_devices,
+ .get_drm_device_file = gl_renderer_get_drm_device_file
};
-diff --git a/libweston/gl-renderer.h b/libweston/gl-renderer.h
-index 202702b5..151879da 100644
---- a/libweston/gl-renderer.h
-+++ b/libweston/gl-renderer.h
-@@ -38,6 +38,7 @@
+diff --git a/libweston/renderer-gl/gl-renderer.h b/libweston/renderer-gl/gl-renderer.h
+index b1d6abbe..cd330932 100644
+--- a/libweston/renderer-gl/gl-renderer.h
++++ b/libweston/renderer-gl/gl-renderer.h
+@@ -40,6 +40,7 @@
typedef int EGLint;
typedef int EGLenum;
@@ -138,7 +138,7 @@ index 202702b5..151879da 100644
typedef void *EGLDisplay;
typedef void *EGLSurface;
typedef void *EGLConfig;
-@@ -121,5 +122,12 @@ struct gl_renderer_interface {
+@@ -123,5 +124,12 @@ struct gl_renderer_interface {
int (*create_fence_fd)(struct weston_output *output);
void (*print_egl_error_state)(void);
diff --git a/0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch b/0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch
index 516af4bc331..54c1434006a 100644
--- a/0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch
+++ b/0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch
@@ -1,4 +1,4 @@
-From 75abc9e631667949c2ab8cf46882206d4ed71d0e Mon Sep 17 00:00:00 2001
+From 418000cc187e0ae6c9ab076f0e743cae669e053d Mon Sep 17 00:00:00 2001
From: "Miguel A. Vico" <mvicomoya@nvidia.com>
Date: Mon, 2 May 2016 16:34:01 +0200
Subject: [PATCH 2/6] gl-renderer: Add support for EGLDevice composited frame
@@ -42,15 +42,15 @@ Reviewed-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: Adam Cheney <acheney@nvidia.com>
Reviewed-by: James Jones <jajones@nvidia.com>
---
- libweston/gl-renderer.c | 262 +++++++++++++++++++++++++++++++++++++++-
- libweston/gl-renderer.h | 16 +++
- shared/weston-egl-ext.h | 40 ++++++
+ libweston/renderer-gl/gl-renderer.c | 262 +++++++++++++++++++++++++++-
+ libweston/renderer-gl/gl-renderer.h | 16 ++
+ shared/weston-egl-ext.h | 40 +++++
3 files changed, 315 insertions(+), 3 deletions(-)
-diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c
-index 74315347..f3fb2c65 100644
---- a/libweston/gl-renderer.c
-+++ b/libweston/gl-renderer.c
+diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c
+index a6be2b7b..215ed9b3 100644
+--- a/libweston/renderer-gl/gl-renderer.c
++++ b/libweston/renderer-gl/gl-renderer.c
@@ -101,6 +101,8 @@ struct gl_output_state {
struct gl_border_image borders[4];
enum gl_border_status border_status;
@@ -60,36 +60,36 @@ index 74315347..f3fb2c65 100644
struct weston_matrix output_matrix;
EGLSyncKHR begin_render_sync, end_render_sync;
-@@ -238,6 +240,28 @@ struct gl_renderer {
-
- int has_surfaceless_context;
+@@ -243,6 +245,28 @@ struct gl_renderer {
+ bool has_dmabuf_import;
+ struct wl_list dmabuf_images;
+ PFNEGLGETOUTPUTLAYERSEXTPROC get_output_layers;
+ PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC query_output_layer_attrib;
-+ int has_egl_output_base;
-+ int has_egl_output_drm;
-+ int has_egl_output_drm_flip_event;
++ bool has_egl_output_base;
++ bool has_egl_output_drm;
++ bool has_egl_output_drm_flip_event;
+
+ PFNEGLCREATESTREAMKHRPROC create_stream;
+ PFNEGLDESTROYSTREAMKHRPROC destroy_stream;
-+ int has_egl_stream;
++ bool has_egl_stream;
+
+ PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC create_stream_producer_surface;
-+ int has_egl_stream_producer_eglsurface;
++ bool has_egl_stream_producer_eglsurface;
+
+ PFNEGLSTREAMCONSUMEROUTPUTEXTPROC stream_consumer_output;
-+ int has_egl_stream_consumer_egloutput;
++ bool has_egl_stream_consumer_egloutput;
+
+#ifdef EGL_NV_stream_attrib
+ PFNEGLSTREAMCONSUMERACQUIREATTRIBNVPROC stream_consumer_acquire_attrib;
+#endif
-+ int has_egl_stream_attrib;
-+ int has_egl_stream_acquire_mode;
++ bool has_egl_stream_attrib;
++ bool has_egl_stream_acquire_mode;
+
- int has_dmabuf_import;
- struct wl_list dmabuf_images;
+ bool has_gl_texture_rg;
-@@ -1503,6 +1527,38 @@ gl_renderer_repaint_output(struct weston_output *output,
+ struct gl_shader texture_shader_rgba;
+@@ -1592,6 +1616,38 @@ gl_renderer_repaint_output(struct weston_output *output,
update_buffer_release_fences(compositor, output);
}
@@ -128,7 +128,7 @@ index 74315347..f3fb2c65 100644
static int
gl_renderer_read_pixels(struct weston_output *output,
pixman_format_code_t format, void *pixels,
-@@ -3195,9 +3251,93 @@ gl_renderer_create_window_surface(struct gl_renderer *gr,
+@@ -3284,9 +3340,93 @@ gl_renderer_create_window_surface(struct gl_renderer *gr,
return egl_surface;
}
@@ -223,7 +223,7 @@ index 74315347..f3fb2c65 100644
{
struct gl_output_state *go;
int i;
-@@ -3207,6 +3347,7 @@ gl_renderer_output_create(struct weston_output *output,
+@@ -3296,6 +3436,7 @@ gl_renderer_output_create(struct weston_output *output,
return -1;
go->egl_surface = surface;
@@ -231,7 +231,7 @@ index 74315347..f3fb2c65 100644
for (i = 0; i < BUFFER_DAMAGE_COUNT; i++)
pixman_region32_init(&go->buffer_damage[i]);
-@@ -3244,13 +3385,41 @@ gl_renderer_output_window_create(struct weston_output *output,
+@@ -3333,13 +3474,41 @@ gl_renderer_output_window_create(struct weston_output *output,
return -1;
}
@@ -274,7 +274,7 @@ index 74315347..f3fb2c65 100644
static void
gl_renderer_output_destroy(struct weston_output *output)
{
-@@ -3280,6 +3449,9 @@ gl_renderer_output_destroy(struct weston_output *output)
+@@ -3369,6 +3538,9 @@ gl_renderer_output_destroy(struct weston_output *output)
if (go->end_render_sync != EGL_NO_SYNC_KHR)
gr->destroy_sync(gr->egl_display, go->end_render_sync);
@@ -284,10 +284,10 @@ index 74315347..f3fb2c65 100644
free(go);
}
-@@ -3393,6 +3565,19 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
- (void *) eglGetProcAddress("eglUnbindWaylandDisplayWL");
- gr->query_buffer =
+@@ -3484,6 +3656,19 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
(void *) eglGetProcAddress("eglQueryWaylandBufferWL");
+ gr->set_damage_region =
+ (void *) eglGetProcAddress("eglSetDamageRegionKHR");
+ gr->get_output_layers = (void *) eglGetProcAddress("eglGetOutputLayersEXT");
+ gr->query_output_layer_attrib =
+ (void *) eglGetProcAddress("eglQueryOutputLayerAttribEXT");
@@ -304,38 +304,38 @@ index 74315347..f3fb2c65 100644
extensions =
(const char *) eglQueryString(gr->egl_display, EGL_EXTENSIONS);
-@@ -3467,6 +3652,30 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
+@@ -3561,6 +3746,30 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
"to missing EGL_KHR_wait_sync extension\n");
}
+ if (weston_check_egl_extension(extensions, "EGL_EXT_output_base"))
-+ gr->has_egl_output_base = 1;
++ gr->has_egl_output_base = true;
+
+ if (weston_check_egl_extension(extensions, "EGL_EXT_output_drm"))
-+ gr->has_egl_output_drm = 1;
++ gr->has_egl_output_drm = true;
+
+ if (weston_check_egl_extension(extensions, "EGL_NV_output_drm_flip_event"))
-+ gr->has_egl_output_drm_flip_event = 1;
++ gr->has_egl_output_drm_flip_event = true;
+
+ if (weston_check_egl_extension(extensions, "EGL_KHR_stream"))
-+ gr->has_egl_stream = 1;
++ gr->has_egl_stream = true;
+
+ if (weston_check_egl_extension(extensions, "EGL_KHR_stream_producer_eglsurface"))
-+ gr->has_egl_stream_producer_eglsurface = 1;
++ gr->has_egl_stream_producer_eglsurface = true;
+
+ if (weston_check_egl_extension(extensions, "EGL_EXT_stream_consumer_egloutput"))
-+ gr->has_egl_stream_consumer_egloutput = 1;
++ gr->has_egl_stream_consumer_egloutput = true;
+
+ if (weston_check_egl_extension(extensions, "EGL_NV_stream_attrib"))
-+ gr->has_egl_stream_attrib = 1;
++ gr->has_egl_stream_attrib = true;
+
+ if (weston_check_egl_extension(extensions, "EGL_EXT_stream_acquire_mode"))
-+ gr->has_egl_stream_acquire_mode = 1;
++ gr->has_egl_stream_acquire_mode = true;
+
renderer_setup_egl_client_extensions(gr);
return 0;
-@@ -3492,6 +3701,15 @@ static const EGLint gl_renderer_alpha_attribs[] = {
+@@ -3586,6 +3795,15 @@ static const EGLint gl_renderer_alpha_attribs[] = {
EGL_NONE
};
@@ -351,7 +351,7 @@ index 74315347..f3fb2c65 100644
/** Checks whether a platform EGL client extension is supported
*
-@@ -3565,6 +3783,8 @@ platform_to_extension(EGLenum platform)
+@@ -3659,6 +3877,8 @@ platform_to_extension(EGLenum platform)
return "wayland";
case EGL_PLATFORM_X11_KHR:
return "x11";
@@ -360,7 +360,7 @@ index 74315347..f3fb2c65 100644
default:
assert(0 && "bad EGL platform enum");
}
-@@ -3706,6 +3926,38 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform,
+@@ -3800,6 +4020,38 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform,
if (gr->has_native_fence_sync && gr->has_wait_sync)
ec->capabilities |= WESTON_CAP_EXPLICIT_SYNC;
@@ -399,7 +399,7 @@ index 74315347..f3fb2c65 100644
wl_list_init(&gr->dmabuf_images);
if (gr->has_dmabuf_import) {
gr->base.import_dmabuf = gl_renderer_import_dmabuf;
-@@ -4077,10 +4329,12 @@ gl_renderer_get_drm_device_file(EGLDeviceEXT device,
+@@ -4171,10 +4423,12 @@ gl_renderer_get_drm_device_file(EGLDeviceEXT device,
WL_EXPORT struct gl_renderer_interface gl_renderer_interface = {
.opaque_attribs = gl_renderer_opaque_attribs,
.alpha_attribs = gl_renderer_alpha_attribs,
@@ -412,7 +412,7 @@ index 74315347..f3fb2c65 100644
.output_destroy = gl_renderer_output_destroy,
.output_surface = gl_renderer_output_surface,
.output_set_border = gl_renderer_output_set_border,
-@@ -4088,5 +4342,7 @@ WL_EXPORT struct gl_renderer_interface gl_renderer_interface = {
+@@ -4182,5 +4436,7 @@ WL_EXPORT struct gl_renderer_interface gl_renderer_interface = {
.print_egl_error_state = gl_renderer_print_egl_error_state,
.get_devices = gl_renderer_get_devices,
@@ -421,11 +421,11 @@ index 74315347..f3fb2c65 100644
+
+ .output_stream_flip = gl_renderer_output_stream_flip
};
-diff --git a/libweston/gl-renderer.h b/libweston/gl-renderer.h
-index 151879da..973097bf 100644
---- a/libweston/gl-renderer.h
-+++ b/libweston/gl-renderer.h
-@@ -60,6 +60,7 @@ enum gl_renderer_border_side {
+diff --git a/libweston/renderer-gl/gl-renderer.h b/libweston/renderer-gl/gl-renderer.h
+index cd330932..c5c3e12b 100644
+--- a/libweston/renderer-gl/gl-renderer.h
++++ b/libweston/renderer-gl/gl-renderer.h
+@@ -62,6 +62,7 @@ enum gl_renderer_border_side {
struct gl_renderer_interface {
const EGLint *opaque_attribs;
const EGLint *alpha_attribs;
@@ -433,7 +433,7 @@ index 151879da..973097bf 100644
int (*display_create)(struct weston_compositor *ec,
EGLenum platform,
-@@ -78,6 +79,9 @@ struct gl_renderer_interface {
+@@ -80,6 +81,9 @@ struct gl_renderer_interface {
const EGLint *visual_id,
const int n_ids);
@@ -443,7 +443,7 @@ index 151879da..973097bf 100644
void (*output_destroy)(struct weston_output *output);
EGLSurface (*output_surface)(struct weston_output *output);
-@@ -129,5 +133,17 @@ struct gl_renderer_interface {
+@@ -131,5 +135,17 @@ struct gl_renderer_interface {
int (*get_drm_device_file)(EGLDeviceEXT device,
const char **drm_device_file);
diff --git a/0003-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch b/0003-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch
index 387031d8e98..3b385346c13 100644
--- a/0003-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch
+++ b/0003-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch
@@ -1,4 +1,4 @@
-From 720e02507651efefe3a4a42077f719dd9f74b07c Mon Sep 17 00:00:00 2001
+From ef918a27b0134d44d680c2cd034a1b50a87edc3e Mon Sep 17 00:00:00 2001
From: "Miguel A. Vico" <mvicomoya@nvidia.com>
Date: Thu, 29 Mar 2018 00:15:49 -0700
Subject: [PATCH 3/6] gl-renderer: Add EGL client support for EGLStream frame
@@ -28,14 +28,14 @@ Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com>
Reviewed-by: Adam Cheney <acheney@nvidia.com>
Reviewed-by: James Jones <jajones@nvidia.com>
---
- libweston/gl-renderer.c | 184 ++++++++++++++++++++++++++++++++++++++++
- shared/weston-egl-ext.h | 5 ++
+ libweston/renderer-gl/gl-renderer.c | 184 ++++++++++++++++++++++++++++
+ shared/weston-egl-ext.h | 5 +
2 files changed, 189 insertions(+)
-diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c
-index f3fb2c65..4bae6546 100644
---- a/libweston/gl-renderer.c
-+++ b/libweston/gl-renderer.c
+diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c
+index 215ed9b3..22a64f81 100644
+--- a/libweston/renderer-gl/gl-renderer.c
++++ b/libweston/renderer-gl/gl-renderer.c
@@ -189,6 +189,9 @@ struct gl_surface_state {
int hsub[3]; /* horizontal subsampling per plane */
int vsub[3]; /* vertical subsampling per plane */
@@ -46,32 +46,32 @@ index f3fb2c65..4bae6546 100644
struct weston_surface *surface;
/* Whether this surface was used in the current output repaint.
-@@ -248,6 +251,7 @@ struct gl_renderer {
+@@ -253,6 +256,7 @@ struct gl_renderer {
PFNEGLCREATESTREAMKHRPROC create_stream;
PFNEGLDESTROYSTREAMKHRPROC destroy_stream;
+ PFNEGLQUERYSTREAMKHRPROC query_stream;
- int has_egl_stream;
+ bool has_egl_stream;
PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC create_stream_producer_surface;
-@@ -257,11 +261,16 @@ struct gl_renderer {
- int has_egl_stream_consumer_egloutput;
+@@ -262,11 +266,16 @@ struct gl_renderer {
+ bool has_egl_stream_consumer_egloutput;
#ifdef EGL_NV_stream_attrib
+ PFNEGLCREATESTREAMATTRIBNVPROC create_stream_attrib;
PFNEGLSTREAMCONSUMERACQUIREATTRIBNVPROC stream_consumer_acquire_attrib;
#endif
- int has_egl_stream_attrib;
- int has_egl_stream_acquire_mode;
+ bool has_egl_stream_attrib;
+ bool has_egl_stream_acquire_mode;
+ PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC stream_consumer_gltexture;
-+ int has_egl_stream_consumer_gltexture;
-+ int has_egl_wayland_eglstream;
++ bool has_egl_stream_consumer_gltexture;
++ bool has_egl_wayland_eglstream;
+
- int has_dmabuf_import;
- struct wl_list dmabuf_images;
+ bool has_gl_texture_rg;
-@@ -2528,6 +2537,145 @@ gl_renderer_attach_dmabuf(struct weston_surface *surface,
+ struct gl_shader texture_shader_rgba;
+@@ -2617,6 +2626,145 @@ gl_renderer_attach_dmabuf(struct weston_surface *surface,
surface->is_opaque = dmabuf_is_opaque(dmabuf);
}
@@ -217,9 +217,9 @@ index f3fb2c65..4bae6546 100644
static void
gl_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer)
{
-@@ -2554,6 +2702,12 @@ gl_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer)
+@@ -2643,6 +2791,12 @@ gl_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer)
gs->buffer_type = BUFFER_TYPE_NULL;
- gs->y_inverted = 1;
+ gs->y_inverted = true;
es->is_opaque = false;
+
+ if (gs->egl_stream != EGL_NO_STREAM_KHR) {
@@ -230,7 +230,7 @@ index f3fb2c65..4bae6546 100644
return;
}
-@@ -2561,6 +2715,9 @@ gl_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer)
+@@ -2650,6 +2804,9 @@ gl_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer)
if (shm_buffer)
gl_renderer_attach_shm(es, buffer, shm_buffer);
@@ -240,7 +240,7 @@ index f3fb2c65..4bae6546 100644
else if (gr->has_bind_display &&
gr->query_buffer(gr->egl_display, (void *)buffer->resource,
EGL_TEXTURE_FORMAT, &format))
-@@ -2764,6 +2921,10 @@ surface_state_destroy(struct gl_surface_state *gs, struct gl_renderer *gr)
+@@ -2853,6 +3010,10 @@ surface_state_destroy(struct gl_surface_state *gs, struct gl_renderer *gr)
weston_buffer_reference(&gs->buffer_ref, NULL);
weston_buffer_release_reference(&gs->buffer_release_ref, NULL);
pixman_region32_fini(&gs->texture_damage);
@@ -251,7 +251,7 @@ index f3fb2c65..4bae6546 100644
free(gs);
}
-@@ -2814,6 +2975,8 @@ gl_renderer_create_surface(struct weston_surface *surface)
+@@ -2903,6 +3064,8 @@ gl_renderer_create_surface(struct weston_surface *surface)
gs->surface = surface;
@@ -260,7 +260,7 @@ index f3fb2c65..4bae6546 100644
pixman_region32_init(&gs->texture_damage);
surface->renderer_state = gs;
-@@ -3570,14 +3733,19 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
+@@ -3661,14 +3824,19 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
(void *) eglGetProcAddress("eglQueryOutputLayerAttribEXT");
gr->create_stream = (void *) eglGetProcAddress("eglCreateStreamKHR");
gr->destroy_stream = (void *) eglGetProcAddress("eglDestroyStreamKHR");
@@ -280,20 +280,20 @@ index f3fb2c65..4bae6546 100644
extensions =
(const char *) eglQueryString(gr->egl_display, EGL_EXTENSIONS);
-@@ -3676,6 +3844,12 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
+@@ -3770,6 +3938,12 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
if (weston_check_egl_extension(extensions, "EGL_EXT_stream_acquire_mode"))
- gr->has_egl_stream_acquire_mode = 1;
+ gr->has_egl_stream_acquire_mode = true;
+ if (weston_check_egl_extension(extensions, "EGL_KHR_stream_consumer_gltexture"))
-+ gr->has_egl_stream_consumer_gltexture = 1;
++ gr->has_egl_stream_consumer_gltexture = true;
+
+ if (weston_check_egl_extension(extensions, "EGL_WL_wayland_eglstream"))
-+ gr->has_egl_wayland_eglstream = 1;
++ gr->has_egl_wayland_eglstream = true;
+
renderer_setup_egl_client_extensions(gr);
return 0;
-@@ -3953,6 +4127,16 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform,
+@@ -4047,6 +4221,16 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform,
goto fail_terminate;
}
diff --git a/0004-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch b/0004-backend-drm-Gracefully-handle-vblank-and-flip-invali.patch
index 88b5b578c44..55d84869850 100644
--- a/0004-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch
+++ b/0004-backend-drm-Gracefully-handle-vblank-and-flip-invali.patch
@@ -1,7 +1,7 @@
-From 36ff0ce74aa22e633e0e3821f04cbeea4c25f927 Mon Sep 17 00:00:00 2001
+From f664250b469b329189aef308ce9a65e06a851242 Mon Sep 17 00:00:00 2001
From: "Miguel A. Vico" <mvicomoya@nvidia.com>
Date: Tue, 1 Mar 2016 22:19:14 +0100
-Subject: [PATCH 4/6] compositor-drm: Gracefully handle vblank and flip invalid
+Subject: [PATCH 4/6] backend-drm: Gracefully handle vblank and flip invalid
timestamps
X-NVConfidentiality: public
@@ -18,13 +18,13 @@ situations above.
Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Reviewed-by: Andy Ritger <aritger@nvidia.com>
---
- libweston/compositor-drm.c | 28 +++++++++++++++++++++++++---
+ libweston/backend-drm/drm.c | 28 +++++++++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
-diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
-index f1c5d73a..b9eb2883 100644
---- a/libweston/compositor-drm.c
-+++ b/libweston/compositor-drm.c
+diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c
+index 041a15a5..e631ffb9 100644
+--- a/libweston/backend-drm/drm.c
++++ b/libweston/backend-drm/drm.c
@@ -4,6 +4,7 @@
* Copyright © 2017, 2018 Collabora, Ltd.
* Copyright © 2017, 2018 General Electric Company
@@ -33,7 +33,7 @@ index f1c5d73a..b9eb2883 100644
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
-@@ -1939,6 +1940,19 @@ drm_output_update_complete(struct drm_output *output, uint32_t flags,
+@@ -268,6 +269,19 @@ drm_output_update_complete(struct drm_output *output, uint32_t flags,
ts.tv_sec = sec;
ts.tv_nsec = usec * 1000;
@@ -53,7 +53,7 @@ index f1c5d73a..b9eb2883 100644
weston_output_finish_frame(&output->base, &ts, flags);
/* We can't call this from frame_notify, because the output's
-@@ -3018,8 +3032,16 @@ drm_output_start_repaint_loop(struct weston_output *output_base)
+@@ -501,8 +515,16 @@ drm_output_start_repaint_loop(struct weston_output *output_base)
vbl.request.type |= drm_waitvblank_pipe(output);
ret = drmWaitVBlank(backend->drm.fd, &vbl);
@@ -72,7 +72,7 @@ index f1c5d73a..b9eb2883 100644
ts.tv_sec = vbl.reply.tval_sec;
ts.tv_nsec = vbl.reply.tval_usec * 1000;
-@@ -3040,7 +3062,7 @@ drm_output_start_repaint_loop(struct weston_output *output_base)
+@@ -523,7 +545,7 @@ drm_output_start_repaint_loop(struct weston_output *output_base)
}
}
diff --git a/0005-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch b/0005-backend-drm-Add-support-for-EGLDevice-EGLOutput.patch
index 65341e0f75f..a99037445ac 100644
--- a/0005-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch
+++ b/0005-backend-drm-Add-support-for-EGLDevice-EGLOutput.patch
@@ -1,7 +1,7 @@
-From 2543533568a4ea2b4b86d4eada1a87f8fad49c0d Mon Sep 17 00:00:00 2001
+From 3a9b0e9def60f81b6f550df29a0dbe26fc07aa05 Mon Sep 17 00:00:00 2001
From: "Miguel A. Vico" <mvicomoya@nvidia.com>
-Date: Thu, 28 Jan 2016 19:37:10 +0100
-Subject: [PATCH 5/6] compositor-drm: Add support for EGLDevice+EGLOutput
+Date: Mon, 26 Aug 2019 09:48:49 -0700
+Subject: [PATCH 5/6] backend-drm: Add support for EGLDevice+EGLOutput
X-NVConfidentiality: public
As previously stated, EGLDevice and EGLOutput will provide means
@@ -13,7 +13,7 @@ be used to enumerate and access DRM KMS devices, and EGLOutputLayer
to enumerate and access DRM KMS crtcs and planes.
By using EGLStreams and attaching an EGLOutputLayer consumer
-(representing a DRM KMS crtc or plane) to it, compositor-drm can
+(representing a DRM KMS crtc or plane) to it, backend-drm can
produce final composition frames and present them on a DRM device.
This change adds required logic to support presentation through
@@ -25,18 +25,20 @@ Reviewed-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: Adam Cheney <acheney@nvidia.com>
Reviewed-by: James Jones <jajones@nvidia.com>
---
- compositor/main.c | 2 +
- libweston/compositor-drm.c | 343 +++++++++++++++++++++++++------------
- libweston/compositor-drm.h | 4 +
- libweston/gl-renderer.h | 1 +
- shared/weston-egl-ext.h | 9 +
- 5 files changed, 249 insertions(+), 110 deletions(-)
+ compositor/main.c | 2 +
+ include/libweston/backend-drm.h | 4 +
+ libweston/backend-drm/drm-internal.h | 14 ++
+ libweston/backend-drm/drm.c | 328 ++++++++++++++++++---------
+ libweston/backend-drm/kms.c | 17 +-
+ libweston/renderer-gl/gl-renderer.h | 1 +
+ shared/weston-egl-ext.h | 9 +
+ 7 files changed, 263 insertions(+), 112 deletions(-)
diff --git a/compositor/main.c b/compositor/main.c
-index b6ac6ea3..f101e3d9 100644
+index 13ca00f3..bb6bd84b 100644
--- a/compositor/main.c
+++ b/compositor/main.c
-@@ -665,6 +665,7 @@ usage(int error_code)
+@@ -660,6 +660,7 @@ usage(int error_code)
" --tty=TTY\t\tThe tty to use\n"
" --drm-device=CARD\tThe DRM device to use, e.g. \"card0\".\n"
" --use-pixman\t\tUse the pixman (CPU) renderer\n"
@@ -44,7 +46,7 @@ index b6ac6ea3..f101e3d9 100644
" --current-mode\tPrefer current KMS mode over EDID preferred mode\n\n");
#endif
-@@ -2345,6 +2346,7 @@ load_drm_backend(struct weston_compositor *c,
+@@ -2483,6 +2484,7 @@ load_drm_backend(struct weston_compositor *c,
{ WESTON_OPTION_STRING, "drm-device", 0, &config.specific_device },
{ WESTON_OPTION_BOOLEAN, "current-mode", 0, &drm_use_current_mode },
{ WESTON_OPTION_BOOLEAN, "use-pixman", 0, &use_pixman_ },
@@ -52,31 +54,67 @@ index b6ac6ea3..f101e3d9 100644
};
parse_options(options, ARRAY_LENGTH(options), argc, argv);
-diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
-index b9eb2883..6b0b8be7 100644
---- a/libweston/compositor-drm.c
-+++ b/libweston/compositor-drm.c
-@@ -310,7 +310,10 @@ struct drm_backend {
- int fd;
- char *filename;
- } drm;
+diff --git a/include/libweston/backend-drm.h b/include/libweston/backend-drm.h
+index f6647e28..b2ccce55 100644
+--- a/include/libweston/backend-drm.h
++++ b/include/libweston/backend-drm.h
+@@ -177,6 +177,10 @@ struct weston_drm_backend_config {
+ /** Whether to use the pixman renderer instead of the OpenGL ES renderer. */
+ bool use_pixman;
+
++ /** Whether to use the GL composition based off EGLDevice & friends instead
++ * of GBM. */
++ bool use_egldevice;
+
-+ EGLDeviceEXT egldevice;
- struct gbm_device *gbm;
+ /** The seat to be used for input and output.
+ *
+ * If seat_id is NULL, the seat is taken from XDG_SEAT environment
+diff --git a/libweston/backend-drm/drm-internal.h b/libweston/backend-drm/drm-internal.h
+index 6f5a9880..99767442 100644
+--- a/libweston/backend-drm/drm-internal.h
++++ b/libweston/backend-drm/drm-internal.h
+@@ -58,6 +58,17 @@
+ #include "backend.h"
+ #include "libweston-internal.h"
+
++#ifdef ENABLE_EGL
++
++#include <EGL/egl.h>
++#include <EGL/eglext.h>
++
++#else
+
++typedef void *EGLDeviceEXT;
++
++#endif
++
+ #ifndef DRM_CLIENT_CAP_ASPECT_RATIO
+ #define DRM_CLIENT_CAP_ASPECT_RATIO 4
+ #endif
+@@ -225,6 +236,9 @@ struct drm_backend {
struct wl_listener session_listener;
uint32_t gbm_format;
-@@ -340,6 +343,8 @@ struct drm_backend {
- bool use_pixman;
- bool use_pixman_shadow;
-
-+ int use_egldevice;
++ EGLDeviceEXT egldevice;
++ bool use_egldevice;
+
- struct udev_input input;
-
- int32_t cursor_width;
-@@ -2111,21 +2116,25 @@ drm_output_render_gl(struct drm_output_state *state, pixman_region32_t *damage)
+ /* we need these parameters in order to not fail drmModeAddFB2()
+ * due to out of bounds dimensions, and then mistakenly set
+ * sprites_are_broken:
+diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c
+index e631ffb9..b975c444 100644
+--- a/libweston/backend-drm/drm.c
++++ b/libweston/backend-drm/drm.c
+@@ -69,7 +69,7 @@
+ #include "linux-dmabuf-unstable-v1-server-protocol.h"
+ #include "linux-explicit-synchronization.h"
+
+-static struct gl_renderer_interface *gl_renderer;
++struct gl_renderer_interface *gl_renderer;
+
+ static const char default_seat[] = "seat0";
+
+@@ -302,21 +302,25 @@ drm_output_render_gl(struct drm_output_state *state, pixman_region32_t *damage)
output->base.compositor->renderer->repaint_output(&output->base,
damage);
@@ -115,7 +153,7 @@ index b9eb2883..6b0b8be7 100644
return ret;
}
-@@ -2168,7 +2177,9 @@ drm_output_render(struct drm_output_state *state, pixman_region32_t *damage)
+@@ -359,7 +363,9 @@ drm_output_render(struct drm_output_state *state, pixman_region32_t *damage)
if (scanout_state->fb)
return;
@@ -126,35 +164,7 @@ index b9eb2883..6b0b8be7 100644
scanout_plane->state_cur->fb &&
(scanout_plane->state_cur->fb->type == BUFFER_GBM_SURFACE ||
scanout_plane->state_cur->fb->type == BUFFER_PIXMAN_DUMB) &&
-@@ -2364,9 +2375,14 @@ drm_output_apply_state_legacy(struct drm_output_state *state)
- output->crtc_id, scanout_state->plane->plane_id,
- pinfo ? pinfo->drm_format_name : "UNKNOWN");
-
-- if (drmModePageFlip(backend->drm.fd, output->crtc_id,
-- scanout_state->fb->fb_id,
-- DRM_MODE_PAGE_FLIP_EVENT, output) < 0) {
-+ if (backend->use_egldevice)
-+ ret = gl_renderer->output_stream_flip(&output->base, output);
-+ else
-+ ret = drmModePageFlip(backend->drm.fd, output->crtc_id,
-+ scanout_state->fb->fb_id,
-+ DRM_MODE_PAGE_FLIP_EVENT, output);
-+
-+ if (ret < 0) {
- weston_log("queueing pageflip failed: %s\n", strerror(errno));
- goto err;
- }
-@@ -4184,7 +4200,8 @@ init_kms_caps(struct drm_backend *b)
- b->universal_planes ? "supports" : "does not support");
-
- #ifdef HAVE_DRM_ATOMIC
-- if (b->universal_planes && !getenv("WESTON_DISABLE_ATOMIC")) {
-+ /* FIXME: Atomic modeset is not yet fully supported with streams */
-+ if (b->universal_planes && !getenv("WESTON_DISABLE_ATOMIC") && !b->use_egldevice) {
- ret = drmGetCap(b->drm.fd, DRM_CAP_CRTC_IN_VBLANK_EVENT, &cap);
- if (ret != 0)
- cap = 0;
-@@ -4227,11 +4244,6 @@ create_gbm_device(int fd)
+@@ -707,11 +713,6 @@ create_gbm_device(int fd)
{
struct gbm_device *gbm;
@@ -166,7 +176,7 @@ index b9eb2883..6b0b8be7 100644
/* GBM will load a dri driver, but even though they need symbols from
* libglapi, in some version of Mesa they are not linked to it. Since
* only the gl-renderer module links to it, the call above won't make
-@@ -4244,6 +4256,40 @@ create_gbm_device(int fd)
+@@ -724,6 +725,40 @@ create_gbm_device(int fd)
return gbm;
}
@@ -207,7 +217,7 @@ index b9eb2883..6b0b8be7 100644
/* When initializing EGL, if the preferred buffer format isn't available
* we may be able to substitute an ARGB format for an XRGB one.
*
-@@ -4270,38 +4316,62 @@ fallback_format_for(uint32_t format)
+@@ -750,38 +785,62 @@ fallback_format_for(uint32_t format)
static int
drm_backend_create_gl_renderer(struct drm_backend *b)
{
@@ -217,17 +227,18 @@ index b9eb2883..6b0b8be7 100644
- 0,
- };
- int n_formats = 2;
-+ if (b->use_egldevice) {
-+ EGLint device_platform_attribs[] = {
-+ EGL_DRM_MASTER_FD_EXT, b->drm.fd,
-+ EGL_NONE
-+ };
-
+-
- if (format[1])
- n_formats = 3;
- if (gl_renderer->display_create(b->compositor,
- EGL_PLATFORM_GBM_KHR,
- (void *)b->gbm,
++ if (b->use_egldevice) {
++ EGLint device_platform_attribs[] = {
++ EGL_DRM_MASTER_FD_EXT, b->drm.fd,
++ EGL_NONE
++ };
++
+ return gl_renderer->display_create(
+ b->compositor,
+ EGL_PLATFORM_DEVICE_EXT,
@@ -291,7 +302,7 @@ index b9eb2883..6b0b8be7 100644
return -1;
}
-@@ -5068,71 +5138,98 @@ err:
+@@ -1354,71 +1413,98 @@ err:
static int
drm_output_init_egl(struct drm_output *output, struct drm_backend *b)
{
@@ -321,7 +332,7 @@ index b9eb2883..6b0b8be7 100644
+ output->crtc_id) < 0) {
+ weston_log("failed to create gl renderer output stream "
+ "state\n");
-+ drm_fb_destroy_dumb(output->dumb[0]);
++ drm_fb_unref(output->dumb[0]);
+ output->dumb[0] = NULL;
+ return -1;
+ }
@@ -342,19 +353,19 @@ index b9eb2883..6b0b8be7 100644
+ struct weston_mode *mode = output->base.current_mode;
+ struct drm_plane *plane = output->scanout_plane;
+ unsigned int i;
-
-- if (i == plane->count_formats) {
-- weston_log("format 0x%x not supported by output %s\n",
-- output->gbm_format, output->base.name);
-- return -1;
-- }
++
+ assert(output->gbm_surface == NULL);
+
+ for (i = 0; i < plane->count_formats; i++) {
+ if (plane->formats[i].format == output->gbm_format)
+ break;
+ }
-+
+
+- if (i == plane->count_formats) {
+- weston_log("format 0x%x not supported by output %s\n",
+- output->gbm_format, output->base.name);
+- return -1;
+- }
+ if (i == plane->count_formats) {
+ weston_log("format 0x%x not supported by output %s\n",
+ output->gbm_format, output->base.name);
@@ -446,7 +457,7 @@ index b9eb2883..6b0b8be7 100644
return 0;
}
-@@ -5145,8 +5242,9 @@ drm_output_fini_egl(struct drm_output *output)
+@@ -1431,8 +1517,9 @@ drm_output_fini_egl(struct drm_output *output)
/* Destroying the GBM surface will destroy all our GBM buffers,
* regardless of refcount. Ensure we destroy them here. */
if (!b->shutting_down &&
@@ -458,7 +469,7 @@ index b9eb2883..6b0b8be7 100644
drm_plane_state_free(output->scanout_plane->state_cur, true);
output->scanout_plane->state_cur =
drm_plane_state_alloc(NULL, output->scanout_plane);
-@@ -5154,8 +5252,17 @@ drm_output_fini_egl(struct drm_output *output)
+@@ -1440,8 +1527,17 @@ drm_output_fini_egl(struct drm_output *output)
}
gl_renderer->output_destroy(&output->base);
@@ -478,7 +489,7 @@ index b9eb2883..6b0b8be7 100644
drm_output_fini_cursor_egl(output);
}
-@@ -7060,6 +7167,11 @@ recorder_binding(struct weston_keyboard *keyboard, const struct timespec *time,
+@@ -2854,6 +2950,11 @@ recorder_binding(struct weston_keyboard *keyboard, const struct timespec *time,
struct drm_output *output;
int width, height;
@@ -490,7 +501,7 @@ index b9eb2883..6b0b8be7 100644
output = container_of(b->compositor->output_list.next,
struct drm_output, base.link);
-@@ -7118,11 +7230,20 @@ switch_to_gl_renderer(struct drm_backend *b)
+@@ -2912,11 +3013,20 @@ switch_to_gl_renderer(struct drm_backend *b)
weston_log("Switching to GL renderer\n");
@@ -516,7 +527,7 @@ index b9eb2883..6b0b8be7 100644
}
wl_list_for_each(output, &b->compositor->output_list, base.link)
-@@ -7131,7 +7252,8 @@ switch_to_gl_renderer(struct drm_backend *b)
+@@ -2925,7 +3035,8 @@ switch_to_gl_renderer(struct drm_backend *b)
b->compositor->renderer->destroy(b->compositor);
if (drm_backend_create_gl_renderer(b) < 0) {
@@ -526,34 +537,66 @@ index b9eb2883..6b0b8be7 100644
weston_log("Failed to create GL renderer. Quitting.\n");
/* FIXME: we need a function to shutdown cleanly */
assert(0);
-@@ -7461,6 +7583,7 @@ drm_backend_create(struct weston_compositor *compositor,
+@@ -3257,6 +3368,7 @@ drm_backend_create(struct weston_compositor *compositor,
b->use_pixman = config->use_pixman;
b->pageflip_timeout = config->pageflip_timeout;
b->use_pixman_shadow = config->use_pixman_shadow;
+ b->use_egldevice = config->use_egldevice;
- b->debug = weston_compositor_add_debug_scope(compositor, "drm-backend",
- "Debug messages from DRM/KMS backend\n",
-diff --git a/libweston/compositor-drm.h b/libweston/compositor-drm.h
-index 71a306fd..435581d9 100644
---- a/libweston/compositor-drm.h
-+++ b/libweston/compositor-drm.h
-@@ -177,6 +177,10 @@ struct weston_drm_backend_config {
- /** Whether to use the pixman renderer instead of the OpenGL ES renderer. */
- bool use_pixman;
+ b->debug = weston_compositor_add_log_scope(compositor->weston_log_ctx,
+ "drm-backend",
+diff --git a/libweston/backend-drm/kms.c b/libweston/backend-drm/kms.c
+index b5b1ade6..d25df495 100644
+--- a/libweston/backend-drm/kms.c
++++ b/libweston/backend-drm/kms.c
+@@ -41,11 +41,14 @@
+ #include "drm-internal.h"
+ #include "pixel-formats.h"
+ #include "presentation-time-server-protocol.h"
++#include "renderer-gl/gl-renderer.h"
+
+ #ifndef DRM_FORMAT_MOD_LINEAR
+ #define DRM_FORMAT_MOD_LINEAR 0
+ #endif
-+ /** Whether to use the GL composition based off EGLDevice & friends instead
-+ * of GBM. */
-+ bool use_egldevice;
++extern struct gl_renderer_interface *gl_renderer;
+
- /** The seat to be used for input and output.
- *
- * If seat_id is NULL, the seat is taken from XDG_SEAT environment
-diff --git a/libweston/gl-renderer.h b/libweston/gl-renderer.h
-index 973097bf..233c9282 100644
---- a/libweston/gl-renderer.h
-+++ b/libweston/gl-renderer.h
-@@ -45,6 +45,7 @@ typedef void *EGLConfig;
+ struct drm_property_enum_info plane_type_enums[] = {
+ [WDRM_PLANE_TYPE_PRIMARY] = {
+ .name = "Primary",
+@@ -656,9 +659,14 @@ drm_output_apply_state_legacy(struct drm_output_state *state)
+ output->crtc_id, scanout_state->plane->plane_id,
+ pinfo ? pinfo->drm_format_name : "UNKNOWN");
+
+- if (drmModePageFlip(backend->drm.fd, output->crtc_id,
+- scanout_state->fb->fb_id,
+- DRM_MODE_PAGE_FLIP_EVENT, output) < 0) {
++ if (backend->use_egldevice)
++ ret = gl_renderer->output_stream_flip(&output->base, output);
++ else
++ ret = drmModePageFlip(backend->drm.fd, output->crtc_id,
++ scanout_state->fb->fb_id,
++ DRM_MODE_PAGE_FLIP_EVENT, output);
++
++ if (ret < 0) {
+ weston_log("queueing pageflip failed: %s\n", strerror(errno));
+ goto err;
+ }
+@@ -1335,7 +1343,8 @@ init_kms_caps(struct drm_backend *b)
+ b->universal_planes ? "supports" : "does not support");
+
+ #ifdef HAVE_DRM_ATOMIC
+- if (b->universal_planes && !getenv("WESTON_DISABLE_ATOMIC")) {
++ /* FIXME: Atomic modeset is not yet fully supported with streams */
++ if (b->universal_planes && !getenv("WESTON_DISABLE_ATOMIC") && !b->use_egldevice) {
+ ret = drmGetCap(b->drm.fd, DRM_CAP_CRTC_IN_VBLANK_EVENT, &cap);
+ if (ret != 0)
+ cap = 0;
+diff --git a/libweston/renderer-gl/gl-renderer.h b/libweston/renderer-gl/gl-renderer.h
+index c5c3e12b..ac6ea7f2 100644
+--- a/libweston/renderer-gl/gl-renderer.h
++++ b/libweston/renderer-gl/gl-renderer.h
+@@ -47,6 +47,7 @@ typedef void *EGLConfig;
typedef intptr_t EGLNativeDisplayType;
typedef intptr_t EGLNativeWindowType;
#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0)
@@ -562,7 +605,7 @@ index 973097bf..233c9282 100644
#endif /* ENABLE_EGL */
diff --git a/shared/weston-egl-ext.h b/shared/weston-egl-ext.h
-index 96982e2d..e4e10ef9 100644
+index 96982e2d..975ee0ed 100644
--- a/shared/weston-egl-ext.h
+++ b/shared/weston-egl-ext.h
@@ -208,6 +208,10 @@ typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC) (EGLDisplay dpy,
@@ -581,7 +624,7 @@ index 96982e2d..e4e10ef9 100644
#define EGL_PLATFORM_DEVICE_EXT 0x313F
+/* EGL_DRM_MASTER_FD_EXT and EGL_NONE enum values are also kept to allow
-+ * compositor-drm.c to build with EGLDevice and EGLStream support */
++ * backend-drm/drm.c to build with EGLDevice and EGLStream support */
+#define EGL_DRM_MASTER_FD_EXT 0x333C
+#define EGL_NONE 0x3038
+
diff --git a/0006-compositor-Process-stream-attach-requests-with-wl_eg.patch b/0006-compositor-Process-stream-attach-requests-with-wl_eg.patch
index ac73e3238fa..8cc01634ee1 100644
--- a/0006-compositor-Process-stream-attach-requests-with-wl_eg.patch
+++ b/0006-compositor-Process-stream-attach-requests-with-wl_eg.patch
@@ -1,4 +1,4 @@
-From b2d91b7d969be5b7c42274fbf81093006d2edfef Mon Sep 17 00:00:00 2001
+From 7b4d70dc7f5024e80656d9facdb0bc834d91adb9 Mon Sep 17 00:00:00 2001
From: "Miguel A. Vico" <mvicomoya@nvidia.com>
Date: Thu, 18 May 2017 14:35:36 -0700
Subject: [PATCH 6/6] compositor: Process stream attach requests with
@@ -32,49 +32,15 @@ requests.
Signed-off-by: Ashutosh Agarwal <asagarwal@nvidia.com>
Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
---
- Makefile.am | 14 ++++
- compositor/meson.build | 1 +
- configure.ac | 4 ++
- libweston/compositor.c | 78 +++++++++++++++++++++
- libweston/compositor.h | 4 ++
- libweston/gl-renderer.c | 147 +++++++++++++++++++++++++---------------
- protocol/meson.build | 7 ++
- 7 files changed, 201 insertions(+), 54 deletions(-)
+ compositor/meson.build | 1 +
+ include/libweston/libweston.h | 4 +
+ libweston/compositor.c | 78 +++++++++++++++
+ libweston/renderer-gl/gl-renderer.c | 147 ++++++++++++++++++----------
+ protocol/meson.build | 7 ++
+ 5 files changed, 183 insertions(+), 54 deletions(-)
-diff --git a/Makefile.am b/Makefile.am
-index 5407b593..0bad6976 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -192,6 +192,11 @@ nodist_libweston_@LIBWESTON_MAJOR@_la_SOURCES = \
-
- BUILT_SOURCES += $(nodist_libweston_@LIBWESTON_MAJOR@_la_SOURCES)
-
-+nodist_libweston_eglstreams_@LIBWESTON_MAJOR@_la_SOURCES = \
-+ protocol/wayland-eglstream-controller-server-protocol.h
-+
-+BUILT_SOURCES += $(nodist_libweston_eglstreams_@LIBWESTON_MAJOR@_la_SOURCES)
-+
- bin_PROGRAMS += weston
-
- weston_LDFLAGS = -export-dynamic
-@@ -1736,6 +1741,15 @@ protocol/%-server-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostabili
- protocol/%-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostability,$$*)/$$(call protoname,$$*)/$$*.xml
- $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < $< > $@
-
-+protocol/%-protocol.c : $(WAYLAND_EGLSTREAM_PROTOCOLS_DATADIR)/%.xml
-+ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
-+
-+protocol/%-server-protocol.h : $(WAYLAND_EGLSTREAM_PROTOCOLS_DATADIR)/%.xml
-+ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header < $< > $@
-+
-+protocol/%-client-protocol.h : $(WAYLAND_EGLSTREAM_PROTOCOLS_DATADIR)/%.xml
-+ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < $< > $@
-+
- protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
- $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
-
diff --git a/compositor/meson.build b/compositor/meson.build
-index 3824d6ff..075b0bcd 100644
+index 61860a7a..f11d55e8 100644
--- a/compositor/meson.build
+++ b/compositor/meson.build
@@ -9,6 +9,7 @@ srcs_weston = [
@@ -85,23 +51,23 @@ index 3824d6ff..075b0bcd 100644
]
deps_weston = [
dep_libshared,
-diff --git a/configure.ac b/configure.ac
-index 68cdc86c..53b64bea 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -261,6 +261,10 @@ PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 1.17],
- [ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`])
- AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
-
-+PKG_CHECK_MODULES(WAYLAND_EGLSTREAM_PROTOCOLS, [wayland-eglstream-protocols],
-+ [ac_wayland_eglstream_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-eglstream-protocols`])
-+AC_SUBST(WAYLAND_EGLSTREAM_PROTOCOLS_DATADIR, $ac_wayland_eglstream_protocols_pkgdatadir)
+diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h
+index 5be8ef05..178bb071 100644
+--- a/include/libweston/libweston.h
++++ b/include/libweston/libweston.h
+@@ -917,6 +917,10 @@ struct weston_renderer {
+ void (*query_dmabuf_modifiers)(struct weston_compositor *ec,
+ int format, uint64_t **modifiers,
+ int *num_modifiers);
+
- AC_ARG_ENABLE(wayland-compositor, [ --enable-wayland-compositor],,
- enable_wayland_compositor=yes)
- AM_CONDITIONAL(ENABLE_WAYLAND_COMPOSITOR,
++ /** Create weston endpoint of an EGLStream & attach a consumer to it */
++ bool (*attach_eglstream_consumer)(struct weston_surface *es,
++ struct wl_resource *wl_eglstream);
+ };
+
+ enum weston_capability {
diff --git a/libweston/compositor.c b/libweston/compositor.c
-index e117479c..3a7b4cec 100644
+index 85327159..0a6a56e2 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -3,6 +3,7 @@
@@ -112,15 +78,15 @@ index e117479c..3a7b4cec 100644
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
-@@ -71,6 +72,7 @@
- #include "version.h"
- #include "plugin-registry.h"
+@@ -74,6 +75,7 @@
#include "pixel-formats.h"
+ #include "backend.h"
+ #include "libweston-internal.h"
+#include "wayland-eglstream-controller-server-protocol.h"
- #define DEFAULT_REPAINT_WINDOW 7 /* milliseconds */
+ #include "weston-log-internal.h"
-@@ -6473,6 +6475,80 @@ bind_presentation(struct wl_client *client,
+@@ -6850,6 +6852,80 @@ bind_presentation(struct wl_client *client,
wp_presentation_send_clock_id(resource, compositor->presentation_clock);
}
@@ -201,34 +167,19 @@ index e117479c..3a7b4cec 100644
static void
compositor_bind(struct wl_client *client,
void *data, uint32_t version, uint32_t id)
-@@ -6840,6 +6916,8 @@ weston_compositor_create(struct wl_display *display, void *user_data)
+@@ -7230,6 +7306,8 @@ weston_compositor_create(struct wl_display *display,
ec, bind_presentation))
goto fail;
+ init_eglstream_controller(ec->wl_display);
+
- if (weston_debug_compositor_create(ec) < 0)
+ if (weston_log_ctx_compositor_setup(ec, log_ctx) < 0)
goto fail;
-diff --git a/libweston/compositor.h b/libweston/compositor.h
-index 3af1443a..d7ed3ff2 100644
---- a/libweston/compositor.h
-+++ b/libweston/compositor.h
-@@ -926,6 +926,10 @@ struct weston_renderer {
- void (*query_dmabuf_modifiers)(struct weston_compositor *ec,
- int format, uint64_t **modifiers,
- int *num_modifiers);
-+
-+ /** Create weston endpoint of an EGLStream & attach a consumer to it */
-+ bool (*attach_eglstream_consumer)(struct weston_surface *es,
-+ struct wl_resource *wl_eglstream);
- };
-
- enum weston_capability {
-diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c
-index 4bae6546..e66bbd4c 100644
---- a/libweston/gl-renderer.c
-+++ b/libweston/gl-renderer.c
+diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c
+index 22a64f81..b4a88da3 100644
+--- a/libweston/renderer-gl/gl-renderer.c
++++ b/libweston/renderer-gl/gl-renderer.c
@@ -1,7 +1,7 @@
/*
* Copyright © 2012 Intel Corporation
@@ -238,7 +189,7 @@ index 4bae6546..e66bbd4c 100644
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
-@@ -2537,18 +2537,9 @@ gl_renderer_attach_dmabuf(struct weston_surface *surface,
+@@ -2626,18 +2626,9 @@ gl_renderer_attach_dmabuf(struct weston_surface *surface,
surface->is_opaque = dmabuf_is_opaque(dmabuf);
}
@@ -260,7 +211,7 @@ index 4bae6546..e66bbd4c 100644
{
#ifdef EGL_NV_stream_attrib
struct weston_compositor *ec = es->compositor;
-@@ -2557,65 +2548,111 @@ gl_renderer_attach_stream_texture(struct weston_surface *es,
+@@ -2646,65 +2637,111 @@ gl_renderer_attach_stream_texture(struct weston_surface *es,
EGLStreamKHR stream = EGL_NO_STREAM_KHR;
EGLAttrib stream_attribs[] = {
#ifdef EGL_WL_wayland_eglstream
@@ -413,7 +364,7 @@ index 4bae6546..e66bbd4c 100644
}
/* At this point we should have a valid stream handle */
-@@ -4044,6 +4081,8 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform,
+@@ -4138,6 +4175,8 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform,
gr->base.surface_get_content_size =
gl_renderer_surface_get_content_size;
gr->base.surface_copy_content = gl_renderer_surface_copy_content;
@@ -423,11 +374,11 @@ index 4bae6546..e66bbd4c 100644
/* extension_suffix is supported */
diff --git a/protocol/meson.build b/protocol/meson.build
-index 34026ff9..37642298 100644
+index 1228d15b..e47d0a6c 100644
--- a/protocol/meson.build
+++ b/protocol/meson.build
-@@ -7,6 +7,9 @@ prog_scanner = find_program(dep_scanner.get_pkgconfig_variable('wayland_scanner'
- dep_wp = dependency('wayland-protocols', version: '>= 1.17')
+@@ -4,6 +4,9 @@ prog_scanner = find_program(dep_scanner.get_pkgconfig_variable('wayland_scanner'
+ dep_wp = dependency('wayland-protocols', version: '>= 1.18')
dir_wp_base = dep_wp.get_pkgconfig_variable('pkgdatadir')
+dep_wep = dependency('wayland-eglstream-protocols')
@@ -436,7 +387,7 @@ index 34026ff9..37642298 100644
install_data(
[
'weston-debug.xml',
-@@ -37,6 +40,7 @@ generated_protocols = [
+@@ -35,6 +38,7 @@ generated_protocols = [
[ 'xdg-output', 'v1' ],
[ 'xdg-shell', 'v6' ],
[ 'xdg-shell', 'stable' ],
@@ -444,7 +395,7 @@ index 34026ff9..37642298 100644
]
foreach proto: generated_protocols
-@@ -44,6 +48,9 @@ foreach proto: generated_protocols
+@@ -42,6 +46,9 @@ foreach proto: generated_protocols
if proto[1] == 'internal'
base_file = proto_name
xml_path = '@0@.xml'.format(proto_name)
diff --git a/PKGBUILD b/PKGBUILD
index 5e88a76e24f..f249b8948ba 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,14 +6,15 @@
# Contributor: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
pkgname=weston-eglstream
-pkgver=6.0.1
+pkgver=7.0.0
pkgrel=1
pkgdesc='Reference implementation of a Wayland compositor with EGLStream support'
arch=('x86_64')
url='https://wayland.freedesktop.org/'
license=('MIT')
depends=('wayland' 'libxkbcommon' 'libinput' 'libjpeg-turbo' 'libwebp'
- 'libegl' 'libgles' 'pango' 'libva' 'libxcursor' 'colord' 'egl-wayland')
+ 'libegl' 'libgles' 'pango' 'libva' 'libxcursor' 'colord' 'pipewire'
+ 'egl-wayland')
makedepends=('meson' 'wayland-protocols')
provides=('weston')
conflicts=('weston')
@@ -21,24 +22,24 @@ source=("https://wayland.freedesktop.org/releases/weston-$pkgver.tar.xz"
'0001-gl-renderer-Add-EGLDevice-enumeration-support.patch'
'0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch'
'0003-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch'
- '0004-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch'
- '0005-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch'
+ '0004-backend-drm-Gracefully-handle-vblank-and-flip-invali.patch'
+ '0005-backend-drm-Add-support-for-EGLDevice-EGLOutput.patch'
'0006-compositor-Process-stream-attach-requests-with-wl_eg.patch')
-sha256sums=('bf2f6d5aae2e11cabb6bd69a76bcf9edb084f8c3e14ca769bea7234a513155b4'
- '77f798bbed2dfadfdfc3d47631dc9e315570445b247a905466e5b4970e920ced'
- 'c351c903a09ad2608e853e9b052bef6ad9f99478d1940a217cb9854f275ccf08'
- '11b744a32b299bab5ac71e86e087f51f0db0aa3e9093c9ca4c88ab79f2e4ea64'
- 'c2781950d5afeeee7ac35027093291242d7dd81295a34d258f80627f86927da9'
- '8bc0b1ce255de1c4901c949d6ecac2101820da678d4de43678c8e04b001814af'
- 'e5ddf3567225470a0a8c358374404f1abdf6f5af05be304afd0376b408027c8d')
+sha256sums=('a00a6d207b6a45f95f4401c604772a307c3767e5e2beecf3d879110c43909a64'
+ '6e22c17327701c1252d57219718bc7dc818161e9d5a3835af30b28ac1dd36a54'
+ '1ae44092510c16149bc2717a7847925e73a838ebcee321413bfed9fc5bf1573d'
+ '6caacbd301301ae7f4bff61d406531ba094199ecb865edeffe610f7d8e32d6bd'
+ 'f1fd377069025fc7ee904a917bfb5c280c125f2507cf96f755004eb0311176a8'
+ '3f310a2a6d0529761ed75b269f3f312b8d16679f3ddac41ba06283d37b3199aa'
+ '2d06853eca2d5533213ee46cda60cd3bfebdddbee61ef922af873764b11566a9')
prepare() {
cd weston-$pkgver
patch -Np1 -i "${srcdir}/0001-gl-renderer-Add-EGLDevice-enumeration-support.patch"
patch -Np1 -i "${srcdir}/0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch"
patch -Np1 -i "${srcdir}/0003-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch"
- patch -Np1 -i "${srcdir}/0004-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch"
- patch -Np1 -i "${srcdir}/0005-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch"
+ patch -Np1 -i "${srcdir}/0004-backend-drm-Gracefully-handle-vblank-and-flip-invali.patch"
+ patch -Np1 -i "${srcdir}/0005-backend-drm-Add-support-for-EGLDevice-EGLOutput.patch"
patch -Np1 -i "${srcdir}/0006-compositor-Process-stream-attach-requests-with-wl_eg.patch"
}