[Mesa-dev] [PATCH 02/13] drm-uapi: Add fp16 formats to drm_fourcc.h

Emil Velikov emil.l.velikov at gmail.com
Wed Jan 30 16:20:33 UTC 2019


On Mon, 28 Jan 2019 at 18:42, Kevin Strasser <kevin.strasser at intel.com> wrote:
>
> Add 64 bpp 16:16:16:16 half float pixel formats. Each 16 bit component is
> formatted in IEEE-754 half-precision float (binary16) 1:5:10
> MSb-sign:exponent:fraction form.
>
> Signed-off-by: Kevin Strasser <kevin.strasser at intel.com>
> ---
>  include/drm-uapi/drm_fourcc.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/include/drm-uapi/drm_fourcc.h b/include/drm-uapi/drm_fourcc.h
> index 459c51b..89c27f0 100644
> --- a/include/drm-uapi/drm_fourcc.h
> +++ b/include/drm-uapi/drm_fourcc.h
> @@ -105,6 +105,15 @@ extern "C" {
>  #define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */
>  #define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */
>
> +/*
> + * Floating point 64bpp RGB
> + * IEEE 754-2008 binary16 half-precision float
> + * [15:0] sign:exponent:mantissa 1:5:10
> + */
> +#define DRM_FORMAT_XBGR16161616F fourcc_code('X', 'B', '4', 'H') /* [63:0] x:B:G:R 16:16:16:16 little endian */
> +
> +#define DRM_FORMAT_ABGR16161616F fourcc_code('A', 'B', '4', 'H') /* [63:0] A:B:G:R 16:16:16:16 little endian */
> +
>  /* packed YCbCr */
>  #define DRM_FORMAT_YUYV                fourcc_code('Y', 'U', 'Y', 'V') /* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */
>  #define DRM_FORMAT_YVYU                fourcc_code('Y', 'V', 'Y', 'U') /* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */

Changes to drm-uapi should land in the kernel drm-next before being merged here.
Otherwise we may end up with mesa and kernel using different
definitions, resulting in broken code :-(

-Emil


More information about the mesa-dev mailing list