[Intel-gfx] [PATCH 2/6] drm: introduce color correction properties

Matt Roper matthew.d.roper at intel.com
Thu Jan 21 11:20:21 PST 2016


On Thu, Jan 21, 2016 at 03:03:49PM +0000, Lionel Landwerlin wrote:
...
> diff --git a/Documentation/DocBook/gpu.tmpl b/Documentation/DocBook/gpu.tmpl
> index 351e801..d2f682c 100644
> --- a/Documentation/DocBook/gpu.tmpl
> +++ b/Documentation/DocBook/gpu.tmpl
> @@ -2092,6 +2092,54 @@ void intel_crt_init(struct drm_device *dev)
>  	<td valign="top" >TBD</td>
>  	</tr>
>  	<tr>
> +	<td valign="top" >“DEGAMMA_LUT”</td>
> +	<td valign="top" >BLOB</td>
> +	<td valign="top" ></td>
> +	<td valign="top" >CRTC</td>
> +	<td valign="top" >DRM property to set the degamma LUT mapping
> +		pixel data from the framebuffer before it is given to the
> +		transformation matrix. The data is an interpreted as an array
> +		of struct drm_color_lut elements.</td>
> +	</tr>
> +	<tr>
> +	<td valign="top" >“DEGAMMA_LUT_SIZE”</td>
> +	<td valign="top" >IMMUTABLE</td>

IMMUTABLE by itself isn't a property type, just a flag that you can
apply in addition to the type.  You probably want "RANGE | IMMUTABLE"
here (and also on GAMMA_LUT_SIZE below).

...snip...
> +	<td valign="top" >“GAMMA_LUT_SIZE”</td>
> +	<td valign="top" >IMMUTABLE</td>
> +	<td valign="top" ></td>
> +	<td valign="top" >CRTC</td>
> +	<td valign="top" >DRM property to gives the size of the LUT to
> +		be set on the GAMMA_LUT property (the size depends on the
> +		underlying hardware).</td>
> +	</tr>
> +	<tr>
>  	<td rowspan="20" valign="top" >i915</td>
>  	<td rowspan="2" valign="top" >Generic</td>
>  	<td valign="top" >"Broadcast RGB"</td>
...snip...
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index d40bab2..6f96c04 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -1542,6 +1542,41 @@ static int drm_mode_create_standard_properties(struct drm_device *dev)
>  		return -ENOMEM;
>  	dev->mode_config.prop_mode_id = prop;
>  
> +	prop = drm_property_create(dev,
> +			DRM_MODE_PROP_BLOB,
> +			"DEGAMMA_LUT", 0);
> +	if (!prop)
> +		return -ENOMEM;
> +	dev->mode_config.degamma_lut_property = prop;
> +
> +	prop = drm_property_create(dev,
> +			DRM_MODE_PROP_IMMUTABLE,

As noted above, you still need to OR in a valid property type (in this
case DRM_MODE_PROP_RANGE); otherwise you'll trip over the the check in
drm_property_type_valid() that gets called at the end of
drm_property_create().


Matt

-- 
Matt Roper
Graphics Software Engineer
IoTG Platform Enabling & Development
Intel Corporation
(916) 356-2795


More information about the Intel-gfx mailing list