Skip to content
Snippets Groups Projects
Commit 18f53ab2 authored by Leandro Ribeiro's avatar Leandro Ribeiro
Browse files

libweston: assert that renderer->get_supported_formats() is set


This just documents why we can be sure that
renderer->get_supported_formats() is set in bind_linux_dmabuf().

Signed-off-by: default avatarLeandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: default avatarDaniel Stone <daniels@collabora.com>
parent 60c7fee4
2 merge requests!905color-lcms: Introduction and implementation of LCMS plugin,!544Add support to dma-buf feedback
......@@ -494,8 +494,12 @@ bind_linux_dmabuf(struct wl_client *client,
wl_resource_set_implementation(resource, &linux_dmabuf_implementation,
compositor, NULL);
/* Advertise the formats/modifiers */
/* If we got here, it means that the renderer is able to import dma-buf
* buffers, and so it must have get_supported_formats() set. */
assert(compositor->renderer->get_supported_formats != NULL);
supported_formats = compositor->renderer->get_supported_formats(compositor);
/* Advertise the formats/modifiers */
wl_array_for_each(fmt, &supported_formats->arr) {
modifiers = weston_drm_format_get_modifiers(fmt, &num_modifiers);
for (i = 0; i < num_modifiers; i++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment