diff options
author | emersion <contact@emersion.fr> | 2018-03-15 12:45:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-15 12:45:07 +0100 |
commit | de0e40d621c51cf075825633946a9ac7f98ac213 (patch) | |
tree | f3ba050e4307a8fac76dbe7a5738332338c8c7e8 /include/wlr/render/egl.h | |
parent | 85da9df8072ff200260eea73dc169d2b50ef0e7d (diff) | |
parent | 653bc282a7f814341f6d7429000928bc696e215e (diff) |
Merge pull request #698 from agx/linux-dmabuf
Add initial linux_dmabuf protocol support
Diffstat (limited to 'include/wlr/render/egl.h')
-rw-r--r-- | include/wlr/render/egl.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/wlr/render/egl.h b/include/wlr/render/egl.h index 97a28016..f05a9837 100644 --- a/include/wlr/render/egl.h +++ b/include/wlr/render/egl.h @@ -6,6 +6,7 @@ #include <pixman.h> #include <stdbool.h> #include <wayland-server.h> +#include <wlr/types/wlr_linux_dmabuf.h> struct wlr_egl { EGLDisplay display; @@ -18,6 +19,8 @@ struct wlr_egl { struct { bool buffer_age; bool swap_buffers_with_damage; + bool dmabuf_import; + bool dmabuf_import_modifiers; } egl_exts; struct wl_display *wl_display; @@ -62,6 +65,31 @@ EGLImageKHR wlr_egl_create_image(struct wlr_egl *egl, EGLenum target, EGLClientBuffer buffer, const EGLint *attribs); /** + * Creates an egl image from the given dmabuf attributes. Check usability + * of the dmabuf with wlr_egl_check_import_dmabuf once first. + */ +EGLImageKHR wlr_egl_create_image_from_dmabuf(struct wlr_egl *egl, + struct wlr_dmabuf_buffer_attribs *attributes); + +/** + * Try to import the given dmabuf. On success return true false otherwise. + * If this succeeds the dmabuf can be used for rendering on a texture + */ +bool wlr_egl_check_import_dmabuf(struct wlr_egl *egl, + struct wlr_dmabuf_buffer *dmabuf); + +/** + * Get the available dmabuf formats + */ +int wlr_egl_get_dmabuf_formats(struct wlr_egl *egl, int **formats); + +/** + * Get the available dmabuf modifiers for a given format + */ +int wlr_egl_get_dmabuf_modifiers(struct wlr_egl *egl, int format, + uint64_t **modifiers); + +/** * Destroys an egl image created with the given wlr_egl. */ bool wlr_egl_destroy_image(struct wlr_egl *egl, EGLImageKHR image); |