[Spice-devel] [PATCH 2/2] When DebugRenderFallbacks is turned on, print debug spew in many cases

Søren Sandmann Pedersen ssp at redhat.com
Thu Mar 28 05:44:49 PDT 2013


Whenever we can't accelerate, and DebugRenderFallbacks is turned on,
print out the reason we couldn't accelerate.
---
 src/qxl_uxa.c |   65 +++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 56 insertions(+), 9 deletions(-)

diff --git a/src/qxl_uxa.c b/src/qxl_uxa.c
index 1810181..b4ab579 100644
--- a/src/qxl_uxa.c
+++ b/src/qxl_uxa.c
@@ -158,7 +158,7 @@ qxl_done_copy (PixmapPtr dest)
  * Composite
  */
 static Bool
-can_accelerate_picture (PicturePtr pict)
+can_accelerate_picture (qxl_screen_t *qxl, PicturePtr pict)
 {
     if (!pict)
 	return TRUE;
@@ -167,11 +167,25 @@ can_accelerate_picture (PicturePtr pict)
 	pict->format != PICT_x8r8g8b8		&&
 	pict->format != PICT_a8)
     {
-	return FALSE;
+        if (qxl->debug_render_fallbacks)
+        {
+            ErrorF ("Image with format %x can't be accelerated \n",
+                    pict->format);
+        }
+
+        return FALSE;
     }
 
     if (!pict->pDrawable)
+    {
+        if (qxl->debug_render_fallbacks)
+        {
+            ErrorF ("Source image (of type %d) can't be accelerated\n",
+                    pict->pSourcePict->type);
+        }
+     
 	return FALSE;
+    }
 
     if (pict->transform)
     {
@@ -179,6 +193,9 @@ can_accelerate_picture (PicturePtr pict)
 	    pict->transform->matrix[2][1] != 0	||
 	    pict->transform->matrix[2][2] != pixman_int_to_fixed (1))
 	{
+            if (qxl->debug_render_fallbacks)
+                ErrorF ("Image with non-affine transform can't be accelerated\n");
+
 	    return FALSE;
 	}
     }
@@ -186,7 +203,13 @@ can_accelerate_picture (PicturePtr pict)
     if (pict->filter != PictFilterBilinear	&&
 	pict->filter != PictFilterNearest)
     {
-	return FALSE;
+        if (qxl->debug_render_fallbacks)
+        {
+            ErrorF ("Image with filter type %d can't be accelerated\n",
+                    pict->filter);
+        }
+
+        return FALSE;
     }
 
     return TRUE;
@@ -212,9 +235,29 @@ static Bool
 qxl_has_a8_surfaces (qxl_screen_t *qxl)
 {
 #ifndef XSPICE
-    return
-	qxl->pci->revision >= 4			&&
-	QXL_HAS_CAP (qxl, SPICE_DISPLAY_CAP_A8_SURFACE);
+    if (qxl->pci->revision < 4)
+    {
+        if (qxl->debug_render_fallbacks)
+        {
+            ErrorF ("No a8 surface due to revision being %d, which is < 4\n",
+                    qxl->pci->revision);
+        }
+
+        return FALSE;
+    }
+
+    if (!QXL_HAS_CAP (qxl, SPICE_DISPLAY_CAP_COMPOSITE))
+    {
+        if (qxl->debug_render_fallbacks)
+        {
+            ErrorF ("No composite due to client not providing SPICE_DISPLAY_CAP_A8_SURFACE\n");
+        }
+
+        return FALSE;
+    }
+
+    return TRUE;
+
 #else
     /* FIXME */
     return FALSE;
@@ -247,9 +290,9 @@ qxl_check_composite (int op,
     if (!qxl_has_composite (qxl))
 	return FALSE;
 
-    if (!can_accelerate_picture (pSrcPicture)	||
-	!can_accelerate_picture (pMaskPicture)	||
-	!can_accelerate_picture (pDstPicture))
+    if (!can_accelerate_picture (qxl, pSrcPicture)	||
+	!can_accelerate_picture (qxl, pMaskPicture)	||
+	!can_accelerate_picture (qxl, pDstPicture))
     {
 	return FALSE;
     }
@@ -259,6 +302,10 @@ qxl_check_composite (int op,
 	if (accelerated_ops[i] == op)
 	    goto found;
     }
+
+    if (qxl->debug_render_fallbacks)
+        ErrorF ("Compositing operator %d can't be accelerated\n", op);
+
     return FALSE;
 
 found:
-- 
1.7.4



More information about the Spice-devel mailing list