[Intel-gfx] [PATCH] drm/i915/icl: Handle YCbCr to RGB conversion for BT2020 case

Ville Syrjälä ville.syrjala at linux.intel.com
Tue May 7 14:06:46 UTC 2019


On Tue, May 07, 2019 at 06:32:57PM +0530, Shashank Sharma wrote:
> From: Uma Shankar <uma.shankar at intel.com>
> 
> Currently input csc for YCbCR to RGB conversion handles only
> BT601 and Bt709. Extending it to support BT2020 as well.
> 
> Signed-off-by: Uma Shankar <uma.shankar at intel.com>
> Signed-off-by: Shashank Sharma <shashank.sharma at intel.com>
> ---
>  drivers/gpu/drm/i915/intel_sprite.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index 44aaeac1b2ed..2536e757bec2 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -433,6 +433,18 @@ icl_program_input_csc(struct intel_plane *plane,
>  			0x9EF8, 0x7800, 0xABF8,
>  			0x0, 0x7800,  0x7ED8,
>  		},
> +		/*
> +		 * BT.2020 full range YCbCr -> full range RGB
> +		 * The matrix required is :
> +		 * [1.000, 0.000, 1.474,
> +		 *  1.000, -0.1645, -0.5713,
> +		 *  1.000, 1.8814, 0.0000]
> +		 */
> +		[DRM_COLOR_YCBCR_BT2020] = {
> +			0x7BC8, 0x7800, 0x0,
> +			0x8928, 0x7800, 0xAA88,
> +			0x0, 0x7800, 0x7F10,
> +		},
>  	};
>  
>  	/* Matrix for Limited Range to Full Range Conversion */
> @@ -461,6 +473,18 @@ icl_program_input_csc(struct intel_plane *plane,
>  			0x8888, 0x7918, 0xADA8,
>  			0x0, 0x7918,  0x6870,
>  		},
> +		/*
> +		 * BT.2020 Limited range YCbCr -> full range RGB
> +		 * The matrix required is :
> +		 * [1.164, 0.000, 1.717,
> +		 *  1.138, -0.1873, -0.6504,
> +		 *  1.1380, 2.1417, 0.0000]

Where are those 1.138 coming from?

> +		 */
> +		[DRM_COLOR_YCBCR_BT2020] = {
> +			0x7DC0, 0x7950, 0x0,
> +			0x8A68, 0x7918, 0xAC00,
> +			0x0, 0x7918, 0x6890,
> +		},
>  	};
>  	const u16 *csc;
>  
> -- 
> 2.17.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel


More information about the Intel-gfx mailing list