summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2013-03-28 08:44:49 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2013-04-02 06:54:10 -0400
commit11802306622f5580cd211aec175f9fef714e66e4 (patch)
tree8e8a7c26f84654b9a756f4010cc39dd9dd2f9967
parent6b5df7bb359b548b65033b16ac539bf3dd91793a (diff)
When DebugRenderFallbacks is turned on, print debug spew in many cases
Whenever we can't accelerate, and DebugRenderFallbacks is turned on, print out the reason we couldn't accelerate.
-rw-r--r--src/qxl_uxa.c65
1 files changed, 56 insertions, 9 deletions
diff --git a/src/qxl_uxa.c b/src/qxl_uxa.c
index 9ac78ee..c19982d 100644
--- a/src/qxl_uxa.c
+++ b/src/qxl_uxa.c
@@ -156,7 +156,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;
@@ -165,11 +165,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)
{
@@ -177,6 +191,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;
}
}
@@ -184,7 +201,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;
@@ -210,9 +233,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;
@@ -245,9 +288,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;
}
@@ -257,6 +300,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: