Re: [PATCH 3/5] drm: introduce pipe color correction properties

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 26 Feb 2016, Lionel Landwerlin <lionel.g.landwerlin@xxxxxxxxx> 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
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux