egl_dri2: Enable image extensions in one place
authorKristian Høgsberg <krh@bitplanet.net>
Tue, 8 Mar 2011 01:18:29 +0000 (20:18 -0500)
committerKristian Høgsberg <krh@bitplanet.net>
Sat, 26 Mar 2011 14:57:31 +0000 (10:57 -0400)
We know what we can support in egl_dri2.c so just enable the extensions
there.

src/egl/drivers/dri2/egl_dri2.c
src/egl/drivers/dri2/platform_drm.c
src/egl/drivers/dri2/platform_wayland.c
src/egl/drivers/dri2/platform_x11.c

index f7e063b35249423af8699d17da74fcb116650c2a..e5dee5554826eeea1f1d5d34f649655c27a453ac 100644 (file)
@@ -462,6 +462,13 @@ dri2_create_screen(_EGLDisplay *disp)
       }
    }
 
+   if (dri2_dpy->image) {
+      disp->Extensions.MESA_drm_image = EGL_TRUE;
+      disp->Extensions.KHR_image_base = EGL_TRUE;
+      disp->Extensions.KHR_gl_renderbuffer_image = EGL_TRUE;
+      disp->Extensions.KHR_gl_texture_2D_image = EGL_TRUE;
+   }
+
    return EGL_TRUE;
 
  cleanup_dri_screen:
index bd4fa80af59780fe4513e537d63e18e37ce2db47..9c6d3ddac22f877baae0a844a52649d01424a0e4 100644 (file)
@@ -708,11 +708,6 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
    for (i = 0; dri2_dpy->driver_configs[i]; i++)
       dri2_add_config(disp, dri2_dpy->driver_configs[i], i + 1, 0, 0, NULL);
 
-   disp->Extensions.MESA_drm_image = EGL_TRUE;
-   disp->Extensions.KHR_image_base = EGL_TRUE;
-   disp->Extensions.KHR_gl_renderbuffer_image = EGL_TRUE;
-   disp->Extensions.KHR_gl_texture_2D_image = EGL_TRUE;
-
 #ifdef HAVE_WAYLAND_PLATFORM
    disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
 #endif
index 6ae3f6554b16ef91d544fe96862814a88afc9b04..6969c137da84e14cc74cdfab658d9a7f5c100ae6 100644 (file)
@@ -677,11 +677,7 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
                      EGL_WINDOW_BIT | EGL_PIXMAP_BIT, NULL);
 
 
-   disp->Extensions.MESA_drm_image = EGL_TRUE;
-   disp->Extensions.KHR_image_base = EGL_TRUE;
    disp->Extensions.KHR_image_pixmap = EGL_TRUE;
-   disp->Extensions.KHR_gl_renderbuffer_image = EGL_TRUE;
-   disp->Extensions.KHR_gl_texture_2D_image = EGL_TRUE;
 
    disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
    dri2_dpy->authenticate = dri2_wayland_authenticate;
index b3e60b8a1153f8227503e402555d854aebc99ce4..30372caadcdfc8b9523737366ee98183bfbfc12c 100644 (file)
@@ -1030,11 +1030,7 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
         goto cleanup_configs;
    }
 
-   disp->Extensions.MESA_drm_image = EGL_TRUE;
-   disp->Extensions.KHR_image_base = EGL_TRUE;
    disp->Extensions.KHR_image_pixmap = EGL_TRUE;
-   disp->Extensions.KHR_gl_renderbuffer_image = EGL_TRUE;
-   disp->Extensions.KHR_gl_texture_2D_image = EGL_TRUE;
    disp->Extensions.NOK_swap_region = EGL_TRUE;
    disp->Extensions.NOK_texture_from_pixmap = EGL_TRUE;