Module: Mesa
Branch: master
Commit: 13fa84e1bcf1e07c69bb678508f8cdb0912b57c5
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=13fa84e1bcf1e07c69bb678508f8cdb0912b57c5

Author: Axel Davy <axel.d...@ens.fr>
Date:   Fri May  1 19:08:37 2015 +0200

egl/swrast: Enable config extension for swrast

Enables to use dri config for swrast, like vblank_mode.

Reviewed-by: Dave Airlie <airl...@redhat.com>

Signed-off-by: Axel Davy <axel.d...@ens.fr>

---

 src/egl/drivers/dri2/egl_dri2.c        |   27 +++++++++++++--------------
 src/gallium/state_trackers/dri/drisw.c |    1 +
 src/mesa/drivers/dri/swrast/swrast.c   |    1 +
 3 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 467b81c..fe5cbc8 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -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;
diff --git a/src/gallium/state_trackers/dri/drisw.c 
b/src/gallium/state_trackers/dri/drisw.c
index 5f69a2d..4a2c1bb 100644
--- a/src/gallium/state_trackers/dri/drisw.c
+++ b/src/gallium/state_trackers/dri/drisw.c
@@ -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
 };
 
diff --git a/src/mesa/drivers/dri/swrast/swrast.c 
b/src/mesa/drivers/dri/swrast/swrast.c
index 2ddb474..cbc946c 100644
--- a/src/mesa/drivers/dri/swrast/swrast.c
+++ b/src/mesa/drivers/dri/swrast/swrast.c
@@ -958,6 +958,7 @@ static const __DRIextension *swrast_driver_extensions[] = {
     &driCoreExtension.base,
     &driSWRastExtension.base,
     &driCopySubBufferExtension.base,
+    &dri2ConfigQueryExtension.base,
     &swrast_vtable.base,
     NULL
 };

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to