st/egl: drm_image: Check for MESA_drm_image
authorBenjamin Franzke <benjaminfranzke@googlemail.com>
Fri, 4 Feb 2011 11:27:18 +0000 (12:27 +0100)
committerBenjamin Franzke <benjaminfranzke@googlemail.com>
Mon, 7 Feb 2011 12:55:29 +0000 (13:55 +0100)
MESA_drm_image isnt limited to drm platform,
others can enable the extension too.

src/gallium/state_trackers/egl/common/egl_g3d_image.c

index 78c035a2af059f9c0fb385e6c208435089b7ff7a..81ce7ab45c7a135ac69120e9bc1ad3c5917b37f5 100644 (file)
@@ -135,7 +135,7 @@ egl_g3d_reference_drm_buffer(_EGLDisplay *dpy, EGLint name,
    _EGLImageAttribs attrs;
    EGLint format;
 
-   if (dpy->Platform != _EGL_PLATFORM_DRM)
+   if (!dpy->Extensions.MESA_drm_image)
       return NULL;
 
    if (_eglParseImageAttribList(&attrs, dpy, attribs) != EGL_SUCCESS)
@@ -295,7 +295,7 @@ egl_g3d_export_drm_image(_EGLDriver *drv, _EGLDisplay *dpy, _EGLImage *img,
    struct egl_g3d_image *gimg = egl_g3d_image(img);
    struct winsys_handle wsh;
 
-   if (dpy->Platform != _EGL_PLATFORM_DRM)
+   if (!dpy->Extensions.MESA_drm_image)
       return EGL_FALSE;
 
    /* get shared handle */