gl-renderer: add dmabuf import

Graphics / Wayland / Weston - Pekka Paalanen [collabora.co.uk] - 14 August 2015 07:53 UTC

Import dmabuf as an EGLImage, and hold on to the EGLImage until we are signalled a content change. On content change, destroy the EGLImage and re-import to trigger GPU cache flushes.

We hold on to the EGLImage as long as possible just in case the client does other imports that might later make re-importing fail.

As dmabuf protocol uses drm_fourcc codes, we need libdrm for drm_fourcc.h. However, we are not doing any libdrm function calls, so there is no new need to link to libdrm.

RFCv1 changes:- fix error if dmabuf exposed unsupported- always use GL_TEXTURE_EXTERNAL_OES with dmabuf

v2 changes:- improve support check and error handling- hold on to the imported EGLImage to avoid the dmabuf becoming unimportable in the future- send internal errors with linux_dmabuf_buffer_send_server_error()- import EGL_EXT_image_dma_buf_import extension headers- use heuristics to decide between GL_TEXTURE_2D and GL_TEXTURE_EXTERNAL_OES- add comment about Mesa requirements- change y-invert from per-plane boolean to per-buffer flag

a352580 gl-renderer: add dmabuf import
Makefile.am | 1 +
configure.ac | 1 +
src/gl-renderer.c | 233 ++++++++++++++++++++++++++++++++++++++++++++++++++
src/weston-egl-ext.h | 16 ++++
4 files changed, 251 insertions(+)

Upstream: cgit.freedesktop.org


  • Share