drm/i915: Fix glk+ degamma LUT conversions
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 13 Oct 2023 13:14:02 +0000 (16:14 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 23 Nov 2023 13:11:47 +0000 (15:11 +0200)
commitdeac453244d309ad7a94d0501eb5e0f9d8d1f1df
tree58814c152945dfdffa00860c671c85171c56af7c
parent5d76c8163f09cfee7dbc1870a1154c2ca443528b
drm/i915: Fix glk+ degamma LUT conversions

The current implementation of change_lut_val_precision() is just
a convoluted way of shifting by 8. Implement the proper rounding
by just using drm_color_lut_extract() and intel_color_lut_pack()
like everyone else does.

And as the uapi can't handle >=1.0 values but the hardware
can we need to clamp the results appropriately in the readout
path.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231013131402.24072-5-ville.syrjala@linux.intel.com
Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_color.c