Skip to content

Commit 14c8fca

Browse files
ckborahaknautiyal
authored andcommitted
drm/i915/color: Downscale degamma lut values read from hardware
For MTL and beyond, convert back the 24 bit lut values read from HW to 16 bit values to maintain parity with userspace values. This way we avoid pipe config mismatch for pre-csc lut values. v2: Add helper function to downscale values (Jani) Signed-off-by: Chaitanya Kumar Borah <[email protected]> Reviewed-by: Uma Shankar <[email protected]> Signed-off-by: Ankit Nautiyal <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 435cbb0 commit 14c8fca

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/gpu/drm/i915/display/intel_color.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3456,6 +3456,14 @@ static struct drm_property_blob *glk_read_degamma_lut(struct intel_crtc *crtc)
34563456
for (i = 0; i < lut_size; i++) {
34573457
u32 val = intel_de_read_fw(dev_priv, PRE_CSC_GAMC_DATA(pipe));
34583458

3459+
/*
3460+
* For MTL and beyond, convert back the 24 bit lut values
3461+
* read from HW to 16 bit values to maintain parity with
3462+
* userspace values
3463+
*/
3464+
if (DISPLAY_VER(dev_priv) >= 14)
3465+
val = change_lut_val_precision(val, 16, 24);
3466+
34593467
lut[i].red = val;
34603468
lut[i].green = val;
34613469
lut[i].blue = val;

0 commit comments

Comments
 (0)