diff options
author | Archit Taneja <archit@ti.com> | 2012-04-16 12:53:43 +0530 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-04-23 10:48:10 +0300 |
commit | c51d921a0cd83ecc768de7176bc7b7c2d76db278 (patch) | |
tree | e2d121eb789e626c56e5f4502e0f094ec289ace7 /drivers/video/omap2/dss/dispc.c | |
parent | e5c09e06a9ef882e770aa1fa1bcfd5e5c90c6519 (diff) | |
download | lwn-c51d921a0cd83ecc768de7176bc7b7c2d76db278.tar.gz lwn-c51d921a0cd83ecc768de7176bc7b7c2d76db278.zip |
OMAPDSS: DISPC: Use a common function to set manager timings
Currently, a LCD manager's timings is set by dispc_mgr_set_lcd_timings() and TV
manager's timings is set by dispc_set_digit_size(). Use a common function called
dispc_mgr_set_timings() which sets timings for both type of managers.
We finally want the interface drivers to use an overlay manager function to
configure it's timings, having a common DISPC function would make things
cleaner.
For LCD managers, dispc_mgr_set_timings() sets LCD size and blanking values, for
TV manager, it sets only the TV size since blanking values don't exist for TV.
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/dispc.c')
-rw-r--r-- | drivers/video/omap2/dss/dispc.c | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index ac9bf750e774..d6a4b31fa0be 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c @@ -992,7 +992,7 @@ static void dispc_mgr_set_lcd_size(enum omap_channel channel, u16 width, dispc_write_reg(DISPC_SIZE_MGR(channel), val); } -void dispc_set_digit_size(u16 width, u16 height) +static void dispc_mgr_set_digit_size(u16 width, u16 height) { u32 val; BUG_ON((width > (1 << 11)) || (height > (1 << 11))); @@ -2341,37 +2341,42 @@ static void _dispc_mgr_set_lcd_timings(enum omap_channel channel, int hsw, } /* change name to mode? */ -void dispc_mgr_set_lcd_timings(enum omap_channel channel, +void dispc_mgr_set_timings(enum omap_channel channel, struct omap_video_timings *timings) { unsigned xtot, ytot; unsigned long ht, vt; - if (!_dispc_lcd_timings_ok(timings->hsw, timings->hfp, - timings->hbp, timings->vsw, - timings->vfp, timings->vbp)) - BUG(); + DSSDBG("channel %d xres %u yres %u\n", channel, timings->x_res, + timings->y_res); + + if (dispc_mgr_is_lcd(channel)) { + if (!dispc_lcd_timings_ok(timings)) + BUG(); - _dispc_mgr_set_lcd_timings(channel, timings->hsw, timings->hfp, - timings->hbp, timings->vsw, timings->vfp, - timings->vbp); + _dispc_mgr_set_lcd_timings(channel, timings->hsw, timings->hfp, + timings->hbp, timings->vsw, timings->vfp, + timings->vbp); - dispc_mgr_set_lcd_size(channel, timings->x_res, timings->y_res); + dispc_mgr_set_lcd_size(channel, timings->x_res, timings->y_res); - xtot = timings->x_res + timings->hfp + timings->hsw + timings->hbp; - ytot = timings->y_res + timings->vfp + timings->vsw + timings->vbp; + xtot = timings->x_res + timings->hfp + timings->hsw + + timings->hbp; + ytot = timings->y_res + timings->vfp + timings->vsw + + timings->vbp; - ht = (timings->pixel_clock * 1000) / xtot; - vt = (timings->pixel_clock * 1000) / xtot / ytot; + ht = (timings->pixel_clock * 1000) / xtot; + vt = (timings->pixel_clock * 1000) / xtot / ytot; - DSSDBG("channel %d xres %u yres %u\n", channel, timings->x_res, - timings->y_res); - DSSDBG("pck %u\n", timings->pixel_clock); - DSSDBG("hsw %d hfp %d hbp %d vsw %d vfp %d vbp %d\n", + DSSDBG("pck %u\n", timings->pixel_clock); + DSSDBG("hsw %d hfp %d hbp %d vsw %d vfp %d vbp %d\n", timings->hsw, timings->hfp, timings->hbp, timings->vsw, timings->vfp, timings->vbp); - DSSDBG("hsync %luHz, vsync %luHz\n", ht, vt); + DSSDBG("hsync %luHz, vsync %luHz\n", ht, vt); + } else { + dispc_mgr_set_digit_size(timings->x_res, timings->y_res); + } } static void dispc_mgr_set_lcd_divisor(enum omap_channel channel, u16 lck_div, |