[Mesa-dev] [PATCH 11/11] dri: Add YVU formats

Jordan Justen jordan.l.justen at intel.com
Mon May 16 19:51:40 UTC 2016


On 2016-05-11 12:22:44, Kristian Høgsberg wrote:
> From: Kristian Høgsberg Kristensen <kristian.h.kristensen at intel.com>
> 
> ---
>  include/GL/internal/dri_interface.h      |  5 +++++
>  src/mesa/drivers/dri/i965/intel_screen.c | 26 ++++++++++++++++++++++++++
>  2 files changed, 31 insertions(+)
> 
> diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
> index 84731a0..4049be6 100644
> --- a/include/GL/internal/dri_interface.h
> +++ b/include/GL/internal/dri_interface.h
> @@ -1158,6 +1158,11 @@ struct __DRIdri2ExtensionRec {
>  #define __DRI_IMAGE_FOURCC_NV16                0x3631564e
>  #define __DRI_IMAGE_FOURCC_YUYV                0x56595559
>  
> +#define __DRI_IMAGE_FOURCC_YVU410      0x39555659
> +#define __DRI_IMAGE_FOURCC_YVU411      0x31315659
> +#define __DRI_IMAGE_FOURCC_YVU420      0x32315659
> +#define __DRI_IMAGE_FOURCC_YVU422      0x36315659
> +#define __DRI_IMAGE_FOURCC_YVU444      0x34325659
>  
>  /**
>   * Queryable on images created by createImageFromNames.
> diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
> index 599ec19..2a11d49 100644
> --- a/src/mesa/drivers/dri/i965/intel_screen.c
> +++ b/src/mesa/drivers/dri/i965/intel_screen.c
> @@ -224,6 +224,7 @@ static struct intel_image_format intel_image_formats[] = {
>     { __DRI_IMAGE_FOURCC_XBGR8888, __DRI_IMAGE_COMPONENTS_RGB, 1,
>       { { 0, 0, 0, __DRI_IMAGE_FORMAT_XBGR8888, 4 }, } },
>  
> +

Bonus newline.

-Jordan

>     { __DRI_IMAGE_FOURCC_RGB565, __DRI_IMAGE_COMPONENTS_RGB, 1,
>       { { 0, 0, 0, __DRI_IMAGE_FORMAT_RGB565, 2 } } },
>  
> @@ -258,6 +259,31 @@ static struct intel_image_format intel_image_formats[] = {
>         { 1, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
>         { 2, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 } } },
>  
> +   { __DRI_IMAGE_FOURCC_YVU410, __DRI_IMAGE_COMPONENTS_Y_U_V, 3,
> +     { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
> +       { 2, 2, 2, __DRI_IMAGE_FORMAT_R8, 1 },
> +       { 1, 2, 2, __DRI_IMAGE_FORMAT_R8, 1 } } },
> +
> +   { __DRI_IMAGE_FOURCC_YVU411, __DRI_IMAGE_COMPONENTS_Y_U_V, 3,
> +     { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
> +       { 2, 2, 0, __DRI_IMAGE_FORMAT_R8, 1 },
> +       { 1, 2, 0, __DRI_IMAGE_FORMAT_R8, 1 } } },
> +
> +   { __DRI_IMAGE_FOURCC_YVU420, __DRI_IMAGE_COMPONENTS_Y_U_V, 3,
> +     { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
> +       { 2, 1, 1, __DRI_IMAGE_FORMAT_R8, 1 },
> +       { 1, 1, 1, __DRI_IMAGE_FORMAT_R8, 1 } } },
> +
> +   { __DRI_IMAGE_FOURCC_YVU422, __DRI_IMAGE_COMPONENTS_Y_U_V, 3,
> +     { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
> +       { 2, 1, 0, __DRI_IMAGE_FORMAT_R8, 1 },
> +       { 1, 1, 0, __DRI_IMAGE_FORMAT_R8, 1 } } },
> +
> +   { __DRI_IMAGE_FOURCC_YVU444, __DRI_IMAGE_COMPONENTS_Y_U_V, 3,
> +     { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
> +       { 2, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
> +       { 1, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 } } },
> +
>     { __DRI_IMAGE_FOURCC_NV12, __DRI_IMAGE_COMPONENTS_Y_UV, 2,
>       { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
>         { 1, 1, 1, __DRI_IMAGE_FORMAT_GR88, 2 } } },
> -- 
> 2.5.0
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list