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 <daniels@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Fixes: 7aeef2d4ef ("dri3: allow building against older xcb (v3)")
This commit is contained in:
Daniel Stone
2018-03-19 15:03:22 +00:00
parent 9a243eccae
commit 478fc2d2a1
5 changed files with 20 additions and 9 deletions

View File

@@ -357,10 +357,12 @@ 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;
#ifdef HAVE_DRI3_MODIFIERS
const struct dri3_display *const pdp = (struct dri3_display *)
base->display->dri3Display;
#endif
pdraw = calloc(1, sizeof(*pdraw));
if (!pdraw)
@@ -371,11 +373,13 @@ dri3_create_drawable(struct glx_screen *base, XID xDrawable,
pdraw->base.drawable = drawable;
pdraw->base.psc = &psc->base;
#ifdef HAVE_DRI3_MODIFIERS
if ((psc->image && psc->image->base.version >= 15) &&
(pdp->dri3Major > 1 || (pdp->dri3Major == 1 && pdp->dri3Minor >= 2)) &&
(pdp->presentMajor > 1 ||
(pdp->presentMajor == 1 && pdp->presentMinor >= 2)))
has_multibuffer = true;
#endif
(void) __glXInitialize(psc->base.dpy);