diff options
author | Dave Airlie <[email protected]> | 2014-06-27 11:38:21 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2014-06-27 11:39:34 +1000 |
commit | e4419913bf0b12e33e91f1947295b67eff0d341e (patch) | |
tree | 85733a062bb2d60b45359927e0e6f9a039295aa2 /src/glx | |
parent | b4dcf87f34f68111acd9d364739938721fc692f4 (diff) |
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 <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/glx')
-rw-r--r-- | src/glx/dri3_glx.c | 16 |
1 files changed, 6 insertions, 10 deletions
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; |