diff options
author | Louis-Francis Ratté-Boulianne <lfrb@collabora.com> | 2017-07-07 02:54:26 -0400 |
---|---|---|
committer | Daniel Stone <daniels@collabora.com> | 2018-03-09 17:47:14 +0000 |
commit | 069fdd5f9facbd72fb6a289696c7b74e3237e70f (patch) | |
tree | 1a019e8325ed0d9799d710e6131b38a0cc28721d /src/glx/dri3_glx.c | |
parent | 61309c2a727d52d543207d6ae79fcb3e68b5cff3 (diff) |
egl/x11: Support DRI3 v1.1
Add support for DRI3 v1.1, which allows pixmaps to be backed by
multi-planar buffers, or those with format modifiers. This is both
for allocating render buffers, as well as EGLImage imports from a
native pixmap (EGL_NATIVE_PIXMAP_KHR).
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Diffstat (limited to 'src/glx/dri3_glx.c')
-rw-r--r-- | src/glx/dri3_glx.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c index adfc349968..71ecebbc16 100644 --- a/src/glx/dri3_glx.c +++ b/src/glx/dri3_glx.c @@ -357,7 +357,10 @@ dri3_create_drawable(struct glx_screen *base, XID xDrawable, { struct dri3_drawable *pdraw; struct dri3_screen *psc = (struct dri3_screen *) base; + const struct dri3_display *const pdp = (struct dri3_display *) + base->display->dri3Display; __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) config_base; + bool has_multibuffer = false; pdraw = calloc(1, sizeof(*pdraw)); if (!pdraw) @@ -368,11 +371,16 @@ dri3_create_drawable(struct glx_screen *base, XID xDrawable, pdraw->base.drawable = drawable; pdraw->base.psc = &psc->base; + if ((psc->image && psc->image->base.version >= 15) && + (pdp->dri3Major > 1 || (pdp->dri3Major == 1 && pdp->dri3Minor >= 2))) + has_multibuffer = true; + (void) __glXInitialize(psc->base.dpy); if (loader_dri3_drawable_init(XGetXCBConnection(base->dpy), xDrawable, psc->driScreen, - psc->is_different_gpu, config->driConfig, + psc->is_different_gpu, has_multibuffer, + config->driConfig, &psc->loader_dri3_ext, &glx_dri3_vtable, &pdraw->loader_drawable)) { free(pdraw); |