drm/amd/display: Fix pixel clock programming
authorjsg <jsg@openbsd.org>
Mon, 5 Sep 2022 14:18:34 +0000 (14:18 +0000)
committerjsg <jsg@openbsd.org>
Mon, 5 Sep 2022 14:18:34 +0000 (14:18 +0000)
From Ilya Bakoulin
4df54c493e76f3cfa0bc8c54c5c43faa3b6e78d4 in linux 5.15.y/5.15.65
04fb918bf421b299feaee1006e82921d7d381f18 in mainline linux

sys/dev/pci/drm/amd/display/dc/dce/dce_clock_source.c

index 74f8bc7..157d050 100644 (file)
@@ -545,9 +545,11 @@ static void dce112_get_pix_clk_dividers_helper (
                switch (pix_clk_params->color_depth) {
                case COLOR_DEPTH_101010:
                        actual_pixel_clock_100hz = (actual_pixel_clock_100hz * 5) >> 2;
+                       actual_pixel_clock_100hz -= actual_pixel_clock_100hz % 10;
                        break;
                case COLOR_DEPTH_121212:
                        actual_pixel_clock_100hz = (actual_pixel_clock_100hz * 6) >> 2;
+                       actual_pixel_clock_100hz -= actual_pixel_clock_100hz % 10;
                        break;
                case COLOR_DEPTH_161616:
                        actual_pixel_clock_100hz = actual_pixel_clock_100hz * 2;