[PATCH xserver 1/2] glamor: Fix copy-like Render operations between 15 and 16 depth.

Eric Anholt eric at anholt.net
Thu Jan 21 13:06:56 PST 2016


Please cherry-pick this to active stable branches.

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.

Signed-off-by: Eric Anholt <eric at anholt.net>
---
 glamor/glamor_render.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index d8574ec..92b6b0c 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;
 
-- 
2.6.4



More information about the xorg-devel mailing list