wayland/dma-buf: Move should_send_modifiers() to the top

It's very much an auxiliary method; lets move it to where it belongs,
according to HACKING.md.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1959>
This commit is contained in:
Jonas Ådahl 2021-08-06 17:07:21 +02:00 committed by Marge Bot
parent 43161c6660
commit 4c54b36126

View File

@ -134,6 +134,27 @@ G_DEFINE_TYPE (MetaWaylandDmaBufBuffer, meta_wayland_dma_buf_buffer, G_TYPE_OBJE
G_DEFINE_TYPE (MetaWaylandDmaBufManager, meta_wayland_dma_buf_manager,
G_TYPE_OBJECT)
static gboolean
should_send_modifiers (MetaBackend *backend)
{
MetaSettings *settings = meta_backend_get_settings (backend);
if (meta_settings_is_experimental_feature_enabled (
settings, META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS))
return TRUE;
#ifdef HAVE_NATIVE_BACKEND
if (META_IS_BACKEND_NATIVE (backend))
{
MetaRenderer *renderer = meta_backend_get_renderer (backend);
MetaRendererNative *renderer_native = META_RENDERER_NATIVE (renderer);
return meta_renderer_native_use_modifiers (renderer_native);
}
#endif
return FALSE;
}
static gint
compare_tranches (gconstpointer a,
gconstpointer b)
@ -875,27 +896,6 @@ static const struct zwp_linux_dmabuf_v1_interface dma_buf_implementation =
dma_buf_handle_get_surface_feedback,
};
static gboolean
should_send_modifiers (MetaBackend *backend)
{
MetaSettings *settings = meta_backend_get_settings (backend);
if (meta_settings_is_experimental_feature_enabled (
settings, META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS))
return TRUE;
#ifdef HAVE_NATIVE_BACKEND
if (META_IS_BACKEND_NATIVE (backend))
{
MetaRenderer *renderer = meta_backend_get_renderer (backend);
MetaRendererNative *renderer_native = META_RENDERER_NATIVE (renderer);
return meta_renderer_native_use_modifiers (renderer_native);
}
#endif
return FALSE;
}
static void
send_modifiers (struct wl_resource *resource,
MetaWaylandDmaBufFormat *format,