st/xorg: add easier way of disabling/enabling acceleration
authorZack Rusin <zackr@vmware.com>
Wed, 23 Sep 2009 13:00:58 +0000 (09:00 -0400)
committerZack Rusin <zackr@vmware.com>
Thu, 24 Sep 2009 23:20:41 +0000 (19:20 -0400)
src/gallium/state_trackers/xorg/xorg_composite.c
src/gallium/state_trackers/xorg/xorg_exa.c

index a870ad1049461b7f3b25fddd2a89984e4a24e0a2..bb50289ac6bd3acad80b7a85e68cce6e07e51c24 100644 (file)
@@ -388,7 +388,7 @@ bind_viewport_state(struct exa_context *exa, struct exa_pixmap_priv *pDst)
    int width = pDst->tex->width[0];
    int height = pDst->tex->height[0];
 
-   debug_printf("Bind viewport (%d, %d)\n", width, height);
+   /*debug_printf("Bind viewport (%d, %d)\n", width, height);*/
 
    set_viewport(exa, width, height, Y0_TOP);
 }
@@ -672,7 +672,7 @@ boolean xorg_solid_bind_state(struct exa_context *exa,
    cso_set_vertex_shader_handle(exa->cso, shader.vs);
    cso_set_fragment_shader_handle(exa->cso, shader.fs);
 
-   return FALSE;
+   return TRUE;
 }
 
 void xorg_solid(struct exa_context *exa,
@@ -701,7 +701,6 @@ void xorg_solid(struct exa_context *exa,
 
 
    if (buf) {
-      debug_printf("Drawing buf is %p\n", buf);
       util_draw_vertex_buffer(pipe, buf, 0,
                               PIPE_PRIM_TRIANGLE_FAN,
                               4,  /* verts */
index 6507b2950e2c27617c050e3fdb1198d2d711eba1..deae9d80fdf9d8065d01dacb844d48914b06880a 100644 (file)
@@ -48,6 +48,7 @@
 #include "util/u_rect.h"
 
 #define DEBUG_SOLID 0
+#define DISABLE_ACCEL 1
 
 /*
  * Helper functions
@@ -281,8 +282,8 @@ ExaPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg)
     struct exa_pixmap_priv *priv = exaGetPixmapDriverPrivate(pPixmap);
     struct exa_context *exa = ms->exa;
 
-#if 0
-    debug_printf("ExaPrepareSolid - test\n");
+#if 1
+    debug_printf("ExaPrepareSolid(0x%x)\n", fg);
 #endif
     if (!EXA_PM_IS_SOLID(&pPixmap->drawable, planeMask))
        return FALSE;
@@ -306,11 +307,11 @@ ExaPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg)
     fg = 0xffff0000;
 #endif
 
-#if 1
-    debug_printf("  ExaPrepareSolid(0x%x)\n", fg);
-#endif
-
+#if DISABLE_ACCEL
+    return FALSE;
+#else
     return xorg_solid_bind_state(exa, priv, fg);
+#endif
 }
 
 static void
@@ -403,8 +404,11 @@ ExaPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir,
     exa->copy.src = src_priv;
     exa->copy.dst = priv;
 
-    /*XXX disabled until some issues with syncing are fixed */
+#if DISABLE_ACCEL
     return FALSE;
+#else
+    return TRUE;
+#endif
 }
 
 static void
@@ -437,11 +441,16 @@ ExaPrepareComposite(int op, PicturePtr pSrcPicture,
 
    debug_printf("ExaPrepareComposite\n");
 
+#if DISABLE_ACCEL
+   (void) exa;
+   return FALSE;
+#else
    return xorg_composite_bind_state(exa, op, pSrcPicture, pMaskPicture,
                                     pDstPicture,
                                     exaGetPixmapDriverPrivate(pSrc),
                                     exaGetPixmapDriverPrivate(pMask),
                                     exaGetPixmapDriverPrivate(pDst));
+#endif
 }
 
 static void