render: add DMA-BUF docs

Document some of the assumptions for DMA-BUF buffer sharing and
modifiers.
This commit is contained in:
Simon Ser 2021-11-24 21:42:08 +01:00 committed by Simon Zeni
parent ef1669d33e
commit 83d78f9fd4
3 changed files with 50 additions and 4 deletions

View file

@ -5,7 +5,7 @@
#include <stddef.h>
#include <stdint.h>
/** A single DRM format */
/** A single DRM format, with a set of modifiers attached. */
struct wlr_drm_format {
// The actual DRM format, from `drm_fourcc.h`
uint32_t format;
@ -17,7 +17,24 @@ struct wlr_drm_format {
uint64_t modifiers[];
};
/** A set of DRM formats */
/**
* A set of DRM formats and modifiers.
*
* This is used to describe the supported format + modifier combinations. For
* instance, backends will report the set they can display, and renderers will
* report the set they can render to. For a more general overview of formats
* and modifiers, see:
* https://lore.kernel.org/dri-devel/20210905122742.86029-1-daniels@collabora.com/
*
* For compatibility with legacy drivers which don't support explicit
* modifiers, the special modifier DRM_FORMAT_MOD_INVALID is used to indicate
* that implicit modifiers are supported. Legacy drivers can also support the
* DRM_FORMAT_MOD_LINEAR modifier, which forces the buffer to have a linear
* layout.
*
* Users must not assume that implicit modifiers are supported unless INVALID
* is listed in the modifier list.
*/
struct wlr_drm_format_set {
// The number of formats
size_t len;