[v2 1/7] drm: Add gamma mode caps property

Sam Ravnborg sam at ravnborg.org
Mon Apr 1 18:33:07 UTC 2019


Hi Uma.

> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index 58ad983..cdfda90 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -249,6 +249,13 @@ struct drm_crtc_state {
>  	struct drm_property_blob *mode_blob;
>  
>  	/**
> +	 * @gamma_mode:
> +	 *
> +	 * FIXME
> +	 */
> +	struct drm_property_blob *gamma_mode_caps;

This looks wrong as "gamma_mode" != "gamma_mode_caps".
Could you fix it, and also add some documentation to help
the next reader.

> +/*
> + * DRM_MODE_LUT_GAMMA|DRM_MODE_LUT_DEGAMMA is legal and means the LUT
> + * can be used for either purpose, but not simultaneously. To expose
> + * modes that support gamma and degamma simultaneously the gamma mode
> + * must declare distinct DRM_MODE_LUT_GAMMA and DRM_MODE_LUT_DEGAMMA
> + * ranges.
> + */
> +/* LUT is for gamma (after CTM) */
> +#define DRM_MODE_LUT_GAMMA (1 << 0)
> +/* LUT is for degamma (before CTM) */
> +#define DRM_MODE_LUT_DEGAMMA (1 << 1)
> +/* linearly interpolate between the points */
> +#define DRM_MODE_LUT_INTERPOLATE (1 << 2)

Use BIT(2), and same for the other bits above and below?

> +/*
> + * the last value of the previous range is the
> + * first value of the current range.
> + */
> +#define DRM_MODE_LUT_REUSE_LAST (1 << 3)
> +/* the curve must be non-decreasing */
> +#define DRM_MODE_LUT_NON_DECREASING (1 << 4)
> +/* the curve is reflected across origin for negative inputs */
> +#define DRM_MODE_LUT_REFLECT_NEGATIVE (1 << 5)
> +/* the same curve (red) is used for blue and green channels as well */
> +#define DRM_MODE_LUT_SINGLE_CHANNEL (1 << 6)

	Sam



More information about the dri-devel mailing list