[Intel-gfx] [PATCH 3/5] drm: introduce pipe color correction properties
Jani Nikula
jani.nikula at linux.intel.com
Tue Mar 22 09:59:22 UTC 2016
On Fri, 26 Feb 2016, Lionel Landwerlin <lionel.g.landwerlin at intel.com> wrote:
> @@ -2554,6 +2583,21 @@ static inline struct drm_property *drm_property_find(struct drm_device *dev,
> return mo ? obj_to_property(mo) : NULL;
> }
>
> +/*
> + * Extract a degamma/gamma LUT value provided by user and round it to the
> + * precision supported by the hardware.
> + */
> +static inline uint32_t drm_color_lut_extract(uint32_t user_input,
> + uint32_t bit_precision)
> +{
> + uint32_t val = user_input + (1 << (16 - bit_precision - 1));
> + uint32_t max = 0xffff >> (16 - bit_precision);
> +
> + val >>= 16 - bit_precision;
> +
> + return clamp_val(val, 0, max);
> +}
Didn't dig deeper, but sparse complains
CHECK drivers/gpu/drm/i915/intel_color.c
include/drm/drm_crtc.h:2603:40: warning: shift too big (4294967295) for type int
include/drm/drm_crtc.h:2603:40: warning: shift too big (4294967295) for type int
include/drm/drm_crtc.h:2603:40: warning: shift too big (4294967295) for type int
BR,
Jani.
--
Jani Nikula, Intel Open Source Technology Center
More information about the Intel-gfx
mailing list