summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2016-01-21 11:30:15 -0800
committerAdam Jackson <ajax@redhat.com>2016-01-27 09:55:38 -0500
commit71be56c426bd9b66cbc5ab23923f4564e066cd75 (patch)
tree57e8dc19d4ccfbe801166b596dfdfe9946023581
parent6a4f771c5da99d5f723d61e1a780390a5e6b161b (diff)
glamor: Fix copy-like Render operations between 15 and 16 depth.
Reading and writing to 16-depth pixmaps using PICT_x1r5g5b5 ends up failing, unless you're doing a straight copy at the same bpp where the misinterpretation matches on both sides. Fixes rendercheck/blend/over and renderhceck/blend/src in piglit. Please cherry-pick this to active stable branches. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 510c8605641803f1f5b5d2de6d3bb422b148e0e7)
-rw-r--r--glamor/glamor_render.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index d8574ece6..92b6b0cd0 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -512,6 +512,14 @@ static int
compatible_formats(CARD8 op, PicturePtr dst, PicturePtr src)
{
if (op == PictOpSrc) {
+ /* We can't do direct copies between different depths at 16bpp
+ * because r,g,b are allocated to different bits.
+ */
+ if (dst->pDrawable->bitsPerPixel == 16 &&
+ dst->pDrawable->depth != src->pDrawable->depth) {
+ return 0;
+ }
+
if (src->format == dst->format)
return 1;