diff options
author | Dudemanguy <random342@airmail.cc> | 2023-01-11 16:39:59 -0600 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-01-12 17:42:35 +0000 |
commit | a5b9d529eec8d4bb6fc858143337c3573ec8afd0 (patch) | |
tree | c05ef053d1ffd6ff456f901c3711368d56b40303 /video/out/wayland_common.c | |
parent | 865a159244d27ccbb537c5c734a93f86d22f9149 (diff) | |
download | mpv-a5b9d529eec8d4bb6fc858143337c3573ec8afd0.tar.bz2 mpv-a5b9d529eec8d4bb6fc858143337c3573ec8afd0.tar.xz |
vo_dmabuf_wayland: drop support for linux-dmabuf-v2
The only real reason this was ever supported is because it was
dramatically simpler than v4, so it was put in as an initial
implementation. Later, v4 support was added and we left v2 for
compatibility, but let's just drop it. Compositors all use v4 nowadays,
and v2 is significantly limited (no modifier support for example). It's
better to just remove this dead code for simplicity.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r-- | video/out/wayland_common.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index dd233119a1..41f6ade83a 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -1082,24 +1082,6 @@ static const struct wl_callback_listener frame_listener = { frame_callback, }; -static void dmabuf_format(void *data, struct zwp_linux_dmabuf_v1 *zwp_linux_dmabuf, - uint32_t format) -{ - struct vo_wayland_state *wl = data; - - if (wl->drm_format_ct == wl->drm_format_ct_max) { - wl->drm_format_ct_max *= 2; - wl->drm_formats = talloc_realloc(wl, wl->drm_formats, int, wl->drm_format_ct_max); - } - - wl->drm_formats[wl->drm_format_ct++] = format; - MP_VERBOSE(wl, "%s is supported by the compositor.\n", mp_tag_str(format)); -} - -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) @@ -1190,11 +1172,6 @@ static void registry_handle_add(void *data, struct wl_registry *reg, uint32_t id 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); - wl->drm_format_ct_max = 64; - wl->drm_formats = talloc_array(wl, int, wl->drm_format_ct_max); } if (!strcmp (interface, wp_viewporter_interface.name) && (ver >= 1) && found++) { @@ -2138,12 +2115,6 @@ bool vo_wayland_supported_format(struct vo *vo, uint32_t drm_format, uint64_t mo return true; } - /* TODO: remove these once zwp_linux_dmabuf_v1 version 2 support is removed. */ - for (int i = 0; i < wl->drm_format_ct; ++i) { - if (drm_format == wl->drm_formats[i]) - return true; - } - return false; } |