diff options
author | Daniel Stone <[email protected]> | 2018-03-19 15:03:22 +0000 |
---|---|---|
committer | Daniel Stone <[email protected]> | 2018-03-20 08:52:59 +0000 |
commit | 478fc2d2a1a392108f48a3ed9aa21b10be72b4a2 (patch) | |
tree | 1d4a23a66bd2897ce6b98783c26ab1b7ab0faec8 /src/egl | |
parent | 9a243eccae618e85aa7af762a4c40ecd8a2e4882 (diff) |
dri3: Don't fail on version mismatch
The previous commit to make DRI3 modifier support optional, breaks with
an updated server and old client.
Make sure we never set multibuffers_available unless we also support it
locally. Make sure we don't call stubs of new-DRI3 functions (or empty
branches) which will never succeed.
Signed-off-by: Daniel Stone <[email protected]>
Reviewed-by: Dave Airlie <[email protected]>
Fixes: 7aeef2d4efdc ("dri3: allow building against older xcb (v3)")
Diffstat (limited to 'src/egl')
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.c | 2 | ||||
-rw-r--r-- | src/egl/drivers/dri2/platform_x11_dri3.c | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 535806e4bfe..45d0c7275c5 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -882,7 +882,7 @@ dri2_setup_extensions(_EGLDisplay *disp) if (!dri2_bind_extensions(dri2_dpy, mandatory_core_extensions, extensions, false)) return EGL_FALSE; -#ifdef HAVE_DRI3 +#ifdef HAVE_DRI3_MODIFIERS dri2_dpy->multibuffers_available = (dri2_dpy->dri3_major_version > 1 || (dri2_dpy->dri3_major_version == 1 && dri2_dpy->dri3_minor_version >= 2)) && diff --git a/src/egl/drivers/dri2/platform_x11_dri3.c b/src/egl/drivers/dri2/platform_x11_dri3.c index de60e952da8..5e531e21cb0 100644 --- a/src/egl/drivers/dri2/platform_x11_dri3.c +++ b/src/egl/drivers/dri2/platform_x11_dri3.c @@ -322,12 +322,12 @@ dri3_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx, return &dri2_img->base; } +#ifdef HAVE_DRI3_MODIFIERS static _EGLImage * dri3_create_image_khr_pixmap_from_buffers(_EGLDisplay *disp, _EGLContext *ctx, EGLClientBuffer buffer, const EGLint *attr_list) { -#ifdef HAVE_DRI3_MODIFIERS struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); struct dri2_egl_image *dri2_img; xcb_dri3_buffers_from_pixmap_cookie_t bp_cookie; @@ -377,23 +377,25 @@ dri3_create_image_khr_pixmap_from_buffers(_EGLDisplay *disp, _EGLContext *ctx, } return &dri2_img->base; -#else - return NULL; -#endif } +#endif static _EGLImage * dri3_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp, _EGLContext *ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attr_list) { +#ifdef HAVE_DRI3_MODIFIERS struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); +#endif switch (target) { case EGL_NATIVE_PIXMAP_KHR: +#ifdef HAVE_DRI3_MODIFIERS if (dri2_dpy->multibuffers_available) return dri3_create_image_khr_pixmap_from_buffers(disp, ctx, buffer, attr_list); +#endif return dri3_create_image_khr_pixmap(disp, ctx, buffer, attr_list); default: return dri2_create_image_khr(drv, disp, ctx, target, buffer, attr_list); |