[Mesa-dev] [RFC 10/13] dri: introduce YVU420 (YV12)

Kristian Høgsberg krh at bitplanet.net
Tue Feb 26 09:15:54 PST 2013


On Tue, Feb 26, 2013 at 8:19 AM, Topi Pohjolainen
<topi.pohjolainen at intel.com> wrote:
> Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> ---
>  include/GL/internal/dri_interface.h       |    1 +
>  src/mesa/drivers/dri/intel/intel_screen.c |    5 +++++
>  2 files changed, 6 insertions(+)
>
> diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
> index 42147e9..b06bc4a 100644
> --- a/include/GL/internal/dri_interface.h
> +++ b/include/GL/internal/dri_interface.h
> @@ -983,6 +983,7 @@ struct __DRIdri2ExtensionRec {
>  #define __DRI_IMAGE_FOURCC_YUV410      0x39565559
>  #define __DRI_IMAGE_FOURCC_YUV411      0x31315559
>  #define __DRI_IMAGE_FOURCC_YUV420      0x32315559
> +#define __DRI_IMAGE_FOURCC_YVU420      0x32315659

We didnt add any "swizzled" YUV formats since you can just swap the U
and V planes when you create the __DRIimage (swap entry 1 and 2 in the
arrays passed to createImageFromNames).

Kristian

>  #define __DRI_IMAGE_FOURCC_YUV422      0x36315559
>  #define __DRI_IMAGE_FOURCC_YUV444      0x34325559
>  #define __DRI_IMAGE_FOURCC_NV12                0x3231564e
> diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
> index 5040992..698c8ac 100644
> --- a/src/mesa/drivers/dri/intel/intel_screen.c
> +++ b/src/mesa/drivers/dri/intel/intel_screen.c
> @@ -222,6 +222,11 @@ static struct intel_image_format intel_image_formats[] = {
>         { 1, 1, 1, __DRI_IMAGE_FORMAT_R8, 1 },
>         { 2, 1, 1, __DRI_IMAGE_FORMAT_R8, 1 } } },
>
> +   { __DRI_IMAGE_FOURCC_YVU420, __DRI_IMAGE_COMPONENTS_Y_U_V, 3,
> +     { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
> +       { 1, 1, 1, __DRI_IMAGE_FORMAT_R8, 1 },
> +       { 2, 1, 1, __DRI_IMAGE_FORMAT_R8, 1 } } },
> +
>     { __DRI_IMAGE_FOURCC_YUV422, __DRI_IMAGE_COMPONENTS_Y_U_V, 3,
>       { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
>         { 1, 1, 0, __DRI_IMAGE_FORMAT_R8, 1 },
> --
> 1.7.9.5
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list