From ca08bf599fce2c73824a74d35f9618dcb2410bbe Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Mon, 12 Jun 2023 14:34:50 -0500 Subject: wayland: bump wayland-protocols to 1.25 1.27 would have been nicer but ubuntu 22.04 is on 1.25 so we'll just compromise. --- generated/wayland/meson.build | 2 -- meson.build | 2 +- video/out/wayland_common.c | 12 ------------ video/out/wayland_common.h | 3 +-- waftools/checks/custom.py | 2 +- wscript | 5 ----- 6 files changed, 3 insertions(+), 23 deletions(-) diff --git a/generated/wayland/meson.build b/generated/wayland/meson.build index 3680346319..bf0138183e 100644 --- a/generated/wayland/meson.build +++ b/generated/wayland/meson.build @@ -8,8 +8,6 @@ protocols = [[wl_protocol_dir, 'stable/presentation-time/presentation-time.xml'] wl_protocols_source = [] wl_protocols_headers = [] -features += {'wayland_protocols_1_24': wayland['deps'][2].version().version_compare('>=1.24')} - features += {'wayland_protocols_1_27': wayland['deps'][2].version().version_compare('>=1.27')} if features['wayland_protocols_1_27'] protocols += [[wl_protocol_dir, 'staging/content-type/content-type-v1.xml'], diff --git a/meson.build b/meson.build index 2ed0c0c926..d11b4c8608 100644 --- a/meson.build +++ b/meson.build @@ -980,7 +980,7 @@ endif wayland = { 'deps': [dependency('wayland-client', version: '>= 1.20.0', required: get_option('wayland')), dependency('wayland-cursor', version: '>= 1.20.0', required: get_option('wayland')), - dependency('wayland-protocols', version: '>= 1.15', required: get_option('wayland')), + dependency('wayland-protocols', version: '>= 1.25', required: get_option('wayland')), dependency('xkbcommon', version: '>= 0.3.0', required: get_option('wayland'))], 'header': cc.has_header('linux/input-event-codes.h', required: get_option('wayland')), 'scanner': find_program('wayland-scanner', required: get_option('wayland')), diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 618ec39f0e..a2ef5400ee 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -800,7 +800,6 @@ static void surface_handle_leave(void *data, struct wl_surface *wl_surface, } #ifdef HAVE_WAYLAND_1_22 - static void surface_handle_preferred_buffer_scale(void *data, struct wl_surface *wl_surface, int32_t scale) @@ -828,7 +827,6 @@ static void surface_handle_preferred_buffer_transform(void *data, uint32_t transform) { } - #endif static const struct wl_surface_listener surface_listener = { @@ -987,7 +985,6 @@ static void handle_toplevel_close(void *data, struct xdg_toplevel *xdg_toplevel) mp_input_put_key(wl->vo->input_ctx, MP_KEY_CLOSE_WIN); } -#ifdef XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION static void handle_configure_bounds(void *data, struct xdg_toplevel *xdg_toplevel, int32_t width, int32_t height) { @@ -995,14 +992,11 @@ static void handle_configure_bounds(void *data, struct xdg_toplevel *xdg_topleve wl->bounded_width = width * wl->scaling; wl->bounded_height = height * wl->scaling; } -#endif static const struct xdg_toplevel_listener xdg_toplevel_listener = { handle_toplevel_config, handle_toplevel_close, -#ifdef XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION handle_configure_bounds, -#endif }; #if HAVE_WAYLAND_PROTOCOLS_1_31 @@ -1176,7 +1170,6 @@ static const struct zwp_linux_dmabuf_v1_listener dmabuf_listener = { dmabuf_format }; -#if HAVE_WAYLAND_PROTOCOLS_1_24 static void done(void *data, struct zwp_linux_dmabuf_feedback_v1 *zwp_linux_dmabuf_feedback_v1) { @@ -1236,7 +1229,6 @@ static const struct zwp_linux_dmabuf_feedback_v1_listener dmabuf_feedback_listen tranche_formats, tranche_flags, }; -#endif static void registry_handle_add(void *data, struct wl_registry *reg, uint32_t id, const char *interface, uint32_t ver) @@ -1267,10 +1259,8 @@ static void registry_handle_add(void *data, struct wl_registry *reg, uint32_t id if (!strcmp (interface, zwp_linux_dmabuf_v1_interface.name) && (ver >= 4) && found++) { wl->dmabuf = wl_registry_bind(reg, id, &zwp_linux_dmabuf_v1_interface, 4); -#if HAVE_WAYLAND_PROTOCOLS_1_24 wl->dmabuf_feedback = zwp_linux_dmabuf_v1_get_default_feedback(wl->dmabuf); zwp_linux_dmabuf_feedback_v1_add_listener(wl->dmabuf_feedback, &dmabuf_feedback_listener, wl); -#endif } else if (!strcmp (interface, zwp_linux_dmabuf_v1_interface.name) && (ver >= 2) && found++) { wl->dmabuf = wl_registry_bind(reg, id, &zwp_linux_dmabuf_v1_interface, 2); zwp_linux_dmabuf_v1_add_listener(wl->dmabuf, &dmabuf_listener, wl); @@ -2397,10 +2387,8 @@ void vo_wayland_uninit(struct vo *vo) if (wl->dmabuf) zwp_linux_dmabuf_v1_destroy(wl->dmabuf); -#if HAVE_WAYLAND_PROTOCOLS_1_24 if (wl->dmabuf_feedback) zwp_linux_dmabuf_feedback_v1_destroy(wl->dmabuf_feedback); -#endif if (wl->seat) wl_seat_destroy(wl->seat); diff --git a/video/out/wayland_common.h b/video/out/wayland_common.h index d22e91d5e5..a524c530fa 100644 --- a/video/out/wayland_common.h +++ b/video/out/wayland_common.h @@ -99,8 +99,7 @@ struct vo_wayland_state { /* linux-dmabuf */ struct zwp_linux_dmabuf_v1 *dmabuf; - /* TODO: unvoid this if required wayland protocols is bumped to 1.24+ */ - void *dmabuf_feedback; + struct zwp_linux_dmabuf_feedback_v1 *dmabuf_feedback; wayland_format *format_map; uint32_t format_size; bool using_dmabuf_wayland; diff --git a/waftools/checks/custom.py b/waftools/checks/custom.py index 9e060c522d..844d708c91 100644 --- a/waftools/checks/custom.py +++ b/waftools/checks/custom.py @@ -102,7 +102,7 @@ def check_lua(ctx, dependency_identifier): def check_wl_protocols(ctx, dependency_identifier): def fn(ctx, dependency_identifier): - ret = check_pkg_config_datadir("wayland-protocols", ">= 1.15") + ret = check_pkg_config_datadir("wayland-protocols", ">= 1.25") ret = ret(ctx, dependency_identifier) if ret != None: ctx.env.WL_PROTO_DIR = ret.split()[0] diff --git a/wscript b/wscript index adc64f1535..22032bcd65 100644 --- a/wscript +++ b/wscript @@ -544,11 +544,6 @@ video_output_features = [ 'func': check_pkg_config('wayland-client', '>= 1.20.0', 'wayland-cursor', '>= 1.20.0', 'xkbcommon', '>= 0.3.0'), - } , { - 'name': 'wayland-protocols-1-24', - 'desc': 'wayland-protocols version 1.24+', - 'deps': 'wayland', - 'func': check_pkg_config('wayland-protocols >= 1.24'), } , { 'name': 'wayland-protocols-1-27', 'desc': 'wayland-protocols version 1.27+', -- cgit v1.2.3