Skip to content

Commit 158f994

Browse files
Yihan Zhualexdeucher
authored andcommitted
drm/amd/display: Fix RMCM programming seq errors
[WHY & HOW] Fix RMCM programming sequence errors and mapping issues to pass the RMCM test. Cc: Mario Limonciello <mario.limonciello@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Dmytro Laktyushkin <dmytro.laktyushkin@amd.com> Signed-off-by: Yihan Zhu <Yihan.Zhu@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 11baa49) Cc: stable@vger.kernel.org
1 parent 8724a53 commit 158f994

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4685,7 +4685,10 @@ static void calculate_tdlut_setting(
46854685
//the tdlut is fetched during the 2 row times of prefetch.
46864686
if (p->setup_for_tdlut) {
46874687
*p->tdlut_groups_per_2row_ub = (unsigned int)math_ceil2((double) *p->tdlut_bytes_per_frame / *p->tdlut_bytes_per_group, 1);
4688-
*p->tdlut_opt_time = (*p->tdlut_bytes_per_frame - p->cursor_buffer_size * 1024) / tdlut_drain_rate;
4688+
if (*p->tdlut_bytes_per_frame > p->cursor_buffer_size * 1024)
4689+
*p->tdlut_opt_time = (*p->tdlut_bytes_per_frame - p->cursor_buffer_size * 1024) / tdlut_drain_rate;
4690+
else
4691+
*p->tdlut_opt_time = 0;
46894692
*p->tdlut_drain_time = p->cursor_buffer_size * 1024 / tdlut_drain_rate;
46904693
*p->tdlut_bytes_to_deliver = (unsigned int) (p->cursor_buffer_size * 1024.0);
46914694
}

0 commit comments

Comments
 (0)