From: Dave Airlie Date: Fri, 27 Jun 2014 01:38:21 +0000 (+1000) Subject: dri3: fix image extension checking. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e4419913bf0b12e33e91f1947295b67eff0d341e;p=mesa.git dri3: fix image extension checking. Move the image extension setup in with all the others in bind_extensions, and improve the check to both version and function pointer. Reviewed-by: Axel Davy Signed-off-by: Dave Airlie --- diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c index 55eed391a79..edad014b2e8 100644 --- a/src/glx/dri3_glx.c +++ b/src/glx/dri3_glx.c @@ -1594,6 +1594,9 @@ dri3_bind_extensions(struct dri3_screen *psc, struct glx_display * priv, /* internal driver extension, no GL extension exposed */ } + if (strcmp(extensions[i]->name, __DRI_IMAGE) == 0) + psc->image = (__DRIimageExtension *) extensions[i]; + if ((strcmp(extensions[i]->name, __DRI2_CONFIG_QUERY) == 0)) psc->config = (__DRI2configQueryExtension *) extensions[i]; @@ -1712,20 +1715,13 @@ dri3_create_screen(int screen, struct glx_display * priv) goto handle_error; } - extensions = (*psc->core->getExtensions)(psc->driScreen); - - for (i = 0; extensions[i]; i++) { - if (strcmp(extensions[i]->name, __DRI_IMAGE) == 0) - psc->image = (__DRIimageExtension *) extensions[i]; - } + dri3_bind_extensions(psc, priv, driverName); - if (psc->image == NULL) { - ErrorMessageF("image extension not found\n"); + if (!psc->image || psc->image->base.version < 7 || !psc->image->createImageFromFds) { + ErrorMessageF("Version 7 or imageFromFds image extension not found\n"); goto handle_error; } - dri3_bind_extensions(psc, priv, driverName); - if (!psc->f || psc->f->base.version < 4) { ErrorMessageF("Version 4 or later of flush extension not found\n"); goto handle_error;