diff options
12 files changed, 121 insertions, 413 deletions
@@ -1,7 +1,7 @@ pkgbase = weston-eglstream pkgdesc = Reference implementation of a Wayland compositor with EGLStream support - pkgver = 6.0.0 - pkgrel = 2 + pkgver = 6.0.1 + pkgrel = 1 url = https://wayland.freedesktop.org/ arch = x86_64 license = MIT @@ -21,28 +21,20 @@ pkgbase = weston-eglstream depends = egl-wayland provides = weston conflicts = weston - source = https://wayland.freedesktop.org/releases/weston-6.0.0.tar.xz - source = 0001-configure-meson-Tmp-fix-for-gobject-2.0-libs-missing.patch - source = 0002-gl-renderer-Add-EGLDevice-enumeration-support.patch - source = 0003-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch - source = 0004-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch - source = 0005-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch - source = 0006-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch - source = 0007-compositor-Process-stream-attach-requests-with-wl_eg.patch - source = 0008-simple-egl-Do-not-set-EGL-up-until-XDG-setup-is-comp.patch - source = 0009-gl-renderer-Try-realizing-EGLStream-before-EGLImage-.patch - source = 0010-compositor-drm-Cleanup-scanout-plane-state-upon-head.patch - sha256sums = 546323a90607b3bd7f48809ea9d76e64cd09718102f2deca6d95aa59a882e612 - sha256sums = b7492f80795e4039b234c20ea67dc14956336af8370531358013fb50d00b42e1 - sha256sums = 4ef5e24aec18efe9296b73c70897ec1af679bb6b68c8d7961692c2a6eb45542d - sha256sums = c732aa688948fe1fa0b55ffce137f4aa480866b339664c44be6c3b2597b2cc9e - sha256sums = 2e2ba999c8c86bd31ef177a73a3bbbcaaddab1a7fe0e712b571a3564dcb7aff1 - sha256sums = 491a825ad126be82848726ba03b97a972b8281e7dbe9262689023c59c59d0d87 - sha256sums = 6db13c8252e37e6374231b5b9105c2344e6cd73af254fbf35ee303b36495210e - sha256sums = bf36c7348a7c43d76f0043452578d93242594c157c0349b6b866ef93c7363fdd - sha256sums = dff1c611b59889fd3d149e4837c25da0252b15ec064d61533b7e21fbc49a6d4d - sha256sums = 7a6140a2b82d4e654fcc4fbf72d4469797f1b36723936ce8ab177b9066528faf - sha256sums = 164631eba83d2069f71760c44bb687640757189c9e8e7276bc7cc741f6afa9f5 + source = https://wayland.freedesktop.org/releases/weston-6.0.1.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 = 0006-compositor-Process-stream-attach-requests-with-wl_eg.patch + sha256sums = bf2f6d5aae2e11cabb6bd69a76bcf9edb084f8c3e14ca769bea7234a513155b4 + sha256sums = 77f798bbed2dfadfdfc3d47631dc9e315570445b247a905466e5b4970e920ced + sha256sums = c351c903a09ad2608e853e9b052bef6ad9f99478d1940a217cb9854f275ccf08 + sha256sums = 11b744a32b299bab5ac71e86e087f51f0db0aa3e9093c9ca4c88ab79f2e4ea64 + sha256sums = c2781950d5afeeee7ac35027093291242d7dd81295a34d258f80627f86927da9 + sha256sums = 8bc0b1ce255de1c4901c949d6ecac2101820da678d4de43678c8e04b001814af + sha256sums = e5ddf3567225470a0a8c358374404f1abdf6f5af05be304afd0376b408027c8d pkgname = weston-eglstream diff --git a/0001-configure-meson-Tmp-fix-for-gobject-2.0-libs-missing.patch b/0001-configure-meson-Tmp-fix-for-gobject-2.0-libs-missing.patch deleted file mode 100644 index b8c145a9f8d2..000000000000 --- a/0001-configure-meson-Tmp-fix-for-gobject-2.0-libs-missing.patch +++ /dev/null @@ -1,54 +0,0 @@ -From e1486fee47785c094e93eca336684ab38bcb16bc Mon Sep 17 00:00:00 2001 -From: "Miguel A. Vico" <mvicomoya@nvidia.com> -Date: Tue, 26 Mar 2019 15:34:12 -0700 -Subject: [PATCH 01/10] configure/meson: Tmp fix for gobject-2.0 libs missing - in pango pkgconfig -X-NVConfidentiality: public - -This fixes the following build error, until the pango pkgconfig is -restored to also include the corresponding flags to link against -gobject-2.0: - - /usr/bin/ld: clients/weston_editor-editor.o: undefined reference to symbol 'g_object_unref' - /usr/bin/ld: /usr/lib/libgobject-2.0.so.0: error adding symbols: DSO missing from command line - collect2: error: ld returned 1 exit status - -Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> ---- - configure.ac | 2 +- - shared/meson.build | 5 +++-- - 2 files changed, 4 insertions(+), 3 deletions(-) - -diff --git a/configure.ac b/configure.ac -index c05ad011..425ba238 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -503,7 +503,7 @@ if test x$enable_clients = xyes; then - [AC_ERROR([cairo-egl not used because $CAIRO_EGL_PKG_ERRORS])])], - [have_cairo_egl=no]) - -- PKG_CHECK_MODULES(PANGO, [pangocairo pango glib-2.0 >= 2.36], [have_pango=yes], [have_pango=no]) -+ PKG_CHECK_MODULES(PANGO, [pangocairo pango glib-2.0 >= 2.36 gobject-2.0 >= 2.36], [have_pango=yes], [have_pango=no]) - fi - - AC_ARG_ENABLE(resize-optimization, -diff --git a/shared/meson.build b/shared/meson.build -index 5b0d8d13..c90be7de 100644 ---- a/shared/meson.build -+++ b/shared/meson.build -@@ -37,9 +37,10 @@ deps_cairo_shared = [ - dep_pango = dependency('pango', required: false) - dep_pangocairo = dependency('pangocairo', required: false) - dep_glib = dependency('glib-2.0', version: '>= 2.36', required: false) -+dep_gobject = dependency('gobject-2.0', version: '>= 2.36', required: false) - --if dep_pango.found() and dep_pangocairo.found() and dep_glib.found() -- deps_cairo_shared += [ dep_pango, dep_pangocairo, dep_glib ] -+if dep_pango.found() and dep_pangocairo.found() and dep_glib.found() and dep_gobject.found() -+ deps_cairo_shared += [ dep_pango, dep_pangocairo, dep_glib, dep_gobject ] - config_h.set('HAVE_PANGO', '1') - endif - --- -2.21.0 - diff --git a/0002-gl-renderer-Add-EGLDevice-enumeration-support.patch b/0001-gl-renderer-Add-EGLDevice-enumeration-support.patch index 295f2e584a6f..bd66c116b69c 100644 --- a/0002-gl-renderer-Add-EGLDevice-enumeration-support.patch +++ b/0001-gl-renderer-Add-EGLDevice-enumeration-support.patch @@ -1,7 +1,7 @@ -From ed68f6d00e47bdca93859b36a3c78f6fb555cd25 Mon Sep 17 00:00:00 2001 +From 368a44faef065d4c45415f13c9b51be0d618b3d5 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 02/10] gl-renderer: Add EGLDevice enumeration support +Subject: [PATCH 1/6] gl-renderer: Add EGLDevice enumeration support X-NVConfidentiality: public EGLDevice provides means to enumerate native devices. diff --git a/0003-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch b/0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch index ddab64571cfd..516af4bc3312 100644 --- a/0003-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch +++ b/0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch @@ -1,7 +1,7 @@ -From 1df7a9d5e4222a40885bd8e46b33f5dd4525e93b Mon Sep 17 00:00:00 2001 +From 75abc9e631667949c2ab8cf46882206d4ed71d0e 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 03/10] gl-renderer: Add support for EGLDevice composited frame +Subject: [PATCH 2/6] gl-renderer: Add support for EGLDevice composited frame presentation X-NVConfidentiality: public diff --git a/0004-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch b/0003-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch index ad9c2ecb3d03..387031d8e989 100644 --- a/0004-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch +++ b/0003-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch @@ -1,7 +1,7 @@ -From 1c422fb24eadccabd3ed07de15923acc982aa6a1 Mon Sep 17 00:00:00 2001 +From 720e02507651efefe3a4a42077f719dd9f74b07c 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 04/10] gl-renderer: Add EGL client support for EGLStream frame +Subject: [PATCH 3/6] gl-renderer: Add EGL client support for EGLStream frame presentation X-NVConfidentiality: public @@ -20,16 +20,20 @@ Note that some unpublished EGL extensions were needed: - EGL_WL_wayland_eglstream: https://github.com/aritger/eglstreams-kms-example/blob/master/proposed-extensions/EGL_WL_wayland_eglstream.txt +[ekurzinger: - Try realizing EGLStream before EGLImage buffer since + libnvidia-egl-wayland now reports EGL_TEXTURE_FORMAT] + Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> +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 | 183 +++++++++++++++++++++++++++++++++++++++- + libweston/gl-renderer.c | 184 ++++++++++++++++++++++++++++++++++++++++ shared/weston-egl-ext.h | 5 ++ - 2 files changed, 187 insertions(+), 1 deletion(-) + 2 files changed, 189 insertions(+) diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c -index f3fb2c65..5e594535 100644 +index f3fb2c65..4bae6546 100644 --- a/libweston/gl-renderer.c +++ b/libweston/gl-renderer.c @@ -189,6 +189,9 @@ struct gl_surface_state { @@ -226,16 +230,17 @@ index f3fb2c65..5e594535 100644 return; } -@@ -2567,7 +2721,7 @@ gl_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer) - gl_renderer_attach_egl(es, buffer, format); - else if ((dmabuf = linux_dmabuf_buffer_get(buffer->resource))) - gl_renderer_attach_dmabuf(es, buffer, dmabuf); -- else { -+ else if (!gl_renderer_attach_stream_texture(es, buffer)) { - weston_log("unhandled buffer type!\n"); - if (gr->has_bind_display) { - weston_log("eglQueryWaylandBufferWL failed\n"); -@@ -2764,6 +2918,10 @@ surface_state_destroy(struct gl_surface_state *gs, struct gl_renderer *gr) +@@ -2561,6 +2715,9 @@ gl_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer) + + if (shm_buffer) + gl_renderer_attach_shm(es, buffer, shm_buffer); ++ else if (gl_renderer_attach_stream_texture(es, buffer)) ++ /* The stream texture is attached. Nothing else to be done here */ ++ ((void)0); + 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) weston_buffer_reference(&gs->buffer_ref, NULL); weston_buffer_release_reference(&gs->buffer_release_ref, NULL); pixman_region32_fini(&gs->texture_damage); @@ -246,7 +251,7 @@ index f3fb2c65..5e594535 100644 free(gs); } -@@ -2814,6 +2972,8 @@ gl_renderer_create_surface(struct weston_surface *surface) +@@ -2814,6 +2975,8 @@ gl_renderer_create_surface(struct weston_surface *surface) gs->surface = surface; @@ -255,7 +260,7 @@ index f3fb2c65..5e594535 100644 pixman_region32_init(&gs->texture_damage); surface->renderer_state = gs; -@@ -3570,14 +3730,19 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) +@@ -3570,14 +3733,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"); @@ -275,7 +280,7 @@ index f3fb2c65..5e594535 100644 extensions = (const char *) eglQueryString(gr->egl_display, EGL_EXTENSIONS); -@@ -3676,6 +3841,12 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) +@@ -3676,6 +3844,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; @@ -288,7 +293,7 @@ index f3fb2c65..5e594535 100644 renderer_setup_egl_client_extensions(gr); return 0; -@@ -3953,6 +4124,16 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, +@@ -3953,6 +4127,16 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, goto fail_terminate; } diff --git a/0005-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch b/0004-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch index 6316023471d4..88b5b578c44f 100644 --- a/0005-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch +++ b/0004-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch @@ -1,8 +1,8 @@ -From 85e804380738537bbc9afeb658c1218040c68cfa Mon Sep 17 00:00:00 2001 +From 36ff0ce74aa22e633e0e3821f04cbeea4c25f927 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 05/10] compositor-drm: Gracefully handle vblank and flip - invalid timestamps +Subject: [PATCH 4/6] compositor-drm: Gracefully handle vblank and flip invalid + timestamps X-NVConfidentiality: public Instant query for vblank timestamp may always fail, resulting in @@ -22,7 +22,7 @@ Reviewed-by: Andy Ritger <aritger@nvidia.com> 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c -index c1101105..77dbb077 100644 +index f1c5d73a..b9eb2883 100644 --- a/libweston/compositor-drm.c +++ b/libweston/compositor-drm.c @@ -4,6 +4,7 @@ @@ -33,7 +33,7 @@ index c1101105..77dbb077 100644 * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the -@@ -1937,6 +1938,19 @@ drm_output_update_complete(struct drm_output *output, uint32_t flags, +@@ -1939,6 +1940,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 c1101105..77dbb077 100644 weston_output_finish_frame(&output->base, &ts, flags); /* We can't call this from frame_notify, because the output's -@@ -3010,8 +3024,16 @@ drm_output_start_repaint_loop(struct weston_output *output_base) +@@ -3018,8 +3032,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 c1101105..77dbb077 100644 ts.tv_sec = vbl.reply.tval_sec; ts.tv_nsec = vbl.reply.tval_usec * 1000; -@@ -3032,7 +3054,7 @@ drm_output_start_repaint_loop(struct weston_output *output_base) +@@ -3040,7 +3062,7 @@ drm_output_start_repaint_loop(struct weston_output *output_base) } } diff --git a/0006-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch b/0005-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch index 7baf62dba47b..65341e0f75f9 100644 --- a/0006-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch +++ b/0005-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch @@ -1,7 +1,7 @@ -From 73bc85fbde7c65d3a667982301877238d3c02bf8 Mon Sep 17 00:00:00 2001 +From 2543533568a4ea2b4b86d4eada1a87f8fad49c0d 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 06/10] compositor-drm: Add support for EGLDevice+EGLOutput +Subject: [PATCH 5/6] compositor-drm: Add support for EGLDevice+EGLOutput X-NVConfidentiality: public As previously stated, EGLDevice and EGLOutput will provide means @@ -26,17 +26,17 @@ Reviewed-by: Adam Cheney <acheney@nvidia.com> Reviewed-by: James Jones <jajones@nvidia.com> --- compositor/main.c | 2 + - libweston/compositor-drm.c | 336 +++++++++++++++++++++++++------------ + libweston/compositor-drm.c | 343 +++++++++++++++++++++++++------------ libweston/compositor-drm.h | 4 + libweston/gl-renderer.h | 1 + shared/weston-egl-ext.h | 9 + - 5 files changed, 245 insertions(+), 107 deletions(-) + 5 files changed, 249 insertions(+), 110 deletions(-) diff --git a/compositor/main.c b/compositor/main.c -index c3206783..103305e3 100644 +index b6ac6ea3..f101e3d9 100644 --- a/compositor/main.c +++ b/compositor/main.c -@@ -664,6 +664,7 @@ usage(int error_code) +@@ -665,6 +665,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,16 +44,16 @@ index c3206783..103305e3 100644 " --current-mode\tPrefer current KMS mode over EDID preferred mode\n\n"); #endif -@@ -2341,6 +2342,7 @@ load_drm_backend(struct weston_compositor *c, +@@ -2345,6 +2346,7 @@ load_drm_backend(struct weston_compositor *c, { WESTON_OPTION_STRING, "drm-device", 0, &config.specific_device }, - { WESTON_OPTION_BOOLEAN, "current-mode", 0, &wet->drm_use_current_mode }, + { WESTON_OPTION_BOOLEAN, "current-mode", 0, &drm_use_current_mode }, { WESTON_OPTION_BOOLEAN, "use-pixman", 0, &use_pixman_ }, + { WESTON_OPTION_BOOLEAN, "use-egldevice", 0, &config.use_egldevice }, }; parse_options(options, ARRAY_LENGTH(options), argc, argv); diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c -index 77dbb077..100b3050 100644 +index b9eb2883..6b0b8be7 100644 --- a/libweston/compositor-drm.c +++ b/libweston/compositor-drm.c @@ -310,7 +310,10 @@ struct drm_backend { @@ -76,13 +76,14 @@ index 77dbb077..100b3050 100644 struct udev_input input; int32_t cursor_width; -@@ -2109,20 +2114,24 @@ drm_output_render_gl(struct drm_output_state *state, pixman_region32_t *damage) +@@ -2111,21 +2116,25 @@ drm_output_render_gl(struct drm_output_state *state, pixman_region32_t *damage) output->base.compositor->renderer->repaint_output(&output->base, damage); - bo = gbm_surface_lock_front_buffer(output->gbm_surface); - if (!bo) { -- weston_log("failed to lock front buffer: %m\n"); +- weston_log("failed to lock front buffer: %s\n", +- strerror(errno)); - return NULL; - } + if (b->use_egldevice) @@ -90,7 +91,8 @@ index 77dbb077..100b3050 100644 + else { + bo = gbm_surface_lock_front_buffer(output->gbm_surface); + if (!bo) { -+ weston_log("failed to lock front buffer: %m\n"); ++ weston_log("failed to lock front buffer: %s\n", ++ strerror(errno)); + return NULL; + } @@ -113,7 +115,7 @@ index 77dbb077..100b3050 100644 return ret; } -@@ -2165,7 +2174,9 @@ drm_output_render(struct drm_output_state *state, pixman_region32_t *damage) +@@ -2168,7 +2177,9 @@ drm_output_render(struct drm_output_state *state, pixman_region32_t *damage) if (scanout_state->fb) return; @@ -124,7 +126,7 @@ index 77dbb077..100b3050 100644 scanout_plane->state_cur->fb && (scanout_plane->state_cur->fb->type == BUFFER_GBM_SURFACE || scanout_plane->state_cur->fb->type == BUFFER_PIXMAN_DUMB) && -@@ -2358,9 +2369,14 @@ drm_output_apply_state_legacy(struct drm_output_state *state) +@@ -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"); @@ -139,10 +141,10 @@ index 77dbb077..100b3050 100644 + DRM_MODE_PAGE_FLIP_EVENT, output); + + if (ret < 0) { - weston_log("queueing pageflip failed: %m\n"); + weston_log("queueing pageflip failed: %s\n", strerror(errno)); goto err; } -@@ -4174,7 +4190,8 @@ init_kms_caps(struct drm_backend *b) +@@ -4184,7 +4200,8 @@ init_kms_caps(struct drm_backend *b) b->universal_planes ? "supports" : "does not support"); #ifdef HAVE_DRM_ATOMIC @@ -152,7 +154,7 @@ index 77dbb077..100b3050 100644 ret = drmGetCap(b->drm.fd, DRM_CAP_CRTC_IN_VBLANK_EVENT, &cap); if (ret != 0) cap = 0; -@@ -4217,11 +4234,6 @@ create_gbm_device(int fd) +@@ -4227,11 +4244,6 @@ create_gbm_device(int fd) { struct gbm_device *gbm; @@ -164,7 +166,7 @@ index 77dbb077..100b3050 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 -@@ -4234,6 +4246,40 @@ create_gbm_device(int fd) +@@ -4244,6 +4256,40 @@ create_gbm_device(int fd) return gbm; } @@ -205,7 +207,7 @@ index 77dbb077..100b3050 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. * -@@ -4260,38 +4306,62 @@ fallback_format_for(uint32_t format) +@@ -4270,38 +4316,62 @@ fallback_format_for(uint32_t format) static int drm_backend_create_gl_renderer(struct drm_backend *b) { @@ -289,7 +291,7 @@ index 77dbb077..100b3050 100644 return -1; } -@@ -5058,71 +5128,98 @@ err: +@@ -5068,71 +5138,98 @@ err: static int drm_output_init_egl(struct drm_output *output, struct drm_backend *b) { @@ -444,7 +446,19 @@ index 77dbb077..100b3050 100644 return 0; } -@@ -5144,8 +5241,17 @@ drm_output_fini_egl(struct drm_output *output) +@@ -5145,8 +5242,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 && +- output->scanout_plane->state_cur->fb && +- output->scanout_plane->state_cur->fb->type == BUFFER_GBM_SURFACE) { ++ ((output->scanout_plane->state_cur->fb && ++ output->scanout_plane->state_cur->fb->type == BUFFER_GBM_SURFACE) || ++ b->use_egldevice)) { + 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) } gl_renderer->output_destroy(&output->base); @@ -464,7 +478,7 @@ index 77dbb077..100b3050 100644 drm_output_fini_cursor_egl(output); } -@@ -7050,6 +7156,11 @@ recorder_binding(struct weston_keyboard *keyboard, const struct timespec *time, +@@ -7060,6 +7167,11 @@ recorder_binding(struct weston_keyboard *keyboard, const struct timespec *time, struct drm_output *output; int width, height; @@ -476,7 +490,7 @@ index 77dbb077..100b3050 100644 output = container_of(b->compositor->output_list.next, struct drm_output, base.link); -@@ -7108,11 +7219,20 @@ switch_to_gl_renderer(struct drm_backend *b) +@@ -7118,11 +7230,20 @@ switch_to_gl_renderer(struct drm_backend *b) weston_log("Switching to GL renderer\n"); @@ -502,7 +516,7 @@ index 77dbb077..100b3050 100644 } wl_list_for_each(output, &b->compositor->output_list, base.link) -@@ -7121,7 +7241,8 @@ switch_to_gl_renderer(struct drm_backend *b) +@@ -7131,7 +7252,8 @@ switch_to_gl_renderer(struct drm_backend *b) b->compositor->renderer->destroy(b->compositor); if (drm_backend_create_gl_renderer(b) < 0) { @@ -512,7 +526,7 @@ index 77dbb077..100b3050 100644 weston_log("Failed to create GL renderer. Quitting.\n"); /* FIXME: we need a function to shutdown cleanly */ assert(0); -@@ -7451,6 +7572,7 @@ drm_backend_create(struct weston_compositor *compositor, +@@ -7461,6 +7583,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; diff --git a/0007-compositor-Process-stream-attach-requests-with-wl_eg.patch b/0006-compositor-Process-stream-attach-requests-with-wl_eg.patch index de8625a5ae18..ac73e3238faf 100644 --- a/0007-compositor-Process-stream-attach-requests-with-wl_eg.patch +++ b/0006-compositor-Process-stream-attach-requests-with-wl_eg.patch @@ -1,7 +1,7 @@ -From 5076208fd90be98deff790f0f4429cfe54f1457a Mon Sep 17 00:00:00 2001 +From b2d91b7d969be5b7c42274fbf81093006d2edfef 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 07/10] compositor: Process stream attach requests with +Subject: [PATCH 6/6] compositor: Process stream attach requests with wl_eglstream_controller X-NVConfidentiality: public @@ -74,7 +74,7 @@ index 5407b593..0bad6976 100644 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@ diff --git a/compositor/meson.build b/compositor/meson.build -index d5d7282f..7655ef5a 100644 +index 3824d6ff..075b0bcd 100644 --- a/compositor/meson.build +++ b/compositor/meson.build @@ -9,6 +9,7 @@ srcs_weston = [ @@ -86,7 +86,7 @@ index d5d7282f..7655ef5a 100644 deps_weston = [ dep_libshared, diff --git a/configure.ac b/configure.ac -index 425ba238..5c1932bc 100644 +index 68cdc86c..53b64bea 100644 --- a/configure.ac +++ b/configure.ac @@ -261,6 +261,10 @@ PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 1.17], @@ -101,7 +101,7 @@ index 425ba238..5c1932bc 100644 enable_wayland_compositor=yes) AM_CONDITIONAL(ENABLE_WAYLAND_COMPOSITOR, diff --git a/libweston/compositor.c b/libweston/compositor.c -index d87522e7..947739f8 100644 +index e117479c..3a7b4cec 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -3,6 +3,7 @@ @@ -201,7 +201,7 @@ index d87522e7..947739f8 100644 static void compositor_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id) -@@ -6836,6 +6912,8 @@ weston_compositor_create(struct wl_display *display, void *user_data) +@@ -6840,6 +6916,8 @@ weston_compositor_create(struct wl_display *display, void *user_data) ec, bind_presentation)) goto fail; @@ -211,10 +211,10 @@ index d87522e7..947739f8 100644 goto fail; diff --git a/libweston/compositor.h b/libweston/compositor.h -index a5223c28..1c39c50c 100644 +index 3af1443a..d7ed3ff2 100644 --- a/libweston/compositor.h +++ b/libweston/compositor.h -@@ -925,6 +925,10 @@ struct weston_renderer { +@@ -926,6 +926,10 @@ struct weston_renderer { void (*query_dmabuf_modifiers)(struct weston_compositor *ec, int format, uint64_t **modifiers, int *num_modifiers); @@ -226,7 +226,7 @@ index a5223c28..1c39c50c 100644 enum weston_capability { diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c -index 5e594535..8265a712 100644 +index 4bae6546..e66bbd4c 100644 --- a/libweston/gl-renderer.c +++ b/libweston/gl-renderer.c @@ -1,7 +1,7 @@ @@ -413,7 +413,7 @@ index 5e594535..8265a712 100644 } /* At this point we should have a valid stream handle */ -@@ -4041,6 +4078,8 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, +@@ -4044,6 +4081,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; diff --git a/0008-simple-egl-Do-not-set-EGL-up-until-XDG-setup-is-comp.patch b/0008-simple-egl-Do-not-set-EGL-up-until-XDG-setup-is-comp.patch deleted file mode 100644 index e75238640d8c..000000000000 --- a/0008-simple-egl-Do-not-set-EGL-up-until-XDG-setup-is-comp.patch +++ /dev/null @@ -1,159 +0,0 @@ -From a49fdfc86296f3e6a05388c7bc7ea806be49d919 Mon Sep 17 00:00:00 2001 -From: "Miguel A. Vico" <mvicomoya@nvidia.com> -Date: Mon, 27 Feb 2017 15:31:35 -0800 -Subject: [PATCH 08/10] simple-egl: Do not set EGL up until XDG setup is - complete -X-NVConfidentiality: public - -There is nothing that prohibits the underlying EGL_PLATFORM_WAYLAND -implementation to attach a buffer or commit surfaces right after the -Wayland EGLSurface has been created. - -Since XDG Shell v6 imposes that no buffer attachments or surface commits -must be done before a configure is complete, Wayland clients shouldn't -start setting EGL up until XDG setup is complete. - -Related bug: - - https://bugs.freedesktop.org/show_bug.cgi?id=98731 - -Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> ---- - clients/simple-egl.c | 64 +++++++++++++++++++++++--------------------- - 1 file changed, 33 insertions(+), 31 deletions(-) - -diff --git a/clients/simple-egl.c b/clients/simple-egl.c -index 8a086ef0..2d409c70 100644 ---- a/clients/simple-egl.c -+++ b/clients/simple-egl.c -@@ -217,11 +217,32 @@ init_egl(struct display *display, struct window *window) - if (display->swap_buffers_with_damage) - printf("has EGL_EXT_buffer_age and %s\n", swap_damage_ext_to_entrypoint[i].extension); - -+ window->egl_surface = -+ weston_platform_create_egl_surface(display->egl.dpy, -+ display->egl.conf, -+ window->native, NULL); -+ -+ ret = eglMakeCurrent(window->display->egl.dpy, window->egl_surface, -+ window->egl_surface, window->display->egl.ctx); -+ assert(ret == EGL_TRUE); -+ -+ if (!window->frame_sync) -+ eglSwapInterval(display->egl.dpy, 0); -+ - } - - static void --fini_egl(struct display *display) -+fini_egl(struct display *display, struct window *window) - { -+ /* Required, otherwise segfault in egl_dri2.c: dri2_make_current() -+ * on eglReleaseThread(). */ -+ eglMakeCurrent(window->display->egl.dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, -+ EGL_NO_CONTEXT); -+ -+ weston_platform_destroy_egl_surface(window->display->egl.dpy, -+ window->egl_surface); -+ wl_egl_window_destroy(window->native); -+ - eglTerminate(display->egl.dpy); - eglReleaseThread(); - } -@@ -358,7 +379,6 @@ static void - create_surface(struct window *window) - { - struct display *display = window->display; -- EGLBoolean ret; - - window->surface = wl_compositor_create_surface(display->compositor); - -@@ -366,10 +386,6 @@ create_surface(struct window *window) - wl_egl_window_create(window->surface, - window->geometry.width, - window->geometry.height); -- window->egl_surface = -- weston_platform_create_egl_surface(display->egl.dpy, -- display->egl.conf, -- window->native, NULL); - - window->xdg_surface = xdg_wm_base_get_xdg_surface(display->wm_base, - window->surface); -@@ -386,13 +402,6 @@ create_surface(struct window *window) - window->wait_for_configure = true; - wl_surface_commit(window->surface); - -- ret = eglMakeCurrent(window->display->egl.dpy, window->egl_surface, -- window->egl_surface, window->display->egl.ctx); -- assert(ret == EGL_TRUE); -- -- if (!window->frame_sync) -- eglSwapInterval(display->egl.dpy, 0); -- - if (!display->wm_base) - return; - -@@ -403,15 +412,6 @@ create_surface(struct window *window) - static void - destroy_surface(struct window *window) - { -- /* Required, otherwise segfault in egl_dri2.c: dri2_make_current() -- * on eglReleaseThread(). */ -- eglMakeCurrent(window->display->egl.dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, -- EGL_NO_CONTEXT); -- -- weston_platform_destroy_egl_surface(window->display->egl.dpy, -- window->egl_surface); -- wl_egl_window_destroy(window->native); -- - if (window->xdg_toplevel) - xdg_toplevel_destroy(window->xdg_toplevel); - if (window->xdg_surface) -@@ -846,9 +846,7 @@ main(int argc, char **argv) - - wl_display_roundtrip(display.display); - -- init_egl(&display, &window); - create_surface(&window); -- init_gl(&window); - - display.cursor_surface = - wl_compositor_create_surface(display.compositor); -@@ -858,23 +856,27 @@ main(int argc, char **argv) - sigint.sa_flags = SA_RESETHAND; - sigaction(SIGINT, &sigint, NULL); - -+ /* We must assure XDG setup is complete before setting EGL up */ -+ while (running && window.wait_for_configure) { -+ wl_display_dispatch(display.display); -+ } -+ -+ init_egl(&display, &window); -+ init_gl(&window); -+ - /* The mainloop here is a little subtle. Redrawing will cause - * EGL to read events so we can just call - * wl_display_dispatch_pending() to handle any events that got - * queued up as a side effect. */ - while (running && ret != -1) { -- if (window.wait_for_configure) { -- wl_display_dispatch(display.display); -- } else { -- wl_display_dispatch_pending(display.display); -- redraw(&window, NULL, 0); -- } -+ wl_display_dispatch_pending(display.display); -+ redraw(&window, NULL, 0); - } - - fprintf(stderr, "simple-egl exiting\n"); - -+ fini_egl(&display, &window); - destroy_surface(&window); -- fini_egl(&display); - - wl_surface_destroy(display.cursor_surface); - if (display.cursor_theme) --- -2.21.0 - diff --git a/0009-gl-renderer-Try-realizing-EGLStream-before-EGLImage-.patch b/0009-gl-renderer-Try-realizing-EGLStream-before-EGLImage-.patch deleted file mode 100644 index 7423e1e26b1a..000000000000 --- a/0009-gl-renderer-Try-realizing-EGLStream-before-EGLImage-.patch +++ /dev/null @@ -1,39 +0,0 @@ -From ef60350defbf06da7d37352a31e6a80a2f732ebe Mon Sep 17 00:00:00 2001 -From: Erik Kurzinger <ekurzinger@nvidia.com> -Date: Fri, 12 Apr 2019 21:31:46 +0000 -Subject: [PATCH 09/10] gl-renderer: Try realizing EGLStream before EGLImage - buffer -X-NVConfidentiality: public - -Currently, it is assumed that if querying the EGL_TEXTURE_FORMAT of a -Wayland buffer succeeds it is an EGLImage. However, this assumption will no -longer hold on upcoming versions of the NVIDIA EGL Wayland driver which -will include support for querying this attribute for EGLStream buffers as -well. Hence, we need to check if buffers are EGLStreams first. ---- - libweston/gl-renderer.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c -index 8265a712..c1a88a11 100644 ---- a/libweston/gl-renderer.c -+++ b/libweston/gl-renderer.c -@@ -2752,13 +2752,14 @@ gl_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer) - - if (shm_buffer) - gl_renderer_attach_shm(es, buffer, shm_buffer); -+ else if (gl_renderer_attach_stream_texture(es, buffer)); - else if (gr->has_bind_display && - gr->query_buffer(gr->egl_display, (void *)buffer->resource, - EGL_TEXTURE_FORMAT, &format)) - gl_renderer_attach_egl(es, buffer, format); - else if ((dmabuf = linux_dmabuf_buffer_get(buffer->resource))) - gl_renderer_attach_dmabuf(es, buffer, dmabuf); -- else if (!gl_renderer_attach_stream_texture(es, buffer)) { -+ else { - weston_log("unhandled buffer type!\n"); - if (gr->has_bind_display) { - weston_log("eglQueryWaylandBufferWL failed\n"); --- -2.21.0 - diff --git a/0010-compositor-drm-Cleanup-scanout-plane-state-upon-head.patch b/0010-compositor-drm-Cleanup-scanout-plane-state-upon-head.patch deleted file mode 100644 index 7d4d3d064182..000000000000 --- a/0010-compositor-drm-Cleanup-scanout-plane-state-upon-head.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 0868ca341affb984bfcd86cf578bb9734367dae7 Mon Sep 17 00:00:00 2001 -From: "Miguel A. Vico" <mvicomoya@nvidia.com> -Date: Fri, 21 Jun 2019 13:51:11 -0700 -Subject: [PATCH 10/10] compositor-drm: Cleanup scanout plane state upon head - detach -X-NVConfidentiality: public - -When using EGLStreams and a head is detached, the scanout plane buffers -will be destroyed upon output destruction as the stream is torn down. -That needs to be reflected in the drm structures that keep track of all -this. - -This change ensures the scanout plane state is freed appropriately upon -output destruction when using EGLStreams as well as GBM. - -Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> ---- - libweston/compositor-drm.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c -index 100b3050..17f2e103 100644 ---- a/libweston/compositor-drm.c -+++ b/libweston/compositor-drm.c -@@ -5232,8 +5232,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 && -- output->scanout_plane->state_cur->fb && -- output->scanout_plane->state_cur->fb->type == BUFFER_GBM_SURFACE) { -+ ((output->scanout_plane->state_cur->fb && -+ output->scanout_plane->state_cur->fb->type == BUFFER_GBM_SURFACE) || -+ b->use_egldevice)) { - drm_plane_state_free(output->scanout_plane->state_cur, true); - output->scanout_plane->state_cur = - drm_plane_state_alloc(NULL, output->scanout_plane); --- -2.21.0 - @@ -6,8 +6,8 @@ # Contributor: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> pkgname=weston-eglstream -pkgver=6.0.0 -pkgrel=2 +pkgver=6.0.1 +pkgrel=1 pkgdesc='Reference implementation of a Wayland compositor with EGLStream support' arch=('x86_64') url='https://wayland.freedesktop.org/' @@ -18,40 +18,28 @@ makedepends=('meson' 'wayland-protocols') provides=('weston') conflicts=('weston') source=("https://wayland.freedesktop.org/releases/weston-$pkgver.tar.xz" - '0001-configure-meson-Tmp-fix-for-gobject-2.0-libs-missing.patch' - '0002-gl-renderer-Add-EGLDevice-enumeration-support.patch' - '0003-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch' - '0004-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch' - '0005-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch' - '0006-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch' - '0007-compositor-Process-stream-attach-requests-with-wl_eg.patch' - '0008-simple-egl-Do-not-set-EGL-up-until-XDG-setup-is-comp.patch' - '0009-gl-renderer-Try-realizing-EGLStream-before-EGLImage-.patch' - '0010-compositor-drm-Cleanup-scanout-plane-state-upon-head.patch') -sha256sums=('546323a90607b3bd7f48809ea9d76e64cd09718102f2deca6d95aa59a882e612' - 'b7492f80795e4039b234c20ea67dc14956336af8370531358013fb50d00b42e1' - '4ef5e24aec18efe9296b73c70897ec1af679bb6b68c8d7961692c2a6eb45542d' - 'c732aa688948fe1fa0b55ffce137f4aa480866b339664c44be6c3b2597b2cc9e' - '2e2ba999c8c86bd31ef177a73a3bbbcaaddab1a7fe0e712b571a3564dcb7aff1' - '491a825ad126be82848726ba03b97a972b8281e7dbe9262689023c59c59d0d87' - '6db13c8252e37e6374231b5b9105c2344e6cd73af254fbf35ee303b36495210e' - 'bf36c7348a7c43d76f0043452578d93242594c157c0349b6b866ef93c7363fdd' - 'dff1c611b59889fd3d149e4837c25da0252b15ec064d61533b7e21fbc49a6d4d' - '7a6140a2b82d4e654fcc4fbf72d4469797f1b36723936ce8ab177b9066528faf' - '164631eba83d2069f71760c44bb687640757189c9e8e7276bc7cc741f6afa9f5') + '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' + '0006-compositor-Process-stream-attach-requests-with-wl_eg.patch') +sha256sums=('bf2f6d5aae2e11cabb6bd69a76bcf9edb084f8c3e14ca769bea7234a513155b4' + '77f798bbed2dfadfdfc3d47631dc9e315570445b247a905466e5b4970e920ced' + 'c351c903a09ad2608e853e9b052bef6ad9f99478d1940a217cb9854f275ccf08' + '11b744a32b299bab5ac71e86e087f51f0db0aa3e9093c9ca4c88ab79f2e4ea64' + 'c2781950d5afeeee7ac35027093291242d7dd81295a34d258f80627f86927da9' + '8bc0b1ce255de1c4901c949d6ecac2101820da678d4de43678c8e04b001814af' + 'e5ddf3567225470a0a8c358374404f1abdf6f5af05be304afd0376b408027c8d') prepare() { cd weston-$pkgver - patch -Np1 -i "${srcdir}/0001-configure-meson-Tmp-fix-for-gobject-2.0-libs-missing.patch" - patch -Np1 -i "${srcdir}/0002-gl-renderer-Add-EGLDevice-enumeration-support.patch" - patch -Np1 -i "${srcdir}/0003-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch" - patch -Np1 -i "${srcdir}/0004-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch" - patch -Np1 -i "${srcdir}/0005-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch" - patch -Np1 -i "${srcdir}/0006-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch" - patch -Np1 -i "${srcdir}/0007-compositor-Process-stream-attach-requests-with-wl_eg.patch" - patch -Np1 -i "${srcdir}/0008-simple-egl-Do-not-set-EGL-up-until-XDG-setup-is-comp.patch" - patch -Np1 -i "${srcdir}/0009-gl-renderer-Try-realizing-EGLStream-before-EGLImage-.patch" - patch -Np1 -i "${srcdir}/0010-compositor-drm-Cleanup-scanout-plane-state-upon-head.patch" + 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}/0006-compositor-Process-stream-attach-requests-with-wl_eg.patch" } build() { |