drm/i915/color: Upscale degamma values for MTL
authorChaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Thu, 27 Jul 2023 12:33:42 +0000 (18:03 +0530)
committerAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Thu, 27 Jul 2023 12:39:10 +0000 (18:09 +0530)
commit435cbb0b0ecd3ffd6468acc09c146aaae0cf48fd
tree7661bb81eb51ba7fea81d2984005d057a4862ce3
parent4948738e296c75de57e0c4a8e8ead1ff2c03fe00
drm/i915/color: Upscale degamma values for MTL

MTL onwards Degamma LUT/PRE-CSC LUT precision has been increased from
16 bits to 24 bits. Currently, drm framework only supports LUTs up to 16
bit precision. Until a new uapi comes along to support higher bitdepth,
upscale the values sent from userland to 24 bit before writing into the
HW to continue supporting degamma on MTL.

Add helper function to upscale or downscale lut values. Parameters
'to' and 'from' needs to be less than 32. This should be sufficient
as currently there are no lut values exceeding 32 bit.

v2: (Jani)
    - Reuse glk_load_degamma_lut()
    - Create a helper function for upscaling values

v3: Fix multi line comment style (Uma)
v4: Remove extra line(Ankit)

Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230727123342.4077017-1-chaitanya.kumar.borah@intel.com
drivers/gpu/drm/i915/display/intel_color.c