Skip to content

Commit 8f959d3

Browse files
melissawenalexdeucher
authored andcommitted
drm/amd/display: fix wrong color value mapping on MCM shaper LUT
Some shimmer/colorful points appears when using the steamOS color pipeline for HDR on gaming with DCN32. These points look like black values being wrongly mapped to red/blue/green values. It was caused because the number of hw points in regular LUTs and in a shaper LUT was treated as the same. DCN3+ regular LUTs have 257 bases and implicit deltas (i.e. HW calculates them), but shaper LUT is a special case: it has 256 bases and 256 deltas, as in DCN1-2 regular LUTs, and outputs 14-bit values. Fix that by setting by decreasing in 1 the number of HW points computed in the LUT segmentation so that shaper LUT (i.e. fixpoint == true) keeps the same DCN10 CM logic and regular LUTs go with `hw_points + 1`. CC: Krunoslav Kovac <[email protected]> Fixes: 4d5fd3d ("drm/amd/display: PQ tail accuracy") Signed-off-by: Melissa Wen <[email protected]> Reviewed-by: Alex Hung <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit 5006505)
1 parent 243b467 commit 8f959d3

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

drivers/gpu/drm/amd/display/dc/dcn30/dcn30_cm_common.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ bool cm3_helper_translate_curve_to_hw_format(
163163
hw_points += (1 << seg_distr[k]);
164164
}
165165

166+
// DCN3+ have 257 pts in lieu of no separate slope registers
167+
// Prior HW had 256 base+slope pairs
168+
// Shaper LUT (i.e. fixpoint == true) is still 256 bases and 256 deltas
169+
hw_points = fixpoint ? (hw_points - 1) : hw_points;
170+
166171
j = 0;
167172
for (k = 0; k < (region_end - region_start); k++) {
168173
increment = NUMBER_SW_SEGMENTS / (1 << seg_distr[k]);
@@ -223,8 +228,6 @@ bool cm3_helper_translate_curve_to_hw_format(
223228
corner_points[1].green.slope = dc_fixpt_zero;
224229
corner_points[1].blue.slope = dc_fixpt_zero;
225230

226-
// DCN3+ have 257 pts in lieu of no separate slope registers
227-
// Prior HW had 256 base+slope pairs
228231
lut_params->hw_points_num = hw_points + 1;
229232

230233
k = 0;

0 commit comments

Comments
 (0)