diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-06-22 05:37:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-22 05:37:07 -0700 |
commit | e459fe0ec713ea65b35b966f9bb3c6c70c9504aa (patch) | |
tree | bbf22d6d1c6014d6b2174dd37c0e80c2381648b1 /include/wlr/render | |
parent | 47c7674a68ca6adfd0b8151d62c3afae32d69577 (diff) | |
parent | ed7d5b0f53167b6191d408e5c7f20a3672fac3c2 (diff) |
Merge pull request #992 from emersion/screencontent
Implement wlr_export_dmabuf_unstable_v1 protocol
Diffstat (limited to 'include/wlr/render')
-rw-r--r-- | include/wlr/render/dmabuf.h | 7 | ||||
-rw-r--r-- | include/wlr/render/egl.h | 9 | ||||
-rw-r--r-- | include/wlr/render/interface.h | 2 | ||||
-rw-r--r-- | include/wlr/render/wlr_texture.h | 3 |
4 files changed, 19 insertions, 2 deletions
diff --git a/include/wlr/render/dmabuf.h b/include/wlr/render/dmabuf.h index 2e13fe75..78f8c2eb 100644 --- a/include/wlr/render/dmabuf.h +++ b/include/wlr/render/dmabuf.h @@ -1,6 +1,8 @@ #ifndef WLR_RENDER_DMABUF_H #define WLR_RENDER_DMABUF_H +#include <stdint.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) @@ -26,4 +28,9 @@ struct wlr_dmabuf_attributes { int fd[WLR_DMABUF_MAX_PLANES]; }; +/** + * Closes all file descriptors in the DMA-BUF attributes. + */ +void wlr_dmabuf_attributes_finish(struct wlr_dmabuf_attributes *attribs); + #endif diff --git a/include/wlr/render/egl.h b/include/wlr/render/egl.h index 0f591d60..6b887f4f 100644 --- a/include/wlr/render/egl.h +++ b/include/wlr/render/egl.h @@ -18,9 +18,10 @@ struct wlr_egl { struct { bool bind_wayland_display_wl; bool buffer_age_ext; - bool image_dmabuf_import_modifiers_ext; - bool image_dmabuf_import_ext; bool image_base_khr; + bool image_dma_buf_export_mesa; + bool image_dmabuf_import_ext; + bool image_dmabuf_import_modifiers_ext; bool swap_buffers_with_damage_ext; bool swap_buffers_with_damage_khr; } exts; @@ -80,6 +81,10 @@ int wlr_egl_get_dmabuf_formats(struct wlr_egl *egl, int **formats); int wlr_egl_get_dmabuf_modifiers(struct wlr_egl *egl, int format, uint64_t **modifiers); +bool wlr_egl_export_image_to_dmabuf(struct wlr_egl *egl, EGLImageKHR image, + int32_t width, int32_t height, uint32_t flags, + struct wlr_dmabuf_attributes *attribs); + /** * Destroys an EGL image created with the given wlr_egl. */ diff --git a/include/wlr/render/interface.h b/include/wlr/render/interface.h index 80788858..fb427c89 100644 --- a/include/wlr/render/interface.h +++ b/include/wlr/render/interface.h @@ -60,6 +60,8 @@ struct wlr_texture_impl { enum wl_shm_format wl_fmt, uint32_t stride, uint32_t width, uint32_t height, uint32_t src_x, uint32_t src_y, uint32_t dst_x, uint32_t dst_y, const void *data); + bool (*to_dmabuf)(struct wlr_texture *texture, + struct wlr_dmabuf_attributes *attribs); void (*destroy)(struct wlr_texture *texture); }; diff --git a/include/wlr/render/wlr_texture.h b/include/wlr/render/wlr_texture.h index c1633820..785f4fc6 100644 --- a/include/wlr/render/wlr_texture.h +++ b/include/wlr/render/wlr_texture.h @@ -48,6 +48,9 @@ bool wlr_texture_write_pixels(struct wlr_texture *texture, uint32_t src_x, uint32_t src_y, uint32_t dst_x, uint32_t dst_y, const void *data); +bool wlr_texture_to_dmabuf(struct wlr_texture *texture, + struct wlr_dmabuf_attributes *attribs); + /** * Destroys this wlr_texture. */ |