gl-renderer: do not expose query_dmabuf_formats and query_dmabuf_modifiers

In commit "libweston: add struct weston_drm_format" struct
weston_drm_format and its helper functions were added to libweston.

The functions query_dmabuf_formats and query_dmabuf_modifiers are very
specific to GL-renderer and its internals. So instead of exposing them
in libweston, query and store DRM formats and modifiers internally in
GL-renderer. Also, add a vfunction to struct weston_renderer in order
to retrieve the formats.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This commit is contained in:
Leandro Ribeiro
2021-03-04 17:47:13 -03:00
committed by Daniel Stone
parent a5560d6dbe
commit 1b403263d4
4 changed files with 89 additions and 46 deletions
+4 -8
View File
@@ -919,6 +919,8 @@ struct weston_plane {
struct wl_list link;
};
struct weston_drm_format_array;
struct weston_renderer {
int (*read_pixels)(struct weston_output *output,
pixman_format_code_t format, void *pixels,
@@ -948,14 +950,8 @@ struct weston_renderer {
bool (*import_dmabuf)(struct weston_compositor *ec,
struct linux_dmabuf_buffer *buffer);
/** On error sets num_formats to zero */
void (*query_dmabuf_formats)(struct weston_compositor *ec,
int **formats, int *num_formats);
/** On error sets num_modifiers to zero */
void (*query_dmabuf_modifiers)(struct weston_compositor *ec,
int format, uint64_t **modifiers,
int *num_modifiers);
const struct weston_drm_format_array *
(*get_supported_formats)(struct weston_compositor *ec);
};
enum weston_capability {