Commit 3e780af127282e5e24fa737a5b56d7c4523a72c9

Authored by Jeroen Hofstee
Committed by Anatolij Gustschin
1 parent c1420328dc

video: ipu_disp: remove pixclk fixup

The ipu display insists on having a lower_margin smaller
then 2. If this is not the case it will attempt to force
it and adjust the pixclk accordingly. This multiplies pixclk
in Hz with the width and height, since this is typically
a * 10^7 * b * 10^2 * c * 10^2 this will overflow the
uint_32 and make things even worse. Since this is a
bootloader and the adjustment is neglectible, just force
it to two and warn about it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>

Showing 1 changed file with 6 additions and 25 deletions Side-by-side Diff

drivers/video/ipu_disp.c
... ... @@ -802,28 +802,6 @@
802 802 }
803 803  
804 804 /*
805   - * This function is called to adapt synchronous LCD panel to IPU restriction.
806   - */
807   -void adapt_panel_to_ipu_restricitions(uint32_t *pixel_clk,
808   - uint16_t width, uint16_t height,
809   - uint16_t h_start_width,
810   - uint16_t h_end_width,
811   - uint16_t v_start_width,
812   - uint16_t *v_end_width)
813   -{
814   - if (*v_end_width < 2) {
815   - uint16_t total_width = width + h_start_width + h_end_width;
816   - uint16_t total_height_old = height + v_start_width +
817   - (*v_end_width);
818   - uint16_t total_height_new = height + v_start_width + 2;
819   - *v_end_width = 2;
820   - *pixel_clk = (*pixel_clk) * total_width * total_height_new /
821   - (total_width * total_height_old);
822   - printf("WARNING: adapt panel end blank lines\n");
823   - }
824   -}
825   -
826   -/*
827 805 * This function is called to initialize a synchronous LCD panel.
828 806 *
829 807 * @param disp The DI the panel is attached to.
... ... @@ -880,9 +858,12 @@
880 858 if ((v_sync_width == 0) || (h_sync_width == 0))
881 859 return -EINVAL;
882 860  
883   - adapt_panel_to_ipu_restricitions(&pixel_clk, width, height,
884   - h_start_width, h_end_width,
885   - v_start_width, &v_end_width);
  861 + /* adapt panel to ipu restricitions */
  862 + if (v_end_width < 2) {
  863 + v_end_width = 2;
  864 + puts("WARNING: v_end_width (lower_margin) must be >= 2, adjusted\n");
  865 + }
  866 +
886 867 h_total = width + h_sync_width + h_start_width + h_end_width;
887 868 v_total = height + v_sync_width + v_start_width + v_end_width;
888 869