diff options
author | Tony Crisci <tony@dubstepdish.com> | 2018-03-22 20:06:53 -0400 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2018-03-22 20:06:53 -0400 |
commit | 30b8fb5572cd59c096b00a26c7a41cd674e9337b (patch) | |
tree | 2a7de55685259200422f2bf23cab909fa788db54 /include/wlr/render/egl.h | |
parent | 8836b167bf0ff152de951f7fdabb1deae85f6e93 (diff) | |
parent | 77d3be66eaabca4309794536984c54a5e94e9eb5 (diff) |
Merge branch 'master' into xdg-positioner
Diffstat (limited to 'include/wlr/render/egl.h')
-rw-r--r-- | include/wlr/render/egl.h | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/include/wlr/render/egl.h b/include/wlr/render/egl.h index 97a28016..aa429e8e 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,14 +65,34 @@ EGLImageKHR wlr_egl_create_image(struct wlr_egl *egl, EGLenum target, EGLClientBuffer buffer, const EGLint *attribs); /** - * Destroys an egl image created with the given wlr_egl. + * Creates an egl image from the given dmabuf attributes. Check usability + * of the dmabuf with wlr_egl_check_import_dmabuf once first. */ -bool wlr_egl_destroy_image(struct wlr_egl *egl, EGLImageKHR image); +EGLImageKHR wlr_egl_create_image_from_dmabuf(struct wlr_egl *egl, + struct wlr_dmabuf_buffer_attribs *attributes); /** - * Returns a string for the last error ocurred with egl. + * 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 */ -const char *egl_error(void); +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); bool wlr_egl_make_current(struct wlr_egl *egl, EGLSurface surface, int *buffer_age); |