st/xorg: More fallback debugging
authorJakob Bornecrantz <jakob@vmware.com>
Thu, 8 Oct 2009 12:40:19 +0000 (14:40 +0200)
committerJakob Bornecrantz <jakob@vmware.com>
Thu, 8 Oct 2009 12:50:40 +0000 (14:50 +0200)
Change the fallback debugging around a bit and do the old commit correctly

src/gallium/state_trackers/xorg/xorg_composite.c
src/gallium/state_trackers/xorg/xorg_exa.c
src/gallium/state_trackers/xorg/xorg_exa.h

index 7037d17e43f3fa9b6eb7c3c1da6ec417b5ff05fb..98e9933f72dec37582cb42f647e2b0ef94d6d3ad 100644 (file)
@@ -283,6 +283,9 @@ boolean xorg_composite_accelerated(int op,
                                    PicturePtr pMaskPicture,
                                    PicturePtr pDstPicture)
 {
+   ScreenPtr pScreen = pDstPicture->pDrawable->pScreen;
+   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+   modesettingPtr ms = modesettingPTR(pScrn);
    unsigned i;
    unsigned accel_ops_count =
       sizeof(accelerated_ops)/sizeof(struct acceleration_info);
@@ -290,11 +293,11 @@ boolean xorg_composite_accelerated(int op,
    if (pSrcPicture->pSourcePict) {
       /* Gradients not yet supported */
       if (pSrcPicture->pSourcePict->type != SourcePictTypeSolidFill)
-         return FALSE;
+         XORG_FALLBACK("gradients not yet supported");
 
       /* Solid source with mask not yet handled properly */
       if (pMaskPicture)
-         return FALSE;
+         XORG_FALLBACK("solid source with mask not yet handled properly");
    }
 
    for (i = 0; i < accel_ops_count; ++i) {
@@ -306,11 +309,11 @@ boolean xorg_composite_accelerated(int op,
               (!accelerated_ops[i].with_mask ||
                (pMaskPicture->componentAlpha &&
                 !accelerated_ops[i].component_alpha))))
-            return FALSE;
+            XORG_FALLBACK("component alpha unsupported");
          return TRUE;
       }
    }
-   return FALSE;
+   XORG_FALLBACK("unsupported operation");
 }
 
 static void
index 8920b243079775dbbafb4c1e81232b5ae2872e32..3f0ed3d98094de05990f32617d717ab80b988128 100644 (file)
@@ -294,21 +294,21 @@ ExaPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg)
     debug_printf("ExaPrepareSolid(0x%x)\n", fg);
 #endif
     if (!exa->pipe)
-       XORG_FALLBACK("solid accle not enabled");
+       XORG_FALLBACK("accle not enabled");
 
     if (!priv || !priv->tex)
-       XORG_FALLBACK("solid !priv || !priv->tex");
+       XORG_FALLBACK("%s", !priv ? "!priv" : "!priv->tex");
 
     if (!EXA_PM_IS_SOLID(&pPixmap->drawable, planeMask))
-       XORG_FALLBACK("solid planeMask is not solid");
+       XORG_FALLBACK("planeMask is not solid");
 
     if (alu != GXcopy)
-       XORG_FALLBACK("solid not GXcopy");
+       XORG_FALLBACK("not GXcopy");
 
     if (!exa->scrn->is_format_supported(exa->scrn, priv->tex->format,
                                         priv->tex->target,
                                         PIPE_TEXTURE_USAGE_RENDER_TARGET, 0)) {
-       XORG_FALLBACK("solid bad format %s", pf_name(priv->tex->format));
+       XORG_FALLBACK("format %s", pf_name(priv->tex->format));
     }
 
 #if DEBUG_SOLID
@@ -390,29 +390,29 @@ ExaPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir,
     debug_printf("ExaPrepareCopy\n");
 #endif
     if (!exa->pipe)
-       XORG_FALLBACK("copy accle not enabled");
+       XORG_FALLBACK("accle not enabled");
 
-    if (!priv || !src_priv)
-       XORG_FALLBACK("copy !priv || !src_priv");
+    if (!priv || !priv->tex)
+       XORG_FALLBACK("pDst %s", !priv ? "!priv" : "!priv->tex");
 
-    if (!priv->tex || !src_priv->tex)
-       XORG_FALLBACK("copy !priv->tex || !src_priv->tex");
+    if (!src_priv || !src_priv->tex)
+       XORG_FALLBACK("pSrc %s", !src_priv ? "!priv" : "!priv->tex");
 
     if (!EXA_PM_IS_SOLID(&pSrcPixmap->drawable, planeMask))
