EGL_EXT_image_dma_buf_import_modifiers allows querying the formats
and modifiers supported by the platform. expose these to the compositor.
v2:
- change calloc args (Daniel Stone)
- check for modifier support before querying formats (Daniel Stone)
Signed-off-by: Varad Gautam <varad.gautam@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Given that it's used by clients, it's really the very definition of
shared.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
This patch makes use of recently implemented
EGL_KHR_no_config_context extension in Mesa,
which superseeds EGL_MESA_configless_context.
See also (and the follow-up patch):
https://lists.freedesktop.org/archives/mesa-dev/2016-September/128510.html
v2:
- Extend existing infrastructure for EGL_MESA_configless_context
per suggestion from Emmanuel Gil Peyrot.
Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
weston-egl-ext.h has been include in compositor-xx.c file in order to
define EGL_PLATFORM_xxx_KHR extensions used by the compositors.
But in case EGL support is not enabled, all EGL related definition must
be skipped except EGL_PLATFORM_xxx_KHR that must be still defined to
allow compositor-xx.c to build.
Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Will allow us to consolidate the multiple definitions through the tree.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
... and use it from simple-egl and gl-renderer.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
This clarifies what is supposed to be the libweston code.
v2: screen-share.c is already in compositor/ instead.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Benoit Gschwind <gschwind@gnu-log.net>
Acked-by: Benoit Gschwind <gschwind@gnu-log.net>
[Pekka: rebased]
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
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Older versions of Mesa provided header definitions for the
EGL_WL_bind_wayland_display extension, but an earlier version of the
extension which only provided the (un)bind entrypoints, and not
QueryWaylandBuffer. Detect this half-provision and make sure we export
the QueryWaylandBuffer definitions as well.
Fixes build failure with EGL on Ubuntu 12.04.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
Earlier versions of gl2ext.h defined the GL_EXT_unpack_subimage tokens
without the _EXT suffix. That's been fixed and we're using the _EXT
tokens now, but just in case we're using an older, broken header, define
the _EXT tokens manually.
In cases where the GPU can natively handle certain YUV formats,
eglQueryWaylandBufferWL() can return the value EGL_TEXTURE_EXTERNAL_WL
and the compositor will treat the buffer as a single egl-image-external.
See:
http://www.khronos.org/registry/gles/extensions/OES/OES_EGL_image_external.txt
v1: original
v2: rename EGL_TEXTURE_EXTERNAL_OES -> EGL_TEXTURE_EXTERNAL_WL and query
for the extension
v3: fix build without updated mesa headers, if EGL_TEXTURE_EXTERNAL_WL
#define is missing from older mesa headers.
v4: resend without missing parts
Signed-off-by: Rob Clark <rob@ti.com>
This is a workaround for platforms, whose EGL headers miss the
definitions for EGL_WL_bind_wayland_display.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>