From c01b81c99c9e7d6418611bab4fd709c4c2a8b3d9 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Mon, 1 Apr 2019 19:15:56 +0300 Subject: render: introduce wlr_drm_format_set This types adds a container for formats + modifiers. A list that is of [format [modifier]] was chosen instead of [format modifer] because that is how GBM accepts them. Co-Authored-By: emersion --- include/wlr/render/drm_format_set.h | 27 +++++++++++++++++++++++++++ include/wlr/render/meson.build | 3 ++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 include/wlr/render/drm_format_set.h (limited to 'include/wlr') diff --git a/include/wlr/render/drm_format_set.h b/include/wlr/render/drm_format_set.h new file mode 100644 index 00000000..588914ae --- /dev/null +++ b/include/wlr/render/drm_format_set.h @@ -0,0 +1,27 @@ +#ifndef WLR_RENDER_DRM_FORMAT_SET_H +#define WLR_RENDER_DRM_FORMAT_SET_H + +#include +#include +#include + +struct wlr_drm_format { + uint32_t format; + size_t len, cap; + uint64_t modifiers[]; +}; + +struct wlr_drm_format_set { + size_t len, cap; + struct wlr_drm_format **formats; +}; + +void wlr_drm_format_set_finish(struct wlr_drm_format_set *set); + +const struct wlr_drm_format *wlr_drm_format_set_get( + const struct wlr_drm_format_set *set, uint32_t format); + +bool wlr_drm_format_set_add(struct wlr_drm_format_set *set, uint32_t format, + uint64_t modifier); + +#endif diff --git a/include/wlr/render/meson.build b/include/wlr/render/meson.build index 05127bb7..06ebcc37 100644 --- a/include/wlr/render/meson.build +++ b/include/wlr/render/meson.build @@ -1,9 +1,10 @@ install_headers( 'dmabuf.h', 'egl.h', + 'drm_format_set.h', 'gles2.h', 'interface.h', 'wlr_renderer.h', 'wlr_texture.h', - subdir: 'wlr/render' + subdir: 'wlr/render', ) -- cgit v1.2.3