Skip to content

Commit c8365bb

Browse files
Timur Kristófgregkh
authored andcommitted
drm/amd/display: Fix fractional fb divider in set_pixel_clock_v3
commit 1050747 upstream. For later VBIOS versions, the fractional feedback divider is calculated as the remainder of dividing the feedback divider by a factor, which is set to 1000000. For reference, see: - calculate_fb_and_fractional_fb_divider - calc_pll_max_vco_construct However, in case of old VBIOS versions that have set_pixel_clock_v3, they only have 1 byte available for the fractional feedback divider, and it's expected to be set to the remainder from dividing the feedback divider by 10. For reference see the legacy display code: - amdgpu_pll_compute - amdgpu_atombios_crtc_program_pll This commit fixes set_pixel_clock_v3 by dividing the fractional feedback divider passed to the function by 100000. Fixes: 4562236 ("drm/amd/dc: Add dc display driver (v2)") Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Rodrigo Siqueira <siqueira@igalia.com> Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 027e7ac) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6e31eea commit c8365bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/amd/display/dc/bios/command_table.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ static enum bp_result set_pixel_clock_v3(
993993
allocation.sPCLKInput.usFbDiv =
994994
cpu_to_le16((uint16_t)bp_params->feedback_divider);
995995
allocation.sPCLKInput.ucFracFbDiv =
996-
(uint8_t)bp_params->fractional_feedback_divider;
996+
(uint8_t)(bp_params->fractional_feedback_divider / 100000);
997997
allocation.sPCLKInput.ucPostDiv =
998998
(uint8_t)bp_params->pixel_clock_post_divider;
999999

0 commit comments

Comments
 (0)