egl/swrast: Enable config extension for swrast
authorAxel Davy <axel.davy@ens.fr>
Fri, 1 May 2015 17:08:37 +0000 (19:08 +0200)
committerAxel Davy <axel.davy@ens.fr>
Mon, 11 May 2015 17:31:44 +0000 (19:31 +0200)
Enables to use dri config for swrast, like vblank_mode.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
src/egl/drivers/dri2/egl_dri2.c
src/gallium/state_trackers/dri/drisw.c
src/mesa/drivers/dri/swrast/swrast.c

index 467b81c6e8d13a504059e111eeebc784978f736f..fe5cbc8815d9230f742b5c11793b89f5d7a6f313 100644 (file)
@@ -576,6 +576,7 @@ dri2_create_screen(_EGLDisplay *disp)
 {
    const __DRIextension **extensions;
    struct dri2_egl_display *dri2_dpy;
+   unsigned i;
 
    dri2_dpy = disp->DriverData;
 
@@ -616,28 +617,26 @@ dri2_create_screen(_EGLDisplay *disp)
    extensions = dri2_dpy->core->getExtensions(dri2_dpy->dri_screen);
    
    if (dri2_dpy->dri2) {
-      unsigned i;
-
       if (!dri2_bind_extensions(dri2_dpy, dri2_core_extensions, extensions))
          goto cleanup_dri_screen;
-
-      for (i = 0; extensions[i]; i++) {
-        if (strcmp(extensions[i]->name, __DRI2_ROBUSTNESS) == 0) {
-            dri2_dpy->robustness = (__DRIrobustnessExtension *) extensions[i];
-        }
-        if (strcmp(extensions[i]->name, __DRI2_CONFIG_QUERY) == 0) {
-           dri2_dpy->config = (__DRI2configQueryExtension *) extensions[i];
-        }
-         if (strcmp(extensions[i]->name, __DRI2_FENCE) == 0) {
-            dri2_dpy->fence = (__DRI2fenceExtension *) extensions[i];
-         }
-      }
    } else {
       assert(dri2_dpy->swrast);
       if (!dri2_bind_extensions(dri2_dpy, swrast_core_extensions, extensions))
          goto cleanup_dri_screen;
    }
 
+   for (i = 0; extensions[i]; i++) {
+      if (strcmp(extensions[i]->name, __DRI2_ROBUSTNESS) == 0) {
+         dri2_dpy->robustness = (__DRIrobustnessExtension *) extensions[i];
+      }
+      if (strcmp(extensions[i]->name, __DRI2_CONFIG_QUERY) == 0) {
+         dri2_dpy->config = (__DRI2configQueryExtension *) extensions[i];
+      }
+      if (strcmp(extensions[i]->name, __DRI2_FENCE) == 0) {
+         dri2_dpy->fence = (__DRI2fenceExtension *) extensions[i];
+      }
+   }
+
    dri2_setup_screen(disp);
 
    return EGL_TRUE;
index 5f69a2d670e744c9ab6c3ceab7896b3d8c041a18..4a2c1bbc2ee33f71d4f551b472e7f76e76aa548f 100644 (file)
@@ -333,6 +333,7 @@ drisw_update_tex_buffer(struct dri_drawable *drawable,
 static const __DRIextension *drisw_screen_extensions[] = {
    &driTexBufferExtension.base,
    &dri2RendererQueryExtension.base,
+   &dri2ConfigQueryExtension.base,
    NULL
 };
 
index 2ddb474dde736db3a23445e4902cd740f645a18c..cbc946c3ffdc768438aa3fc8317e0773ab49c869 100644 (file)
@@ -958,6 +958,7 @@ static const __DRIextension *swrast_driver_extensions[] = {
     &driCoreExtension.base,
     &driSWRastExtension.base,
     &driCopySubBufferExtension.base,
+    &dri2ConfigQueryExtension.base,
     &swrast_vtable.base,
     NULL
 };