diff options
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 ac9bf750e77..d6a4b31fa0b 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, | |||
992 | dispc_write_reg(DISPC_SIZE_MGR(channel), val); | 992 | dispc_write_reg(DISPC_SIZE_MGR(channel), val); |
993 | } | 993 | } |
994 | 994 | ||
995 | void dispc_set_digit_size(u16 width, u16 height) | 995 | static void dispc_mgr_set_digit_size(u16 width, u16 height) |
996 | { | 996 | { |
997 | u32 val; | 997 | u32 val; |
998 | BUG_ON((width > (1 << 11)) || (height > (1 << 11))); | 998 | 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, | |||
2341 | } | 2341 | } |
2342 | 2342 | ||
2343 | /* change name to mode? */ | 2343 | /* change name to mode? */ |
2344 | void dispc_mgr_set_lcd_timings(enum omap_channel channel, | 2344 | void dispc_mgr_set_timings(enum omap_channel channel, |
2345 | struct omap_video_timings *timings) | 2345 | struct omap_video_timings *timings) |
2346 | { | 2346 | { |
2347 | unsigned xtot, ytot; | 2347 | unsigned xtot, ytot; |
2348 | unsigned long ht, vt; | 2348 | unsigned long ht, vt; |
2349 | 2349 | ||
2350 | if (!_dispc_lcd_timings_ok(timings->hsw, timings->hfp, | 2350 | DSSDBG("channel %d xres %u yres %u\n", channel, timings->x_res, |
2351 | timings->hbp, timings->vsw, | 2351 | timings->y_res); |
2352 | timings->vfp, timings->vbp)) | 2352 | |
2353 | BUG(); | 2353 | if (dispc_mgr_is_lcd(channel)) { |
2354 | if (!dispc_lcd_timings_ok(timings)) | ||
2355 | BUG(); | ||
2354 | 2356 | ||
2355 | _dispc_mgr_set_lcd_timings(channel, timings->hsw, timings->hfp, | 2357 | _dispc_mgr_set_lcd_timings(channel, timings->hsw, timings->hfp, |
2356 | timings->hbp, timings->vsw, timings->vfp, | 2358 | timings->hbp, timings->vsw, timings->vfp, |
2357 | timings->vbp); | 2359 | timings->vbp); |
2358 | 2360 | ||
2359 | dispc_mgr_set_lcd_size(channel, timings->x_res, timings->y_res); | 2361 | dispc_mgr_set_lcd_size(channel, timings->x_res, timings->y_res); |
2360 | 2362 | ||
2361 | xtot = timings->x_res + timings->hfp + timings->hsw + timings->hbp; | 2363 | xtot = timings->x_res + timings->hfp + timings->hsw + |
2362 | ytot = timings->y_res + timings->vfp + timings->vsw + timings->vbp; | 2364 | timings->hbp; |
2365 | ytot = timings->y_res + timings->vfp + timings->vsw + | ||
2366 | timings->vbp; | ||
2363 | 2367 | ||
2364 | ht = (timings->pixel_clock * 1000) / xtot; | 2368 | ht = (timings->pixel_clock * 1000) / xtot; |
2365 | vt = (timings->pixel_clock * 1000) / xtot / ytot; | 2369 | vt = (timings->pixel_clock * 1000) / xtot / ytot; |
2366 | 2370 | ||
2367 | DSSDBG("channel %d xres %u yres %u\n", channel, timings->x_res, | 2371 | DSSDBG("pck %u\n", timings->pixel_clock); |
2368 | timings->y_res); | 2372 | DSSDBG("hsw %d hfp %d hbp %d vsw %d vfp %d vbp %d\n", |
2369 | DSSDBG("pck %u\n", timings->pixel_clock); | ||
2370 | DSSDBG("hsw %d hfp %d hbp %d vsw %d vfp %d vbp %d\n", | ||
2371 | timings->hsw, timings->hfp, timings->hbp, | 2373 | timings->hsw, timings->hfp, timings->hbp, |
2372 | timings->vsw, timings->vfp, timings->vbp); | 2374 | timings->vsw, timings->vfp, timings->vbp); |
2373 | 2375 | ||
2374 | DSSDBG("hsync %luHz, vsync %luHz\n", ht, vt); | 2376 | DSSDBG("hsync %luHz, vsync %luHz\n", ht, vt); |
2377 | } else { | ||
2378 | dispc_mgr_set_digit_size(timings->x_res, timings->y_res); | ||
2379 | } | ||
2375 | } | 2380 | } |
2376 | 2381 | ||
2377 | static void dispc_mgr_set_lcd_divisor(enum omap_channel channel, u16 lck_div, | 2382 | static void dispc_mgr_set_lcd_divisor(enum omap_channel channel, u16 lck_div, |