Loading drivers/gpu/drm/drm_color_mgmt.c +0 −24 Original line number Diff line number Diff line Loading @@ -87,30 +87,6 @@ * "GAMMA_LUT" property above. */ /** * drm_color_lut_extract - clamp&round LUT entries * @user_input: input value * @bit_precision: number of bits the hw LUT supports * * Extract a degamma/gamma LUT value provided by user (in the form of * &drm_color_lut entries) and round it to the precision supported by the * hardware. */ uint32_t drm_color_lut_extract(uint32_t user_input, uint32_t bit_precision) { uint32_t val = user_input; uint32_t max = 0xffff >> (16 - bit_precision); /* Round only if we're not using full precision. */ if (bit_precision < 16) { val += 1UL << (16 - bit_precision - 1); val >>= 16 - bit_precision; } return clamp_val(val, 0, max); } EXPORT_SYMBOL(drm_color_lut_extract); /** * drm_crtc_enable_color_mgmt - enable color management properties * @crtc: DRM CRTC Loading include/drm/drm_color_mgmt.h +25 −2 Original line number Diff line number Diff line Loading @@ -25,8 +25,6 @@ #include <linux/ctype.h> uint32_t drm_color_lut_extract(uint32_t user_input, uint32_t bit_precision); void drm_crtc_enable_color_mgmt(struct drm_crtc *crtc, uint degamma_lut_size, bool has_ctm, Loading @@ -35,4 +33,29 @@ void drm_crtc_enable_color_mgmt(struct drm_crtc *crtc, int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc, int gamma_size); /** * drm_color_lut_extract - clamp&round LUT entries * @user_input: input value * @bit_precision: number of bits the hw LUT supports * * Extract a degamma/gamma LUT value provided by user (in the form of * &drm_color_lut entries) 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; uint32_t max = 0xffff >> (16 - bit_precision); /* Round only if we're not using full precision. */ if (bit_precision < 16) { val += 1UL << (16 - bit_precision - 1); val >>= 16 - bit_precision; } return clamp_val(val, 0, max); } #endif Loading
drivers/gpu/drm/drm_color_mgmt.c +0 −24 Original line number Diff line number Diff line Loading @@ -87,30 +87,6 @@ * "GAMMA_LUT" property above. */ /** * drm_color_lut_extract - clamp&round LUT entries * @user_input: input value * @bit_precision: number of bits the hw LUT supports * * Extract a degamma/gamma LUT value provided by user (in the form of * &drm_color_lut entries) and round it to the precision supported by the * hardware. */ uint32_t drm_color_lut_extract(uint32_t user_input, uint32_t bit_precision) { uint32_t val = user_input; uint32_t max = 0xffff >> (16 - bit_precision); /* Round only if we're not using full precision. */ if (bit_precision < 16) { val += 1UL << (16 - bit_precision - 1); val >>= 16 - bit_precision; } return clamp_val(val, 0, max); } EXPORT_SYMBOL(drm_color_lut_extract); /** * drm_crtc_enable_color_mgmt - enable color management properties * @crtc: DRM CRTC Loading
include/drm/drm_color_mgmt.h +25 −2 Original line number Diff line number Diff line Loading @@ -25,8 +25,6 @@ #include <linux/ctype.h> uint32_t drm_color_lut_extract(uint32_t user_input, uint32_t bit_precision); void drm_crtc_enable_color_mgmt(struct drm_crtc *crtc, uint degamma_lut_size, bool has_ctm, Loading @@ -35,4 +33,29 @@ void drm_crtc_enable_color_mgmt(struct drm_crtc *crtc, int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc, int gamma_size); /** * drm_color_lut_extract - clamp&round LUT entries * @user_input: input value * @bit_precision: number of bits the hw LUT supports * * Extract a degamma/gamma LUT value provided by user (in the form of * &drm_color_lut entries) 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; uint32_t max = 0xffff >> (16 - bit_precision); /* Round only if we're not using full precision. */ if (bit_precision < 16) { val += 1UL << (16 - bit_precision - 1); val >>= 16 - bit_precision; } return clamp_val(val, 0, max); } #endif