cm3_helper_translate_curve_to_hw_format() puts PQ, gamma 2.2, and HLG on 32 regions from 2^-25 to 2^7. Gamma 2.4 and 2.6 used the other layout, 12 regions from 2^-12 to 2^0.
The inverse curve is the shaper, and its input is linear light from degamma. A 10-bit code v becomes (v/1023)^g. That is below 2^-12 for v = 1..31 at gamma 2.4 and v = 1..41 at gamma 2.6, so those codes come back as 0. On a gray ramp the round trip then misses the IGT bracket of 13. Gamma 2.4 needs a bracket of 33 and gamma 2.6 needs 41. Gamma 2.2 already uses the wide curve and its round trip is exact. Use the 32-region curve for gamma 2.4 and 2.6. Its low end is 2^-25, which covers those dark codes. On DCN 4.0.1 the gamma 2.4 round trip is exact and gamma 2.6 is off by one 10-bit code, so the original bracket of 13 passes. Signed-off-by: Harry Wentland <[email protected]> --- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_cm_common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_cm_common.c b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_cm_common.c index eb299f7f9c41..8a76e985d359 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_cm_common.c +++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_cm_common.c @@ -133,6 +133,8 @@ bool cm3_helper_translate_curve_to_hw_format(struct dc_context *ctx, memset(seg_distr, 0, sizeof(seg_distr)); if (output_tf->tf == TRANSFER_FUNCTION_PQ || output_tf->tf == TRANSFER_FUNCTION_GAMMA22 || + output_tf->tf == TRANSFER_FUNCTION_GAMMA24 || + output_tf->tf == TRANSFER_FUNCTION_GAMMA26 || output_tf->tf == TRANSFER_FUNCTION_HLG) { /* 32 segments * segments are from 2^-25 to 2^7 -- 2.56.1
