summaryrefslogtreecommitdiff
path: root/drivers/mxc
diff options
context:
space:
mode:
authorJason Chen <b02280@freescale.com>2010-12-31 10:15:34 +0800
committerAndy Voltz <andy.voltz@timesys.com>2011-06-01 13:20:19 -0400
commitc56be66145aa01227eaa20552915992f99b9f683 (patch)
treeb273663448d3e7fa4b7ac0298b67c4280cbf0895 /drivers/mxc
parent4ff9c9ac4d627a0307731b436e2224518a328ed0 (diff)
ENGR00137447-3 ipuv3: change video mode timming adjust method
Just change v_sync_start, v_sync_width and v_sync_end to fit ipu restricitions. Signed-off-by: Jason Chen <b02280@freescale.com>
Diffstat (limited to 'drivers/mxc')
-rw-r--r--drivers/mxc/ipu3/ipu_disp.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/mxc/ipu3/ipu_disp.c b/drivers/mxc/ipu3/ipu_disp.c
index f5b9183e389e..8c3167865290 100644
--- a/drivers/mxc/ipu3/ipu_disp.c
+++ b/drivers/mxc/ipu3/ipu_disp.c
@@ -949,20 +949,20 @@ void _ipu_dp_set_csc_coefficients(ipu_channel_t channel, int32_t param[][3])
* This function is called to adapt synchronous LCD panel to IPU restriction.
*
*/
-void adapt_panel_to_ipu_restricitions(uint32_t *pixel_clk,
- uint16_t width, uint16_t height,
- uint16_t h_start_width,
- uint16_t h_end_width,
- uint16_t v_start_width,
- uint16_t *v_end_width)
+void adapt_panel_to_ipu_restricitions(uint16_t *v_start_width,
+ uint16_t *v_sync_width,
+ uint16_t *v_end_width)
{
if (*v_end_width < 2) {
- uint16_t total_width = width + h_start_width + h_end_width;
- uint16_t total_height_old = height + v_start_width + (*v_end_width);
- uint16_t total_height_new = height + v_start_width + 2;
- *v_end_width = 2;
- *pixel_clk = (*pixel_clk) * total_width * total_height_new /
- (total_width * total_height_old);
+ uint16_t diff = 2 - *v_end_width;
+ if (*v_start_width >= diff) {
+ *v_end_width = 2;
+ *v_start_width = *v_start_width - diff;
+ } else if (*v_sync_width > diff) {
+ *v_end_width = 2;
+ *v_sync_width = *v_sync_width - diff;
+ } else
+ dev_err(g_ipu_dev, "WARNING: try to adapt timming, but failed\n");
dev_err(g_ipu_dev, "WARNING: adapt panel end blank lines\n");
}
}
@@ -1069,9 +1069,7 @@ int32_t ipu_init_sync_panel(int disp, uint32_t pixel_clk,
if ((v_sync_width == 0) || (h_sync_width == 0))
return EINVAL;
- adapt_panel_to_ipu_restricitions(&pixel_clk, width, height,
- h_start_width, h_end_width,
- v_start_width, &v_end_width);
+ adapt_panel_to_ipu_restricitions(&v_start_width, &v_sync_width, &v_end_width);
h_total = width + h_sync_width + h_start_width + h_end_width;
v_total = height + v_sync_width + v_start_width + v_end_width;