diff --git a/output-don-t-leave-dangling-cursor_front_buffer.patch b/output-don-t-leave-dangling-cursor_front_buffer.patch deleted file mode 100644 index c34af68..0000000 --- a/output-don-t-leave-dangling-cursor_front_buffer.patch +++ /dev/null @@ -1,111 +0,0 @@ -From d46870cf38db0c53eeb204191f44d18a66691493 Mon Sep 17 00:00:00 2001 -From: Simon Ser -Date: Tue, 30 Nov 2021 18:33:08 +0100 -Subject: [PATCH] output: don't leave dangling cursor_front_buffer - -Sometimes we were calling wlr_output_impl.set_cursor with a NULL -buffer, but we weren't clearing wlr_output.cursor_front_buffer. -Avoid leaving a dangling buffer behind. - -Introduce a helper function output_set_hardware_cursor which calls -wlr_output_impl.set_cursor and keeps cursor_front_buffer in sync. - -(cherry picked from commit 2540de494e66c6fa056e9608755bfa7474d4ee47) ---- - types/wlr_output.c | 43 +++++++++++++++++++++++++++---------------- - 1 file changed, 27 insertions(+), 16 deletions(-) - -diff --git a/types/wlr_output.c b/types/wlr_output.c -index c6676105..24258010 100644 ---- a/types/wlr_output.c -+++ b/types/wlr_output.c -@@ -961,6 +961,26 @@ void wlr_output_lock_attach_render(struct wlr_output *output, bool lock) { - output->attach_render_locks); - } - -+static bool output_set_hardware_cursor(struct wlr_output *output, -+ struct wlr_buffer *buffer, int hotspot_x, int hotspot_y) { -+ if (!output->impl->set_cursor) { -+ return false; -+ } -+ -+ if (!output->impl->set_cursor(output, buffer, hotspot_x, hotspot_y)) { -+ return false; -+ } -+ -+ wlr_buffer_unlock(output->cursor_front_buffer); -+ output->cursor_front_buffer = NULL; -+ -+ if (buffer != NULL) { -+ output->cursor_front_buffer = wlr_buffer_lock(buffer); -+ } -+ -+ return true; -+} -+ - static void output_cursor_damage_whole(struct wlr_output_cursor *cursor); - - void wlr_output_lock_software_cursors(struct wlr_output *output, bool lock) { -@@ -975,8 +995,7 @@ void wlr_output_lock_software_cursors(struct wlr_output *output, bool lock) { - output->software_cursor_locks); - - if (output->software_cursor_locks > 0 && output->hardware_cursor != NULL) { -- assert(output->impl->set_cursor); -- output->impl->set_cursor(output, NULL, 0, 0); -+ output_set_hardware_cursor(output, NULL, 0, 0); - output_cursor_damage_whole(output->hardware_cursor); - output->hardware_cursor = NULL; - } -@@ -1352,14 +1371,10 @@ static bool output_cursor_attempt_hardware(struct wlr_output_cursor *cursor) { - wlr_output_transform_invert(output->transform), - buffer ? buffer->width : 0, buffer ? buffer->height : 0); - -- bool ok = output->impl->set_cursor(cursor->output, buffer, -- hotspot.x, hotspot.y); -+ bool ok = output_set_hardware_cursor(cursor->output, buffer, hotspot.x, hotspot.y); -+ wlr_buffer_unlock(buffer); - if (ok) { -- wlr_buffer_unlock(output->cursor_front_buffer); -- output->cursor_front_buffer = buffer; - output->hardware_cursor = cursor; -- } else { -- wlr_buffer_unlock(buffer); - } - return ok; - } -@@ -1473,9 +1488,8 @@ void wlr_output_cursor_set_surface(struct wlr_output_cursor *cursor, - wlr_output_transform_invert(cursor->output->transform), - buffer ? buffer->width : 0, buffer ? buffer->height : 0); - -- assert(cursor->output->impl->set_cursor); -- cursor->output->impl->set_cursor(cursor->output, -- buffer, hotspot.x, hotspot.y); -+ output_set_hardware_cursor(cursor->output, buffer, -+ hotspot.x, hotspot.y); - } - return; - } -@@ -1498,8 +1512,7 @@ void wlr_output_cursor_set_surface(struct wlr_output_cursor *cursor, - cursor->height = 0; - - if (cursor->output->hardware_cursor == cursor) { -- assert(cursor->output->impl->set_cursor); -- cursor->output->impl->set_cursor(cursor->output, NULL, 0, 0); -+ output_set_hardware_cursor(cursor->output, NULL, 0, 0); - } - } - } -@@ -1560,9 +1573,7 @@ void wlr_output_cursor_destroy(struct wlr_output_cursor *cursor) { - wlr_signal_emit_safe(&cursor->events.destroy, cursor); - if (cursor->output->hardware_cursor == cursor) { - // If this cursor was the hardware cursor, disable it -- if (cursor->output->impl->set_cursor) { -- cursor->output->impl->set_cursor(cursor->output, NULL, 0, 0); -- } -+ output_set_hardware_cursor(cursor->output, NULL, 0, 0); - cursor->output->hardware_cursor = NULL; - } - wlr_texture_destroy(cursor->texture); --- -2.33.1 - diff --git a/sources b/sources index 1ea256b..b9e28fd 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (wlroots-0.14.1.tar.gz) = 4f557c827f9673eccf208a3644954de80e7355b95cc374cc5e851a47087b227f196e0936c0913d21a6c776c29b74de2d028a100931264e41934c747568d8ebe0 -SHA512 (wlroots-0.14.1.tar.gz.sig) = 42b3942737db33de60a4d78df706a490c510ff462d8a15139c6d63c85cc9d1a85843654a3b17c32fb7ceffef160b17bac20a64b5ee8b37720f3c3748f971f2fd +SHA512 (wlroots-0.15.0.tar.gz) = 730b1e0cf003dabae23101664c6d1993636bd3a8ecbdb3c165eef415a92811c4d5228f48e0275f75361d8528f118dfb8a2298cfb05dbf6364539224ceedca447 +SHA512 (wlroots-0.15.0.tar.gz.sig) = 7e8c9856499c79d95ce3fc881703d6e238e60d9b839122d1785e07ab1fe56858f5f1b7bfc3946aa678732d89da9cbb8b4bc468b6c8a144aad516dfd7e6f0e3b5 diff --git a/wlroots-0.15-wayland-1.19-compat.patch b/wlroots-0.15-wayland-1.19-compat.patch new file mode 100644 index 0000000..5df1f2f --- /dev/null +++ b/wlroots-0.15-wayland-1.19-compat.patch @@ -0,0 +1,192 @@ +From 6d2ad0b3e9b1b3b7d28417be3c1fbb8bfcf5b600 Mon Sep 17 00:00:00 2001 +From: Aleksei Bavshin +Date: Fri, 17 Dec 2021 06:45:20 -0800 +Subject: [PATCH 1/2] Revert "output: add support for protocol interface + version 4" + +This reverts commit e3fefda0235e548e4d23639adfe375edf380825c. +--- + meson.build | 2 +- + types/output/output.c | 32 +++++--------------------------- + 2 files changed, 6 insertions(+), 28 deletions(-) + +diff --git a/meson.build b/meson.build +index 681b07cc..531b34e4 100644 +--- a/meson.build ++++ b/meson.build +@@ -99,7 +99,7 @@ internal_features = { + + wayland_project_options = ['tests=false', 'documentation=false'] + wayland_server = dependency('wayland-server', +- version: '>=1.20', ++ version: '>=1.19', + fallback: ['wayland', 'wayland_server_dep'], + default_options: wayland_project_options, + ) +diff --git a/types/output/output.c b/types/output/output.c +index 85590ab6..2ed8c6f6 100644 +--- a/types/output/output.c ++++ b/types/output/output.c +@@ -13,7 +13,7 @@ + #include "util/global.h" + #include "util/signal.h" + +-#define OUTPUT_VERSION 4 ++#define OUTPUT_VERSION 3 + + static void send_geometry(struct wl_resource *resource) { + struct wlr_output *output = wlr_output_from_resource(resource); +@@ -43,23 +43,6 @@ static void send_scale(struct wl_resource *resource) { + } + } + +-static void send_name(struct wl_resource *resource) { +- struct wlr_output *output = wlr_output_from_resource(resource); +- uint32_t version = wl_resource_get_version(resource); +- if (version >= WL_OUTPUT_NAME_SINCE_VERSION) { +- wl_output_send_name(resource, output->name); +- } +-} +- +-static void send_description(struct wl_resource *resource) { +- struct wlr_output *output = wlr_output_from_resource(resource); +- uint32_t version = wl_resource_get_version(resource); +- if (output->description != NULL && +- version >= WL_OUTPUT_DESCRIPTION_SINCE_VERSION) { +- wl_output_send_description(resource, output->description); +- } +-} +- + static void send_done(struct wl_resource *resource) { + uint32_t version = wl_resource_get_version(resource); + if (version >= WL_OUTPUT_DONE_SINCE_VERSION) { +@@ -104,8 +87,6 @@ static void output_bind(struct wl_client *wl_client, void *data, + send_geometry(resource); + send_current_mode(resource); + send_scale(resource); +- send_name(resource); +- send_description(resource); + send_done(resource); + + struct wlr_output_event_bind evt = { +@@ -150,7 +131,10 @@ static void schedule_done_handle_idle_timer(void *data) { + + struct wl_resource *resource; + wl_resource_for_each(resource, &output->resources) { +- send_done(resource); ++ uint32_t version = wl_resource_get_version(resource); ++ if (version >= WL_OUTPUT_DONE_SINCE_VERSION) { ++ wl_output_send_done(resource); ++ } + } + } + +@@ -360,12 +344,6 @@ void wlr_output_set_description(struct wlr_output *output, const char *desc) { + output->description = NULL; + } + +- struct wl_resource *resource; +- wl_resource_for_each(resource, &output->resources) { +- send_description(resource); +- } +- wlr_output_schedule_done(output); +- + wlr_signal_emit_safe(&output->events.description, output); + } + +-- +2.33.1 + + +From 83e6d3cfb3e710b6c69eac8caaf8a000002eddea Mon Sep 17 00:00:00 2001 +From: Aleksei Bavshin +Date: Fri, 17 Dec 2021 06:45:40 -0800 +Subject: [PATCH 2/2] Revert "util/global: remove wl_display arg from + wlr_global_destroy_safe" + +This reverts commit 4377b5529279aa9dab64256d22ad0f2e9009843c. +--- + include/util/global.h | 3 ++- + types/output/output.c | 2 +- + types/seat/wlr_seat.c | 2 +- + types/wlr_drm_lease_v1.c | 2 +- + util/global.c | 4 ++-- + 5 files changed, 7 insertions(+), 6 deletions(-) + +diff --git a/include/util/global.h b/include/util/global.h +index 1c979ab1..ea0fda83 100644 +--- a/include/util/global.h ++++ b/include/util/global.h +@@ -9,6 +9,7 @@ + * Globals that are created and destroyed on the fly need special handling to + * prevent race conditions with wl_registry. Use this function to destroy them. + */ +-void wlr_global_destroy_safe(struct wl_global *global); ++void wlr_global_destroy_safe(struct wl_global *global, ++ struct wl_display *display); + + #endif +diff --git a/types/output/output.c b/types/output/output.c +index 2ed8c6f6..91a45f13 100644 +--- a/types/output/output.c ++++ b/types/output/output.c +@@ -121,7 +121,7 @@ void wlr_output_destroy_global(struct wlr_output *output) { + wl_list_init(wl_resource_get_link(resource)); + } + +- wlr_global_destroy_safe(output->global); ++ wlr_global_destroy_safe(output->global, output->display); + output->global = NULL; + } + +diff --git a/types/seat/wlr_seat.c b/types/seat/wlr_seat.c +index 4933133c..f9314744 100644 +--- a/types/seat/wlr_seat.c ++++ b/types/seat/wlr_seat.c +@@ -191,7 +191,7 @@ void wlr_seat_destroy(struct wlr_seat *seat) { + } + } + +- wlr_global_destroy_safe(seat->global); ++ wlr_global_destroy_safe(seat->global, seat->display); + free(seat->pointer_state.default_grab); + free(seat->keyboard_state.default_grab); + free(seat->touch_state.default_grab); +diff --git a/types/wlr_drm_lease_v1.c b/types/wlr_drm_lease_v1.c +index 7cb9974d..7063e0d3 100644 +--- a/types/wlr_drm_lease_v1.c ++++ b/types/wlr_drm_lease_v1.c +@@ -127,7 +127,7 @@ static void drm_lease_device_v1_destroy( + } + + wl_list_remove(&device->link); +- wlr_global_destroy_safe(device->global); ++ wlr_global_destroy_safe(device->global, device->manager->display); + + free(device); + } +diff --git a/util/global.c b/util/global.c +index fa99a994..a0d84ed3 100644 +--- a/util/global.c ++++ b/util/global.c +@@ -14,7 +14,8 @@ static int destroy_global(void *_data) { + return 0; + } + +-void wlr_global_destroy_safe(struct wl_global *global) { ++void wlr_global_destroy_safe(struct wl_global *global, ++ struct wl_display *display) { + // Don't destroy the global immediately. If the global has been created + // recently, clients might try to bind to it after we've destroyed it. + // Instead, remove the global so that clients stop seeing it and wait an +@@ -24,7 +25,6 @@ void wlr_global_destroy_safe(struct wl_global *global) { + wl_global_remove(global); + wl_global_set_user_data(global, NULL); // safety net + +- struct wl_display *display = wl_global_get_display(global); + struct wl_event_loop *event_loop = wl_display_get_event_loop(display); + struct destroy_global_data *data = calloc(1, sizeof(*data)); + if (data == NULL) { +-- +2.33.1 + diff --git a/wlroots-0.15.0-render-gles2-don-t-constrain-shm-formats-to-ones-tha.patch b/wlroots-0.15.0-render-gles2-don-t-constrain-shm-formats-to-ones-tha.patch new file mode 100644 index 0000000..95ca0be --- /dev/null +++ b/wlroots-0.15.0-render-gles2-don-t-constrain-shm-formats-to-ones-tha.patch @@ -0,0 +1,88 @@ +From 59b9518f072527ac59593e51df7f5d5331a34f0e Mon Sep 17 00:00:00 2001 +From: Thomas Hebb +Date: Wed, 5 Jan 2022 00:16:59 -0800 +Subject: [PATCH] render/gles2: don't constrain shm formats to ones that + support reading + +commit 44e8451cd93e ("render/gles2: hide shm formats without GL +support") added the is_gles2_pixel_format_supported() function to +render/gles2/pixel_format.c, whose stated purpose is to "check whether +the renderer has the needed GL extensions to read a given pixel format." +It then used that function to filter the pixel formats returned by +get_gles2_shm_formats(). + +The result of this change is that RGB formats are no longer reported for +GL drivers that don't implement EXT_read_format_bgra, even when those +formats are supported for rendering (which they have to be for +wlr_gles2_renderer_create() to succeed). This is a pretty clear +regression, since wlr_renderer_init_wl_shm() fails when either of +WL_SHM_FORMAT_ARGB8888 or WL_SHM_FORMAT_XRGB8888 are missing. + +To fix the regression, change is_gles2_pixel_format_supported() to +accept all pixel formats that support rendering, regardless of whether +we can read them or not, and move the check for EXT_read_format_bgra +back into gles2_read_pixels(). (There's already a check for this +extension in gles2_preferred_read_format(), so we're not breaking any +abstraction that wasn't already broken.) + +Tested on the NVIDIA 495.46 proprietary driver, which doesn't support +EXT_read_format_bgra. + +Fixes: 44e8451cd93e ("render/gles2: hide shm formats without GL support") +--- + render/gles2/pixel_format.c | 14 ++++++++++---- + render/gles2/renderer.c | 6 ++++++ + 2 files changed, 16 insertions(+), 4 deletions(-) + +diff --git a/render/gles2/pixel_format.c b/render/gles2/pixel_format.c +index 31bb3908..b155bbbe 100644 +--- a/render/gles2/pixel_format.c ++++ b/render/gles2/pixel_format.c +@@ -98,6 +98,10 @@ static const struct wlr_gles2_pixel_format formats[] = { + + // TODO: more pixel formats + ++/* ++ * Return true if supported for texturing, even if other operations like ++ * reading aren't supported. ++ */ + bool is_gles2_pixel_format_supported(const struct wlr_gles2_renderer *renderer, + const struct wlr_gles2_pixel_format *format) { + if (format->gl_type == GL_UNSIGNED_INT_2_10_10_10_REV_EXT +@@ -108,10 +112,12 @@ bool is_gles2_pixel_format_supported(const struct wlr_gles2_renderer *renderer, + && !renderer->exts.OES_texture_half_float_linear) { + return false; + } +- if (format->gl_format == GL_BGRA_EXT +- && !renderer->exts.EXT_read_format_bgra) { +- return false; +- } ++ /* ++ * Note that we don't need to check for GL_EXT_texture_format_BGRA8888 ++ * here, since we've already checked if we have it at renderer creation ++ * time and bailed out if not. We do the check there because Wayland ++ * requires all compositors to support SHM buffers in that format. ++ */ + return true; + } + +diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c +index 527d85bf..67b8ead4 100644 +--- a/render/gles2/renderer.c ++++ b/render/gles2/renderer.c +@@ -441,6 +441,12 @@ static bool gles2_read_pixels(struct wlr_renderer *wlr_renderer, + return false; + } + ++ if (fmt->gl_format == GL_BGRA_EXT && !renderer->exts.EXT_read_format_bgra) { ++ wlr_log(WLR_ERROR, ++ "Cannot read pixels: missing GL_EXT_read_format_bgra extension"); ++ return false; ++ } ++ + const struct wlr_pixel_format_info *drm_fmt = + drm_get_pixel_format_info(fmt->drm_format); + assert(drm_fmt); +-- +GitLab + diff --git a/wlroots-0.15.0-vulkan-Fix-imported-image-layout.patch b/wlroots-0.15.0-vulkan-Fix-imported-image-layout.patch new file mode 100644 index 0000000..2520642 --- /dev/null +++ b/wlroots-0.15.0-vulkan-Fix-imported-image-layout.patch @@ -0,0 +1,39 @@ +From 9988eb3378dbc3301059aa9b5e1ff476354cb92b Mon Sep 17 00:00:00 2001 +From: nyorain +Date: Sun, 26 Dec 2021 13:21:54 +0100 +Subject: [PATCH] vulkan: Fix imported image layout + +--- + render/vulkan/renderer.c | 2 +- + render/vulkan/texture.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/render/vulkan/renderer.c b/render/vulkan/renderer.c +index a1d8d41e..21b36bdd 100644 +--- a/render/vulkan/renderer.c ++++ b/render/vulkan/renderer.c +@@ -598,7 +598,7 @@ static void vulkan_end(struct wlr_renderer *wlr_renderer) { + wl_list_for_each_safe(texture, tmp_tex, &renderer->foreign_textures, foreign_link) { + VkImageLayout src_layout = VK_IMAGE_LAYOUT_GENERAL; + if (!texture->transitioned) { +- src_layout = VK_IMAGE_LAYOUT_PREINITIALIZED; ++ src_layout = VK_IMAGE_LAYOUT_UNDEFINED; + texture->transitioned = true; + } + +diff --git a/render/vulkan/texture.c b/render/vulkan/texture.c +index 76c37011..b705603c 100644 +--- a/render/vulkan/texture.c ++++ b/render/vulkan/texture.c +@@ -438,7 +438,7 @@ VkImage vulkan_import_dmabuf(struct wlr_vk_renderer *renderer, + img_info.arrayLayers = 1; + img_info.samples = VK_SAMPLE_COUNT_1_BIT; + img_info.sharingMode = VK_SHARING_MODE_EXCLUSIVE; +- img_info.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED; ++ img_info.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; + img_info.extent = (VkExtent3D) { attribs->width, attribs->height, 1 }; + img_info.usage = for_render ? + VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT : +-- +GitLab + diff --git a/wlroots.spec b/wlroots.spec index c502dd0..13f5d37 100644 --- a/wlroots.spec +++ b/wlroots.spec @@ -1,9 +1,9 @@ # Version of the .so library -%global abi_ver 9 +%global abi_ver 10 Name: wlroots -Version: 0.14.1 -Release: 3%{?dist} +Version: 0.15.0 +Release: 1%{?dist} Summary: A modular Wayland compositor library # Source files/overall project licensed as MIT, but @@ -15,9 +15,9 @@ Summary: A modular Wayland compositor library # the main license of the binaries linking with them by # the underlying licenses. License: MIT -URL: https://github.com/swaywm/%{name} -Source0: %{url}/releases/download/%{version}/%{name}-%{version}.tar.gz -Source1: %{url}/releases/download/%{version}/%{name}-%{version}.tar.gz.sig +URL: https://gitlab.freedesktop.org/wlroots/wlroots +Source0: %{url}/-/releases/%{version}/downloads/%{name}-%{version}.tar.gz +Source1: %{url}/-/releases/%{version}/downloads/%{name}-%{version}.tar.gz.sig # 0FDE7BE0E88F5E48: emersion Source2: https://emersion.fr/.well-known/openpgpkey/hu/dj3498u4hyyarh35rkjfnghbjxug6b19#/gpgkey-0FDE7BE0E88F5E48.gpg @@ -25,24 +25,33 @@ Source2: https://emersion.fr/.well-known/openpgpkey/hu/dj3498u4hyyarh35rk # - make it self-contained # - only has targets for examples known to compile well (cf. "examples) global) Source3: examples.meson.build -# https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3189 -Patch0: output-don-t-leave-dangling-cursor_front_buffer.patch +# Fix validation errors with Vulkan >= 1.2.197 +Patch0: %{url}/-/commit/9988eb33.patch#/wlroots-0.15.0-vulkan-Fix-imported-image-layout.patch +# Fix support for a certain proprietary driver +Patch1: %{url}/-/commit/59b9518f.patch#/wlroots-0.15.0-render-gles2-don-t-constrain-shm-formats-to-ones-tha.patch +%if 0%{?fedora} < 36 +# Revert two commits that require wayland 1.20 +# Allows module builds on f34 and f35 +Patch100: wlroots-0.15-wayland-1.19-compat.patch +%endif BuildRequires: gcc +BuildRequires: glslang BuildRequires: gnupg2 -BuildRequires: meson >= 0.56.0 +BuildRequires: meson >= 0.58.1 BuildRequires: pkgconfig(egl) BuildRequires: pkgconfig(gbm) >= 17.1.0 BuildRequires: pkgconfig(glesv2) -BuildRequires: pkgconfig(libdrm) >= 2.4.105 +BuildRequires: pkgconfig(libdrm) >= 2.4.109 BuildRequires: pkgconfig(libinput) >= 1.14.0 BuildRequires: pkgconfig(libseat) BuildRequires: pkgconfig(libsystemd) >= 237 BuildRequires: pkgconfig(libudev) BuildRequires: pkgconfig(pixman-1) +BuildRequires: pkgconfig(vulkan) BuildRequires: pkgconfig(wayland-client) BuildRequires: pkgconfig(wayland-egl) -BuildRequires: pkgconfig(wayland-protocols) >= 1.21 +BuildRequires: pkgconfig(wayland-protocols) >= 1.24 BuildRequires: pkgconfig(wayland-scanner) BuildRequires: pkgconfig(wayland-server) >= 1.19 BuildRequires: pkgconfig(x11-xcb) @@ -111,7 +120,6 @@ install -pm0644 -D '%{SOURCE3}' '%{buildroot}/%{_pkgdocdir}/examples/meson.build %files %license LICENSE %doc README.md -%doc %dir %{_pkgdocdir} %{_libdir}/lib%{name}.so.%{abi_ver}* @@ -123,6 +131,11 @@ install -pm0644 -D '%{SOURCE3}' '%{buildroot}/%{_pkgdocdir}/examples/meson.build %changelog +* Sun Jan 16 2022 Aleksei Bavshin - 0.15.0-1 +- Update to 0.15.0 (#2033651) +- Update upstream URL to gitlab.freedesktop.org +- Backport some patches from 0.15.1 milestone + * Mon Dec 13 2021 Aleksei Bavshin - 0.14.1-3 - Add patch for disappearing cursor issue (#2027431)