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

Dave Airlie airlied at gmail.com
Thu Jan 21 13:16:07 PST 2016


On 22 January 2016 at 07:06, Eric Anholt <eric at anholt.net> wrote:
> 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>

makes sense,
Reviewed-by: Dave Airlie <airlied at redhat.com>

> ---
>  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
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel


More information about the xorg-devel mailing list