OSDN Git Service

st/xorg: add some debugging helpers
authorZack Rusin <zackr@vmware.com>
Mon, 14 Sep 2009 23:01:21 +0000 (19:01 -0400)
committerZack Rusin <zackr@vmware.com>
Mon, 14 Sep 2009 23:03:28 +0000 (19:03 -0400)
src/gallium/state_trackers/xorg/xorg_composite.c
src/gallium/state_trackers/xorg/xorg_exa.c

index 15c9554..e45a829 100644 (file)
@@ -653,17 +653,12 @@ boolean xorg_solid_bind_state(struct exa_context *exa,
 
    exa->solid_color[3] = 1.f;
 
+#if 0
    debug_printf("Color Pixel=(%d, %d, %d, %d), RGBA=(%f, %f, %f, %f)\n",
                 (fg >> 24) & 0xff, (fg >> 16) & 0xff,
                 (fg >> 8) & 0xff,  (fg >> 0) & 0xff,
                 exa->solid_color[0], exa->solid_color[1],
                 exa->solid_color[2], exa->solid_color[3]);
-
-#if 0
-   exa->solid_color[0] = 1.f;
-   exa->solid_color[1] = 0.f;
-   exa->solid_color[2] = 0.f;
-   exa->solid_color[3] = 1.f;
 #endif
 
    vs_traits = VS_SOLID_FILL;
@@ -691,9 +686,6 @@ void xorg_solid(struct exa_context *exa,
    struct pipe_buffer *buf = 0;
    float vertices[4][2][4];
 
-   x0 = 10; y0 = 10;
-   x1 = 300; y1 = 300;
-
    /* 1st vertex */
    setup_vertex0(vertices[0], x0, y0,
                  exa->solid_color);
@@ -861,8 +853,10 @@ static void renderer_copy_texture(struct exa_context *exa,
    t1 = 1;
 #endif
 
-   assert(screen->is_format_supported(screen, dst_surf->format, PIPE_TEXTURE_2D,
-                                      PIPE_TEXTURE_USAGE_RENDER_TARGET, 0));
+   assert(screen->is_format_supported(screen, dst_surf->format,
+                                      PIPE_TEXTURE_2D,
+                                      PIPE_TEXTURE_USAGE_RENDER_TARGET,
+                                      0));
 
    /* save state (restored below) */
    cso_save_blend(exa->cso);
@@ -966,6 +960,8 @@ void xorg_copy_pixmap(struct exa_context *ctx,
    struct pipe_texture *dst = dst_priv->tex;
    struct pipe_texture *src = src_priv->tex;
 
+   xorg_exa_finish(ctx);
+
    dst_loc[0] = dx;
    dst_loc[1] = dy;
    dst_loc[2] = width;
index 312dab1..0d60b96 100644 (file)
@@ -47,6 +47,8 @@
 
 #include "util/u_rect.h"
 
+#define DEBUG_SOLID 0
+
 /*
  * Helper functions
  */
@@ -253,7 +255,7 @@ ExaDone(PixmapPtr pPixmap)
 #if 1
     xorg_exa_flush(exa, PIPE_FLUSH_RENDER_CACHE, NULL);
 #else
-    xorg_finish(exa);
+    xorg_exa_finish(exa);
 #endif
     xorg_exa_common_done(exa);
 }
@@ -276,7 +278,9 @@ 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");
+#endif
     if (pPixmap->drawable.depth < 15)
        return FALSE;
 
@@ -292,7 +296,14 @@ ExaPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg)
     if (!exa->pipe)
        return FALSE;
 
+
+#if DEBUG_SOLID
+    fg = 0xffff0000;
+#endif
+
+#if 1
     debug_printf("  ExaPrepareSolid(0x%x)\n", fg);
+#endif
     return xorg_solid_bind_state(exa, priv, fg);
 }
 
@@ -310,11 +321,23 @@ ExaSolid(PixmapPtr pPixmap, int x0, int y0, int x1, int y1)
     if (x0 == 0 && y0 == 0 &&
         x1 == priv->tex->width[0] &&
         y1 == priv->tex->height[0]) {
-       exa->ctx->clear(exa->ctx, PIPE_CLEAR_COLOR | PIPE_CLEAR_DEPTHSTENCIL,
+       exa->ctx->clear(exa->pipe, PIPE_CLEAR_COLOR,
                        exa->solid_color, 1., 0);
     } else
 #endif
-       xorg_solid(exa, priv, x0, y0, x1, y1) ;
+
+#if DEBUG_SOLID
+    xorg_solid(exa, priv, 0, 0, 300, 300);
+    xorg_solid(exa, priv, 300, 300, 350, 350);
+    xorg_solid(exa, priv, 350, 350, 500, 500);
+    xorg_solid(exa, priv,
+               priv->tex->width[0] - 10,
+               priv->tex->height[0] - 10,
+               priv->tex->width[0],
+               priv->tex->height[0]);
+#else
+    xorg_solid(exa, priv, x0, y0, x1, y1) ;
+#endif
 }
 
 static Bool