aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2012-01-30 00:24:17 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-02-21 02:39:30 -0500
commit79ee89cdbd9a58baa079d019574d11aa864b7842 (patch)
tree7ae253a1330e31df9916f994f3e2871eefa10336 /drivers
parentc124f23dfdf7da890405dfa0efbeb015cab27b56 (diff)
OMAPDSS: DISPC: Fix scaling constraints for OMAP4
The calculation of required DISPC_FCLK for downscaling is done by multplying the pixel clock with an integer factor. This isn't true for OMAP4 where the required clock is calculated using the exact ratio of downscaling done. Fix this calculation for OMAP4. Also, do a minor clean up of calc_fclk(). Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/omap2/dss/dispc.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index d8e044df3d4..22023bba63e 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1694,6 +1694,7 @@ static unsigned long calc_fclk(enum omap_channel channel, u16 width,
1694 u16 height, u16 out_width, u16 out_height) 1694 u16 height, u16 out_width, u16 out_height)
1695{ 1695{
1696 unsigned int hf, vf; 1696 unsigned int hf, vf;
1697 unsigned long pclk = dispc_mgr_pclk_rate(channel);
1697 1698
1698 /* 1699 /*
1699 * FIXME how to determine the 'A' factor 1700 * FIXME how to determine the 'A' factor
@@ -1716,13 +1717,16 @@ static unsigned long calc_fclk(enum omap_channel channel, u16 width,
1716 1717
1717 if (cpu_is_omap24xx()) { 1718 if (cpu_is_omap24xx()) {
1718 if (vf > 1 && hf > 1) 1719 if (vf > 1 && hf > 1)
1719 return dispc_mgr_pclk_rate(channel) * 4; 1720 return pclk * 4;
1720 else 1721 else
1721 return dispc_mgr_pclk_rate(channel) * 2; 1722 return pclk * 2;
1722 } else if (cpu_is_omap34xx()) { 1723 } else if (cpu_is_omap34xx()) {
1723 return dispc_mgr_pclk_rate(channel) * vf * hf; 1724 return pclk * vf * hf;
1724 } else { 1725 } else {
1725 return dispc_mgr_pclk_rate(channel) * hf; 1726 if (hf > 1)
1727 return DIV_ROUND_UP(pclk, out_width) * width;
1728 else
1729 return pclk;
1726 } 1730 }
1727} 1731}
1728 1732