[v2 2/7] drm/i915: Define color lut range structure

Ville Syrjälä ville.syrjala at linux.intel.com
Mon Apr 8 10:09:27 UTC 2019


On Mon, Apr 01, 2019 at 11:00:06PM +0530, Uma Shankar wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> This defines the color lut ranges for 10bit and multi
> segmented gamma range for ICL.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> Signed-off-by: Uma Shankar <uma.shankar at intel.com>
> ---
>  drivers/gpu/drm/i915/intel_color.c | 301 ++++++++++++++++++++++++++++++++++++-
>  1 file changed, 297 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_color.c b/drivers/gpu/drm/i915/intel_color.c
> index f2907cf..84d93ec 100644
> --- a/drivers/gpu/drm/i915/intel_color.c
> +++ b/drivers/gpu/drm/i915/intel_color.c
> @@ -1083,9 +1083,279 @@ static int icl_color_check(struct intel_crtc_state *crtc_state)
>  	return 0;
>  }
>  
> +enum {
> +	I9XX_LUT_SIZE_8BIT = 256,
> +	I9XX_LUT_SIZE_10BIT = 129,
> +
> +	ILK_LUT_SIZE_10BIT = 1024,
> +	ILK_LUT_SIZE_12BIT = 513,
> +
> +	IVB_LUT_SIZE_SPLIT = 512,
> +
> +	CHV_LUT_SIZE_CGM_DEGAMMA = 65,
> +	CHV_LUT_SIZE_CGM_GAMMA = 257,
> +};
> +
> +#define I9XX_GAMMA_8 \
> +	{ \
> +		.flags = DRM_MODE_LUT_GAMMA, \
> +		.count = 256, \
> +		.input_bpc = 8, .output_bpc = 8, \
> +		.start = 0, .end = (1 << 8) - 1, \
> +		.min = 0, .max = (1 << 8) - 1, \
> +	}
> +
> +static const struct drm_color_lut_range i9xx_gamma_8[] = {
> +	I9XX_GAMMA_8,
> +};
> +
> +static const struct drm_color_lut_range i9xx_gamma_10_slope[] = {
> +	{
> +		.flags = (DRM_MODE_LUT_GAMMA |
> +			  DRM_MODE_LUT_INTERPOLATE |
> +			  DRM_MODE_LUT_NON_DECREASING),
> +		.count = 129,
> +		.input_bpc = 10, .output_bpc = 10,
> +		.start = 0, .end = 1 << 10,
> +		.min = 0, .max = (1 << 10) - 1,
> +	},
> +};

Step 1 should probably be to advertise these for the gamma modes we
currently have, on every platform.

-- 
Ville Syrjälä
Intel


More information about the dri-devel mailing list