-       XORG_FALLBACK("copy planeMask is not solid");
+       XORG_FALLBACK("planeMask is not solid");
 
     if (alu != GXcopy)
-       XORG_FALLBACK("copy alu not GXcopy");
+       XORG_FALLBACK("alu not GXcopy");
 
     if (!exa->scrn->is_format_supported(exa->scrn, priv->tex->format,
                                         priv->tex->target,
                                         PIPE_TEXTURE_USAGE_RENDER_TARGET, 0))
-       XORG_FALLBACK("copy pDst format %s", pf_name(priv->tex->format));
+       XORG_FALLBACK("pDst format %s", pf_name(priv->tex->format));
 
     if (!exa->scrn->is_format_supported(exa->scrn, src_priv->tex->format,
                                         src_priv->tex->target,
                                         PIPE_TEXTURE_USAGE_SAMPLER, 0))
-       XORG_FALLBACK("copy pSrc format %s", pf_name(src_priv->tex->format));
+       XORG_FALLBACK("pSrc format %s", pf_name(src_priv->tex->format));
 
     exa->copy.src = src_priv;
     exa->copy.dst = priv;
@@ -459,37 +459,37 @@ ExaPrepareComposite(int op, PicturePtr pSrcPicture,
    debug_printf("ExaPrepareComposite\n");
 #endif
    if (!exa->pipe)
-      XORG_FALLBACK("comp accle not enabled");
+      XORG_FALLBACK("accle not enabled");
 
    priv = exaGetPixmapDriverPrivate(pDst);
    if (!priv || !priv->tex)
-      XORG_FALLBACK("comp pDst %s", !priv ? "!priv" : "!priv->tex");
+      XORG_FALLBACK("pDst %s", !priv ? "!priv" : "!priv->tex");
 
    if (!exa->scrn->is_format_supported(exa->scrn, priv->tex->format,
                                        priv->tex->target,
                                        PIPE_TEXTURE_USAGE_RENDER_TARGET, 0))
-      XORG_FALLBACK("copy pDst format: %s", pf_name(priv->tex->format));
+      XORG_FALLBACK("pDst format: %s", pf_name(priv->tex->format));
 
    if (pSrc) {
       priv = exaGetPixmapDriverPrivate(pSrc);
       if (!priv || !priv->tex)
-         XORG_FALLBACK("comp pSrc %s", !priv ? "!priv" : "!priv->tex");
+         XORG_FALLBACK("pSrc %s", !priv ? "!priv" : "!priv->tex");
 
       if (!exa->scrn->is_format_supported(exa->scrn, priv->tex->format,
                                           priv->tex->target,
                                           PIPE_TEXTURE_USAGE_SAMPLER, 0))
-         XORG_FALLBACK("copy pSrc format: %s", pf_name(priv->tex->format));
+         XORG_FALLBACK("pSrc format: %s", pf_name(priv->tex->format));
    }
 
    if (pMask) {
       priv = exaGetPixmapDriverPrivate(pMask);
       if (!priv || !priv->tex)
-         XORG_FALLBACK("comp pMask %s", !priv ? "!priv" : "!priv->tex");
+         XORG_FALLBACK("pMask %s", !priv ? "!priv" : "!priv->tex");
 
       if (!exa->scrn->is_format_supported(exa->scrn, priv->tex->format,
                                           priv->tex->target,
                                           PIPE_TEXTURE_USAGE_SAMPLER, 0))
-         XORG_FALLBACK("copy pMask format: %s", pf_name(priv->tex->format));
+         XORG_FALLBACK("pMask format: %s", pf_name(priv->tex->format));
    }
 
 #if DISABLE_ACCEL
index d3f25ca844bfd8f93acac54f888c1eb3038aae2f..28834e3ef50e1c2fdd1b34c9d9c2916ef21501c1 100644 (file)
@@ -50,13 +50,13 @@ struct exa_pixmap_priv
    unsigned map_count;
 };
 
-#define XORG_FALLBACK(s, arg...)              \
-do {                                          \
-   if (ms->debug_fallback) {                  \
-      xf86DrvMsg(pScrn->scrnIndex, X_INFO,    \
-                 "fallback: " s "\n", ##arg); \
-   }                                          \
-   return FALSE;                              \
+#define XORG_FALLBACK(s, arg...)                              \
+do {                                                          \
+   if (ms->debug_fallback) {                                  \
+      xf86DrvMsg(pScrn->scrnIndex, X_INFO,                    \
+                 "%s fallback " s "\n", __FUNCTION__, ##arg); \
+   }                                                          \
+   return FALSE;                                              \
 } while(0)
 
 struct pipe_surface *