diff --git a/sources b/sources index 12a60d6..da36423 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (wlroots-0.16.0.tar.gz) = f5a7ea444f77ec563a4cf40831c43fbe8593a61a31cc9e04f45abf0603d9dab11b90e0f7cda0cd65df40c36257377c101bbbd9e4cb9dd5cde0baa7abb558cc87 -SHA512 (wlroots-0.16.0.tar.gz.sig) = 98d0579f8a4b863f2c57cfcd9849811ac2bf5945b5b2511c7e1eb4f73e5db8af02265e9fa2e5b3330af141506b1d4e3c22a35cd8669ebd5633388e3c6bc5d2d3 +SHA512 (wlroots-0.16.1.tar.gz) = e676717b8e0f6a52ae02bd8187c70c5ce5f73c00c251bdfe94285d12b960e1a519a663ebd12a7686979d259977080560b22ef8dbbb6594234eb137dfaf0fea58 +SHA512 (wlroots-0.16.1.tar.gz.sig) = 0af3783ed826d590416c3834bc5c0383e4b9aa206e592bcb838bdd1bf93f89192839d0ca699078d5076cd60b37fe1354199e06b8ad2e45ebb270e7ab31c32e12 diff --git a/wlroots-0.16-backports.patch b/wlroots-0.16-backports.patch deleted file mode 100644 index ed9b7a9..0000000 --- a/wlroots-0.16-backports.patch +++ /dev/null @@ -1,454 +0,0 @@ -From bc6422115cf0dd0c065d3a6ec4d1ac363aad39fd Mon Sep 17 00:00:00 2001 -From: Simon Zeni -Date: Fri, 11 Nov 2022 14:52:24 -0500 -Subject: [PATCH 01/12] render/egl: fix uninitialized pointers in - init_dmabuf_formats - -`modifiers` and `external_only` are never initialized, and free'd later. This -commit explicitly initializes them to NULL to prevent segfaults on `free()` - -(cherry picked from commit ed71915742160f2b9157adbad79364e22ab7ebda) ---- - render/egl.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/render/egl.c b/render/egl.c -index e3839c7d..0c25e036 100644 ---- a/render/egl.c -+++ b/render/egl.c -@@ -124,8 +124,8 @@ static void init_dmabuf_formats(struct wlr_egl *egl) { - for (int i = 0; i < formats_len; i++) { - uint32_t fmt = formats[i]; - -- uint64_t *modifiers; -- EGLBoolean *external_only; -+ uint64_t *modifiers = NULL; -+ EGLBoolean *external_only = NULL; - int modifiers_len = 0; - if (!no_modifiers) { - modifiers_len = get_egl_dmabuf_modifiers(egl, fmt, &modifiers, &external_only); --- -2.38.1 - - -From a6ff023df291a770fb907a88ca39b9ee5b1cc89e Mon Sep 17 00:00:00 2001 -From: Simon Ser -Date: Tue, 15 Nov 2022 10:55:38 +0100 -Subject: [PATCH 02/12] backend/drm: only request page-flip if active - -It doesn't make sense to request a page-flip for a disabled output. - -Fixes: 84e727daae67 ("backend/drm: request page-flip event on modeset") -Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3528 -(cherry picked from commit f863b93c05a73097ccddce1ed066f3f11bfb1c3e) ---- - backend/drm/drm.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/backend/drm/drm.c b/backend/drm/drm.c -index 04994c68..1f4e74c5 100644 ---- a/backend/drm/drm.c -+++ b/backend/drm/drm.c -@@ -577,7 +577,7 @@ bool drm_connector_commit_state(struct wlr_drm_connector *conn, - return false; - } - } -- if (pending.modeset) { -+ if (pending.modeset && pending.active) { - flags |= DRM_MODE_PAGE_FLIP_EVENT; - } - --- -2.38.1 - - -From 990cba89662c5d892dd8e045e737b6ada2f6d1ae Mon Sep 17 00:00:00 2001 -From: bi4k8 -Date: Tue, 15 Nov 2022 01:00:27 +0000 -Subject: [PATCH 03/12] wlr_seat: clear `drag->seat_client` when destroyed - -This was previously a use-after-free in `wlr_drag.c`. - -(cherry picked from commit 8b12037cadb2422a10d948babc4fd77ce637f158) ---- - types/data_device/wlr_drag.c | 6 +++--- - types/seat/wlr_seat.c | 4 ++++ - 2 files changed, 7 insertions(+), 3 deletions(-) - -diff --git a/types/data_device/wlr_drag.c b/types/data_device/wlr_drag.c -index d3cb979d..c1fa801b 100644 ---- a/types/data_device/wlr_drag.c -+++ b/types/data_device/wlr_drag.c -@@ -55,14 +55,14 @@ static void drag_set_focus(struct wlr_drag *drag, - goto out; - } - -- if (!drag->source && -+ if (!drag->source && drag->seat_client && - wl_resource_get_client(surface->resource) != - drag->seat_client->client) { - goto out; - } - - struct wlr_seat_client *focus_client = wlr_seat_client_for_wl_client( -- drag->seat_client->seat, wl_resource_get_client(surface->resource)); -+ drag->seat, wl_resource_get_client(surface->resource)); - if (!focus_client) { - goto out; - } -@@ -71,7 +71,7 @@ static void drag_set_focus(struct wlr_drag *drag, - drag->source->accepted = false; - - uint32_t serial = -- wl_display_next_serial(drag->seat_client->seat->display); -+ wl_display_next_serial(drag->seat->display); - - struct wl_resource *device_resource; - wl_resource_for_each(device_resource, &focus_client->data_devices) { -diff --git a/types/seat/wlr_seat.c b/types/seat/wlr_seat.c -index 59b760ca..f83ccd6d 100644 ---- a/types/seat/wlr_seat.c -+++ b/types/seat/wlr_seat.c -@@ -75,6 +75,10 @@ static void seat_client_handle_resource_destroy( - client->seat->keyboard_state.focused_client = NULL; - } - -+ if (client->seat->drag && client == client->seat->drag->seat_client) { -+ client->seat->drag->seat_client = NULL; -+ } -+ - struct wl_resource *resource, *tmp; - wl_resource_for_each_safe(resource, tmp, &client->pointers) { - wl_resource_destroy(resource); --- -2.38.1 - - -From b9b6334639bed442e039b61ec902692da557d4de Mon Sep 17 00:00:00 2001 -From: Kirill Primak -Date: Sun, 13 Nov 2022 01:30:22 +0300 -Subject: [PATCH 04/12] xwayland: fix wlr_xwayland_surface_from_wlr_surface() - docs - -32daa43a454bcea1306ad0976fd4161ce8c7e86f has removed the asymmetry in -the relationship of a wlr_surface and an unmapped wlr_xwayland_surface, -when wlr_surface.role_data wasn't NULL but wlr_xwayland_surface.surface -was. However, this also means that -wlr_xwayland_surface_from_wlr_surface() now returns NULL if the -wlr_surface is unmapped. Fix the documentation to reflect this. - -(cherry picked from commit 627a5c511278e67c3c308cdc6a639cbb490f48c3) ---- - include/wlr/xwayland/xwayland.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/include/wlr/xwayland/xwayland.h b/include/wlr/xwayland/xwayland.h -index fd161937..372ab9a8 100644 ---- a/include/wlr/xwayland/xwayland.h -+++ b/include/wlr/xwayland/xwayland.h -@@ -232,7 +232,7 @@ bool wlr_surface_is_xwayland_surface(struct wlr_surface *surface); - * Get a struct wlr_xwayland_surface from a struct wlr_surface. - * Asserts that the surface has the xwayland surface role. - * May return NULL even if the surface has the xwayland surface role if the -- * corresponding xwayland surface has been destroyed. -+ * corresponding xwayland surface has been unmapped or destroyed. - */ - struct wlr_xwayland_surface *wlr_xwayland_surface_from_wlr_surface( - struct wlr_surface *surface); --- -2.38.1 - - -From e169ebb8cfbdb92f932b3f973e20ce79495bd983 Mon Sep 17 00:00:00 2001 -From: Simon Ser -Date: Thu, 10 Nov 2022 12:28:34 +0100 -Subject: [PATCH 05/12] backend/drm: log refresh rate in Hz - -(cherry picked from commit b3da33116ea9fb3ef948ae72425534b43c217579) ---- - backend/drm/drm.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/backend/drm/drm.c b/backend/drm/drm.c -index 1f4e74c5..55f95c91 100644 ---- a/backend/drm/drm.c -+++ b/backend/drm/drm.c -@@ -1302,9 +1302,9 @@ static void connect_drm_connector(struct wlr_drm_connector *wlr_conn, - wlr_conn->crtc->mode_id = mode_id; - } - -- wlr_log(WLR_INFO, " %"PRId32"x%"PRId32"@%"PRId32" %s", -+ wlr_log(WLR_INFO, " %"PRId32"x%"PRId32" @ %.3f Hz %s", - mode->wlr_mode.width, mode->wlr_mode.height, -- mode->wlr_mode.refresh, -+ (float)mode->wlr_mode.refresh / 1000, - mode->wlr_mode.preferred ? "(preferred)" : ""); - - wl_list_insert(wlr_conn->output.modes.prev, &mode->wlr_mode.link); --- -2.38.1 - - -From 356ac5eed90a2c8b899dbfaf8a7a17237868adeb Mon Sep 17 00:00:00 2001 -From: Simon Ser -Date: Thu, 10 Nov 2022 12:28:53 +0100 -Subject: [PATCH 06/12] backend/drm: log modesetting commits - -(cherry picked from commit 65836ce357e4140d4e5250228a05ddd96119a883) ---- - backend/drm/drm.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/backend/drm/drm.c b/backend/drm/drm.c -index 55f95c91..74265d4f 100644 ---- a/backend/drm/drm.c -+++ b/backend/drm/drm.c -@@ -581,6 +581,12 @@ bool drm_connector_commit_state(struct wlr_drm_connector *conn, - flags |= DRM_MODE_PAGE_FLIP_EVENT; - } - -+ if (pending.modeset) { -+ wlr_drm_conn_log(conn, WLR_INFO, "Modesetting with %dx%d @ %.3f Hz", -+ pending.mode.hdisplay, pending.mode.vdisplay, -+ (float)calculate_refresh_rate(&pending.mode) / 1000); -+ } -+ - if (!drm_crtc_commit(conn, &pending, flags, false)) { - return false; - } --- -2.38.1 - - -From 9c5445148235109b4fb986138c6294db4d0334d8 Mon Sep 17 00:00:00 2001 -From: Simon Ser -Date: Tue, 15 Nov 2022 10:06:23 +0100 -Subject: [PATCH 07/12] backend/drm: fix FPE when disabling output - -Fixes: 65836ce357e4 ("backend/drm: log modesetting commits") -Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3534 -(cherry picked from commit a40ba16a6414f72ae0224164bb08cd8479dc52ee) ---- - backend/drm/drm.c | 10 +++++++--- - 1 file changed, 7 insertions(+), 3 deletions(-) - -diff --git a/backend/drm/drm.c b/backend/drm/drm.c -index 74265d4f..a7ff585e 100644 ---- a/backend/drm/drm.c -+++ b/backend/drm/drm.c -@@ -582,9 +582,13 @@ bool drm_connector_commit_state(struct wlr_drm_connector *conn, - } - - if (pending.modeset) { -- wlr_drm_conn_log(conn, WLR_INFO, "Modesetting with %dx%d @ %.3f Hz", -- pending.mode.hdisplay, pending.mode.vdisplay, -- (float)calculate_refresh_rate(&pending.mode) / 1000); -+ if (pending.active) { -+ wlr_drm_conn_log(conn, WLR_INFO, "Modesetting with %dx%d @ %.3f Hz", -+ pending.mode.hdisplay, pending.mode.vdisplay, -+ (float)calculate_refresh_rate(&pending.mode) / 1000); -+ } else { -+ wlr_drm_conn_log(conn, WLR_INFO, "Turning off"); -+ } - } - - if (!drm_crtc_commit(conn, &pending, flags, false)) { --- -2.38.1 - - -From 724bc296f5a3dce3b619cf089b711cff3a8ece37 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Guido=20G=C3=BCnther?= -Date: Thu, 24 Nov 2022 22:38:29 +0100 -Subject: [PATCH 08/12] seat/pointer: Initialize low_res_value - -Fixes - - In file included from /usr/include/wayland-server-core.h:32, - from ../types/seat/wlr_seat_pointer.c:6: - In function 'wl_fixed_from_double', - inlined from 'wlr_seat_pointer_send_axis' at ../types/seat/wlr_seat_pointer.c:367:6: - /usr/include/wayland-util.h:641:17: error: 'low_res_value' may be used uninitialized [-Werror=maybe-uninitialized] - 641 | u.d = d + (3LL << (51 - 8)); - | ~~^~~~~~~~~~~~~~~~~~~ - ../types/seat/wlr_seat_pointer.c: In function 'wlr_seat_pointer_send_axis': - ../types/seat/wlr_seat_pointer.c:329:16: note: 'low_res_value' was declared here - 329 | double low_res_value; - | ^~~~~~~~~~~~~ ---- - types/seat/wlr_seat_pointer.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/types/seat/wlr_seat_pointer.c b/types/seat/wlr_seat_pointer.c -index 8d6154b0..ffa706bd 100644 ---- a/types/seat/wlr_seat_pointer.c -+++ b/types/seat/wlr_seat_pointer.c -@@ -326,7 +326,7 @@ void wlr_seat_pointer_send_axis(struct wlr_seat *wlr_seat, uint32_t time, - send_source = true; - } - -- double low_res_value; -+ double low_res_value = 0.0; - int32_t low_res_value_discrete = 0; - update_value120_accumulators(client, orientation, value, value_discrete, - &low_res_value, &low_res_value_discrete); --- -2.38.1 - - -From 4892082836399fda80dd55671c46b005f0451c5c Mon Sep 17 00:00:00 2001 -From: Johan Malm -Date: Sat, 26 Nov 2022 17:18:33 +0000 -Subject: [PATCH 09/12] scene/layer_shell_v1.c: set exclusive zone correctly - -...when only one edge is anchored. - -The layer-shell protocol specifies that a positive exclusive-zone value is -'meaningful' if the surface is anchored to either: - -1. one edge -2. one edge and both perpendicular edges. - -For example, if you wish to position a layer-shell client along the top -edge and make it exclusive, you should be able to either set anchor=TOP or -anchor=TOP|LEFT|RIGHT. It appears that many panels/bars use the latter -approach (anchor to an edge and also both perpendicular edges) which is -probably why this has not been reported previously. - -This patch adds support for the first case and thereby makes exclusive -zone behaviour consistent with the protocol and also with sway's extant -layer-shell implementation. - -(cherry picked from commit 8e80432a72b18a1ddbacdb08ff0c41645578f1ee) ---- - types/scene/layer_shell_v1.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/types/scene/layer_shell_v1.c b/types/scene/layer_shell_v1.c -index 22986983..e523d315 100644 ---- a/types/scene/layer_shell_v1.c -+++ b/types/scene/layer_shell_v1.c -@@ -39,6 +39,7 @@ static void layer_surface_exclusive_zone( - struct wlr_layer_surface_v1_state *state, - struct wlr_box *usable_area) { - switch (state->anchor) { -+ case ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP: - case (ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP | - ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT | - ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT): -@@ -46,12 +47,14 @@ static void layer_surface_exclusive_zone( - usable_area->y += state->exclusive_zone + state->margin.top; - usable_area->height -= state->exclusive_zone + state->margin.top; - break; -+ case ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM: - case (ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM | - ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT | - ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT): - // Anchor bottom - usable_area->height -= state->exclusive_zone + state->margin.bottom; - break; -+ case ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT: - case (ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP | - ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM | - ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT): -@@ -59,6 +62,7 @@ static void layer_surface_exclusive_zone( - usable_area->x += state->exclusive_zone + state->margin.left; - usable_area->width -= state->exclusive_zone + state->margin.left; - break; -+ case ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT: - case (ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP | - ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM | - ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT): // Anchor right --- -2.38.1 - - -From e0fe72ffdd66bcf2f43f728858d745171498d58d Mon Sep 17 00:00:00 2001 -From: Johan Malm -Date: Sat, 26 Nov 2022 17:23:51 +0000 -Subject: [PATCH 10/12] scene/layer_shell_v1.c: remove redundant comment - -(cherry picked from commit 338e0a3976f2bad5ec048b022648a671ed443b4f) ---- - types/scene/layer_shell_v1.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/types/scene/layer_shell_v1.c b/types/scene/layer_shell_v1.c -index e523d315..3ed616a9 100644 ---- a/types/scene/layer_shell_v1.c -+++ b/types/scene/layer_shell_v1.c -@@ -65,7 +65,7 @@ static void layer_surface_exclusive_zone( - case ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT: - case (ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP | - ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM | -- ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT): // Anchor right -+ ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT): - // Anchor right - usable_area->width -= state->exclusive_zone + state->margin.right; - break; --- -2.38.1 - - -From de5e091996bfa58a0a93fac38a45235b7cb06488 Mon Sep 17 00:00:00 2001 -From: Simon Zeni -Date: Tue, 29 Nov 2022 15:21:18 -0500 -Subject: [PATCH 11/12] types/wlr_seat: finish keyboard_state during - wlr_seat_destroy - -(cherry picked from commit 0611c10909b17276bd633a4ee9a322995e9a3580) ---- - types/seat/wlr_seat.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/types/seat/wlr_seat.c b/types/seat/wlr_seat.c -index f83ccd6d..c2985824 100644 ---- a/types/seat/wlr_seat.c -+++ b/types/seat/wlr_seat.c -@@ -179,6 +179,8 @@ void wlr_seat_destroy(struct wlr_seat *seat) { - wlr_seat_pointer_clear_focus(seat); - wlr_seat_keyboard_clear_focus(seat); - -+ wlr_seat_set_keyboard(seat, NULL); -+ - struct wlr_touch_point *point; - wl_list_for_each(point, &seat->touch_state.touch_points, link) { - wlr_seat_touch_point_clear_focus(seat, 0, point->touch_id); --- -2.38.1 - - -From f1bea43ccccd5824097d8660a2d20b5d0bf506be Mon Sep 17 00:00:00 2001 -From: Simon Ser -Date: Wed, 30 Nov 2022 15:58:08 +0100 -Subject: [PATCH 12/12] Revert "compositor: enforce surface destruction order" - -This reverts commit c09d3450d494e21f065c12f199fa5ba8bfd946a9. - -This doesn't play well with the Xwayland surface role. ---- - types/wlr_compositor.c | 8 -------- - 1 file changed, 8 deletions(-) - -diff --git a/types/wlr_compositor.c b/types/wlr_compositor.c -index 5e6de244..fa4a8aa5 100644 ---- a/types/wlr_compositor.c -+++ b/types/wlr_compositor.c -@@ -36,14 +36,6 @@ static int max(int fst, int snd) { - - static void surface_handle_destroy(struct wl_client *client, - struct wl_resource *resource) { -- struct wlr_surface *surface = wlr_surface_from_resource(resource); -- if (surface->role_data != NULL) { -- // TODO: send WL_SURFACE_ERROR_DEFUNCT_ROLE_OBJECT -- // https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/278 -- wl_resource_post_error(resource, -1, -- "surface was destroyed before its role object"); -- return; -- } - wl_resource_destroy(resource); - } - --- -2.38.1 - diff --git a/wlroots-0.16-libdrm-2.4.109-compat.patch b/wlroots-0.16-libdrm-2.4.109-compat.patch deleted file mode 100644 index 997cf49..0000000 --- a/wlroots-0.16-libdrm-2.4.109-compat.patch +++ /dev/null @@ -1,241 +0,0 @@ -From 05ec8d7a160aa5fb1a7fb47c6711e3e95348fbf7 Mon Sep 17 00:00:00 2001 -From: Aleksei Bavshin -Date: Tue, 8 Nov 2022 18:37:13 -0800 -Subject: [PATCH 1/2] Compatibility with libdrm 2.4.112 - ---- - meson.build | 2 +- - render/allocator/gbm.c | 7 ++----- - render/egl.c | 5 +---- - render/vulkan/pixel_format.c | 6 ++---- - types/output/render.c | 7 ++----- - 5 files changed, 8 insertions(+), 19 deletions(-) - -diff --git a/meson.build b/meson.build -index 5dd38e1a..b2fbcf33 100644 ---- a/meson.build -+++ b/meson.build -@@ -107,7 +107,7 @@ wayland_server = dependency('wayland-server', - ) - - drm = dependency('libdrm', -- version: '>=2.4.113', -+ version: '>=2.4.112', - fallback: 'libdrm', - default_options: [ - 'intel=disabled', -diff --git a/render/allocator/gbm.c b/render/allocator/gbm.c -index f77fedd8..805d80e3 100644 ---- a/render/allocator/gbm.c -+++ b/render/allocator/gbm.c -@@ -138,14 +138,11 @@ static struct wlr_gbm_buffer *create_buffer(struct wlr_gbm_allocator *alloc, - buffer->dmabuf.modifier = fallback_modifier; - } - -- char *format_name = drmGetFormatName(buffer->dmabuf.format); - char *modifier_name = drmGetFormatModifierName(buffer->dmabuf.modifier); - wlr_log(WLR_DEBUG, "Allocated %dx%d GBM buffer " -- "with format %s (0x%08"PRIX32"), modifier %s (0x%016"PRIX64")", -- buffer->base.width, buffer->base.height, -- format_name ? format_name : "", buffer->dmabuf.format, -+ "with format 0x%08"PRIX32", modifier %s (0x%016"PRIX64")", -+ buffer->base.width, buffer->base.height, buffer->dmabuf.format, - modifier_name ? modifier_name : "", buffer->dmabuf.modifier); -- free(format_name); - free(modifier_name); - - return buffer; -diff --git a/render/egl.c b/render/egl.c -index e3839c7d..13068fe2 100644 ---- a/render/egl.c -+++ b/render/egl.c -@@ -161,10 +161,7 @@ static void init_dmabuf_formats(struct wlr_egl *egl) { - } - - if (wlr_log_get_verbosity() >= WLR_DEBUG) { -- char *fmt_name = drmGetFormatName(fmt); -- wlr_log(WLR_DEBUG, " %s (0x%08"PRIX32")", -- fmt_name ? fmt_name : "", fmt); -- free(fmt_name); -+ wlr_log(WLR_DEBUG, " 0x%08"PRIX32"", fmt); - - log_modifier(DRM_FORMAT_MOD_INVALID, false); - if (modifiers_len == 0) { -diff --git a/render/vulkan/pixel_format.c b/render/vulkan/pixel_format.c -index f55063d7..d0008648 100644 ---- a/render/vulkan/pixel_format.c -+++ b/render/vulkan/pixel_format.c -@@ -234,10 +234,8 @@ void vulkan_format_props_query(struct wlr_vk_device *dev, - const struct wlr_vk_format *format) { - VkResult res; - -- char *format_name = drmGetFormatName(format->drm_format); -- wlr_log(WLR_DEBUG, " %s (0x%08"PRIX32")", -- format_name ? format_name : "", format->drm_format); -- free(format_name); -+ wlr_log(WLR_DEBUG, " %.4s (0x08%"PRIx32")", -+ (const char *)&format->drm_format, format->drm_format); - - // get general features and modifiers - VkFormatProperties2 fmtp = {0}; -diff --git a/types/output/render.c b/types/output/render.c -index 13d714e1..862f67f5 100644 ---- a/types/output/render.c -+++ b/types/output/render.c -@@ -4,7 +4,6 @@ - #include - #include - #include --#include - #include "backend/backend.h" - #include "render/allocator/allocator.h" - #include "render/drm_format_set.h" -@@ -71,10 +70,8 @@ static bool output_create_swapchain(struct wlr_output *output, - return true; - } - -- char *format_name = drmGetFormatName(format->format); -- wlr_log(WLR_DEBUG, "Choosing primary buffer format %s (0x%08"PRIX32") for output '%s'", -- format_name ? format_name : "", format->format, output->name); -- free(format_name); -+ wlr_log(WLR_DEBUG, "Choosing primary buffer format 0x%"PRIX32" for output '%s'", -+ format->format, output->name); - - if (!allow_modifiers && (format->len != 1 || format->modifiers[0] != DRM_FORMAT_MOD_LINEAR)) { - if (!wlr_drm_format_has(format, DRM_FORMAT_MOD_INVALID)) { --- -2.37.3 - - -From 99798f45c7a407c2a97c7ac2883c348b8e71c8c1 Mon Sep 17 00:00:00 2001 -From: Aleksei Bavshin -Date: Tue, 8 Nov 2022 18:37:51 -0800 -Subject: [PATCH 2/2] Compatibility with libdrm 2.4.109 - ---- - backend/drm/drm.c | 29 ++++++++++++++++++++--------- - backend/drm/util.c | 31 +++++++++++++++++++++++++++++++ - include/backend/drm/util.h | 2 ++ - meson.build | 2 +- - 4 files changed, 54 insertions(+), 10 deletions(-) - -diff --git a/backend/drm/drm.c b/backend/drm/drm.c -index 04994c68..9576de17 100644 ---- a/backend/drm/drm.c -+++ b/backend/drm/drm.c -@@ -1141,6 +1141,23 @@ static struct wlr_drm_crtc *connector_get_current_crtc( - return NULL; - } - -+static uint32_t get_possible_crtcs(int fd, const drmModeConnector *conn) { -+ uint32_t possible_crtcs = 0; -+ -+ for (int i = 0; i < conn->count_encoders; ++i) { -+ drmModeEncoder *enc = drmModeGetEncoder(fd, conn->encoders[i]); -+ if (!enc) { -+ continue; -+ } -+ -+ possible_crtcs |= enc->possible_crtcs; -+ -+ drmModeFreeEncoder(enc); -+ } -+ -+ return possible_crtcs; -+} -+ - static struct wlr_drm_connector *create_drm_connector(struct wlr_drm_backend *drm, - const drmModeConnector *drm_conn) { - struct wlr_drm_connector *wlr_conn = calloc(1, sizeof(*wlr_conn)); -@@ -1153,17 +1170,11 @@ static struct wlr_drm_connector *create_drm_connector(struct wlr_drm_backend *dr - wlr_conn->status = DRM_MODE_DISCONNECTED; - wlr_conn->id = drm_conn->connector_id; - -- const char *conn_name = -- drmModeGetConnectorTypeName(drm_conn->connector_type); -- if (conn_name == NULL) { -- conn_name = "Unknown"; -- } -- - snprintf(wlr_conn->name, sizeof(wlr_conn->name), -- "%s-%"PRIu32, conn_name, drm_conn->connector_type_id); -+ "%s-%"PRIu32, conn_get_name(drm_conn->connector_type), -+ drm_conn->connector_type_id); - -- wlr_conn->possible_crtcs = -- drmModeConnectorGetPossibleCrtcs(drm->fd, drm_conn); -+ wlr_conn->possible_crtcs = get_possible_crtcs(drm->fd, drm_conn); - if (wlr_conn->possible_crtcs == 0) { - wlr_drm_conn_log(wlr_conn, WLR_ERROR, "No CRTC possible"); - } -diff --git a/backend/drm/util.c b/backend/drm/util.c -index 03c4b0b4..6e0df7c5 100644 ---- a/backend/drm/util.c -+++ b/backend/drm/util.c -@@ -119,6 +119,37 @@ void parse_edid(struct wlr_drm_connector *conn, size_t len, const uint8_t *data) - } - } - -+const char *conn_get_name(uint32_t type_id) { -+ switch (type_id) { -+ case DRM_MODE_CONNECTOR_Unknown: return "Unknown"; -+ case DRM_MODE_CONNECTOR_VGA: return "VGA"; -+ case DRM_MODE_CONNECTOR_DVII: return "DVI-I"; -+ case DRM_MODE_CONNECTOR_DVID: return "DVI-D"; -+ case DRM_MODE_CONNECTOR_DVIA: return "DVI-A"; -+ case DRM_MODE_CONNECTOR_Composite: return "Composite"; -+ case DRM_MODE_CONNECTOR_SVIDEO: return "SVIDEO"; -+ case DRM_MODE_CONNECTOR_LVDS: return "LVDS"; -+ case DRM_MODE_CONNECTOR_Component: return "Component"; -+ case DRM_MODE_CONNECTOR_9PinDIN: return "DIN"; -+ case DRM_MODE_CONNECTOR_DisplayPort: return "DP"; -+ case DRM_MODE_CONNECTOR_HDMIA: return "HDMI-A"; -+ case DRM_MODE_CONNECTOR_HDMIB: return "HDMI-B"; -+ case DRM_MODE_CONNECTOR_TV: return "TV"; -+ case DRM_MODE_CONNECTOR_eDP: return "eDP"; -+ case DRM_MODE_CONNECTOR_VIRTUAL: return "Virtual"; -+ case DRM_MODE_CONNECTOR_DSI: return "DSI"; -+ case DRM_MODE_CONNECTOR_DPI: return "DPI"; -+ case DRM_MODE_CONNECTOR_WRITEBACK: return "Writeback"; -+#ifdef DRM_MODE_CONNECTOR_SPI -+ case DRM_MODE_CONNECTOR_SPI: return "SPI"; -+#endif -+#ifdef DRM_MODE_CONNECTOR_USB -+ case DRM_MODE_CONNECTOR_USB: return "USB"; -+#endif -+ default: return "Unknown"; -+ } -+} -+ - static bool is_taken(size_t n, const uint32_t arr[static n], uint32_t key) { - for (size_t i = 0; i < n; ++i) { - if (arr[i] == key) { -diff --git a/include/backend/drm/util.h b/include/backend/drm/util.h -index 9bfe5f8a..4979d906 100644 ---- a/include/backend/drm/util.h -+++ b/include/backend/drm/util.h -@@ -14,6 +14,8 @@ enum wlr_output_mode_aspect_ratio get_picture_aspect_ratio(const drmModeModeInfo - const char *get_pnp_manufacturer(uint16_t code); - // Populates the make/model/phys_{width,height} of output from the edid data - void parse_edid(struct wlr_drm_connector *conn, size_t len, const uint8_t *data); -+// Returns the string representation of a DRM output type -+const char *conn_get_name(uint32_t type_id); - - // Part of match_obj - enum { -diff --git a/meson.build b/meson.build -index b2fbcf33..b673ab20 100644 ---- a/meson.build -+++ b/meson.build -@@ -107,7 +107,7 @@ wayland_server = dependency('wayland-server', - ) - - drm = dependency('libdrm', -- version: '>=2.4.112', -+ version: '>=2.4.109', - fallback: 'libdrm', - default_options: [ - 'intel=disabled', --- -2.37.3 - diff --git a/wlroots.spec b/wlroots.spec index 5833ca5..3369d1c 100644 --- a/wlroots.spec +++ b/wlroots.spec @@ -2,7 +2,7 @@ %global abi_ver 11 Name: wlroots -Version: 0.16.0 +Version: 0.16.1 Release: 1%{?dist} Summary: A modular Wayland compositor library @@ -35,16 +35,11 @@ Source2: https://emersion.fr/.well-known/openpgpkey/hu/dj3498u4hyyarh35rk Source3: examples.meson.build # Upstream patches -# Backports for 0.16.1 bugfix release: git format-patch --stdout 0.16.0..0.16 -Patch0: wlroots-0.16-backports.patch # Fedora patches # Following patch is required for phoc. Patch10: Revert-layer-shell-error-on-0-dimension-without-anch.patch -# Patches for compatibility with older Fedora releases (module or copr builds) -Patch20: wlroots-0.16-libdrm-2.4.109-compat.patch - BuildRequires: gcc BuildRequires: glslang BuildRequires: gnupg2 @@ -106,9 +101,6 @@ Development files for %{name}. # apply unconditional patches %autopatch -p1 -M19 # apply conditional patches -%if 0%{?fedora} && 0%{?fedora} < 37 -%patch20 -p1 -b .libdrm -%endif %build @@ -151,6 +143,9 @@ install -pm0644 -D '%{SOURCE3}' '%{buildroot}/%{_pkgdocdir}/examples/meson.build %changelog +* Sun Dec 25 2022 Aleksei Bavshin - 0.16.1-1 +- Update to 0.16.1 + * Fri Dec 02 2022 Aleksei Bavshin - 0.16.0-1 - Update to 0.16.0 (#2142159) - Add patch for compatibility with older libdrm