diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-05-30 08:39:45 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-30 08:39:45 -0400 |
commit | 5d8e38702175fcc7cb991effeadca1f5a9308e6d (patch) | |
tree | 9cbc288ea690b5a038ac0ad7cf198c04d992c89f /include/wlr/render/dmabuf.h | |
parent | 8c9d0f15ce416029256ebb437c99b93f34edba18 (diff) | |
parent | 28020ff57728d07ae0715fc15696b8fe40337b3d (diff) |
Merge pull request #1015 from emersion/dmabuf-single-modifier
Only allow one modifier per DMA-BUF, split attributes struct in render/
Diffstat (limited to 'include/wlr/render/dmabuf.h')
-rw-r--r-- | include/wlr/render/dmabuf.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/wlr/render/dmabuf.h b/include/wlr/render/dmabuf.h new file mode 100644 index 00000000..2e13fe75 --- /dev/null +++ b/include/wlr/render/dmabuf.h @@ -0,0 +1,29 @@ +#ifndef WLR_RENDER_DMABUF_H +#define WLR_RENDER_DMABUF_H + +// So we don't have to pull in linux specific drm headers +#ifndef DRM_FORMAT_MOD_INVALID +#define DRM_FORMAT_MOD_INVALID ((1ULL<<56) - 1) +#endif + +#define WLR_DMABUF_MAX_PLANES 4 + +enum wlr_dmabuf_attributes_flags { + WLR_DMABUF_ATTRIBUTES_FLAGS_Y_INVERT = 1, + WLR_DMABUF_ATTRIBUTES_FLAGS_INTERLACED = 2, + WLR_DMABUF_ATTRIBUTES_FLAGS_BOTTOM_FIRST = 4, +}; + +struct wlr_dmabuf_attributes { + int32_t width, height; + uint32_t format; + uint32_t flags; // enum wlr_dmabuf_attributes_flags + uint64_t modifier; + + int n_planes; + uint32_t offset[WLR_DMABUF_MAX_PLANES]; + uint32_t stride[WLR_DMABUF_MAX_PLANES]; + int fd[WLR_DMABUF_MAX_PLANES]; +}; + +#endif |