[Pixman] [PATCH 1/2] pixman: Add support for argb/xrgb float formats, v3.

Chris Wilson chris at chris-wilson.co.uk
Wed Oct 3 09:11:46 UTC 2018


Quoting Maarten Lankhorst (2018-08-01 13:41:33)
> diff --git a/pixman/pixman.h b/pixman/pixman.h
> index 509ba5e534a8..c9bf4faa80d4 100644
> --- a/pixman/pixman.h
> +++ b/pixman/pixman.h
> @@ -647,19 +647,24 @@ struct pixman_indexed
>   * sample implementation allows only packed RGB and GBR
>   * representations for data to simplify software rendering,
>   */
> -#define PIXMAN_FORMAT(bpp,type,a,r,g,b)        (((bpp) << 24) |  \
> +#define PIXMAN_FORMAT_PACKC(val) ((val) <= 10 ? (val) : \
> +                                (val) == 32 ? 11 : 0)
> +#define PIXMAN_FORMAT_UNPACKC(val) ((val) <= 10 ? (val) : \
> +                                   (val) == 11 ? 32 : 0)

We have 4bits, why not reserve 0xf for float32? Certainly you
want space for

#define PIXMAN_FORMAT_PACKED_FLOAT16 0xb
#define PIXMAN_FORMAT_PACKED_FLOAT32 0xc
#define PIXMAN_FORMAT_PACKED_FLOAT64 0xd

I just wonder if we may have 12bpc one day as well, so leaving 0xc clear
has some some appeal.
-Chris


More information about the Pixman mailing list