From fbd4319f9a96eaa0fb7b7e0c1bc4cf0638b625d0 Mon Sep 17 00:00:00 2001 From: Nicholas Kazlauskas Date: Mon, 29 Oct 2018 16:33:45 -0400 Subject: [PATCH] Fix unsigned short/unsigned long mixup for usSymClock over HDMI --- drivers/gpu/drm/amd/display/dc/bios/command_table.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table.c b/drivers/gpu/drm/amd/display/dc/bios/command_table.c index 2bd7cd97e00d..0a353a815999 100644 --- a/drivers/gpu/drm/amd/display/dc/bios/command_table.c +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table.c @@ -809,18 +809,17 @@ static enum bp_result transmitter_control_v1_5( * LVDS mode: usPixelClock = pixel clock */ if (cntl->signal == SIGNAL_TYPE_HDMI_TYPE_A) { + uint32_t sym_clock = le16_to_cpu(cntl->pixel_clock / 10); + switch (cntl->color_depth) { case COLOR_DEPTH_101010: - params.usSymClock = - cpu_to_le16((le16_to_cpu(params.usSymClock) * 30) / 24); + params.usSymClock = cpu_to_le16((sym_clock * 30) / 24); break; case COLOR_DEPTH_121212: - params.usSymClock = - cpu_to_le16((le16_to_cpu(params.usSymClock) * 36) / 24); + params.usSymClock = cpu_to_le16((sym_clock * 36) / 24); break; case COLOR_DEPTH_161616: - params.usSymClock = - cpu_to_le16((le16_to_cpu(params.usSymClock) * 48) / 24); + params.usSymClock = cpu_to_le16((sym_clock * 48) / 24); break; default: break; -- 2.17.1