diff options
Diffstat (limited to 'drivers/video/omap2/dss/dispc.c')
-rw-r--r-- | drivers/video/omap2/dss/dispc.c | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index a96fc41d7668..57074b33f024 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
@@ -427,6 +427,14 @@ static inline bool dispc_mgr_is_lcd(enum omap_channel channel) | |||
427 | return false; | 427 | return false; |
428 | } | 428 | } |
429 | 429 | ||
430 | static struct omap_dss_device *dispc_mgr_get_device(enum omap_channel channel) | ||
431 | { | ||
432 | struct omap_overlay_manager *mgr = | ||
433 | omap_dss_get_overlay_manager(channel); | ||
434 | |||
435 | return mgr ? mgr->device : NULL; | ||
436 | } | ||
437 | |||
430 | bool dispc_mgr_go_busy(enum omap_channel channel) | 438 | bool dispc_mgr_go_busy(enum omap_channel channel) |
431 | { | 439 | { |
432 | int bit; | 440 | int bit; |
@@ -1619,7 +1627,6 @@ static unsigned long calc_fclk_five_taps(enum omap_channel channel, u16 width, | |||
1619 | enum omap_color_mode color_mode) | 1627 | enum omap_color_mode color_mode) |
1620 | { | 1628 | { |
1621 | u32 fclk = 0; | 1629 | u32 fclk = 0; |
1622 | /* FIXME venc pclk? */ | ||
1623 | u64 tmp, pclk = dispc_mgr_pclk_rate(channel); | 1630 | u64 tmp, pclk = dispc_mgr_pclk_rate(channel); |
1624 | 1631 | ||
1625 | if (height > out_height) { | 1632 | if (height > out_height) { |
@@ -1676,7 +1683,6 @@ static unsigned long calc_fclk(enum omap_channel channel, u16 width, | |||
1676 | else | 1683 | else |
1677 | vf = 1; | 1684 | vf = 1; |
1678 | 1685 | ||
1679 | /* FIXME venc pclk? */ | ||
1680 | return dispc_mgr_pclk_rate(channel) * vf * hf; | 1686 | return dispc_mgr_pclk_rate(channel) * vf * hf; |
1681 | } | 1687 | } |
1682 | 1688 | ||
@@ -2415,17 +2421,32 @@ unsigned long dispc_mgr_lclk_rate(enum omap_channel channel) | |||
2415 | 2421 | ||
2416 | unsigned long dispc_mgr_pclk_rate(enum omap_channel channel) | 2422 | unsigned long dispc_mgr_pclk_rate(enum omap_channel channel) |
2417 | { | 2423 | { |
2418 | int pcd; | ||
2419 | unsigned long r; | 2424 | unsigned long r; |
2420 | u32 l; | ||
2421 | 2425 | ||
2422 | l = dispc_read_reg(DISPC_DIVISORo(channel)); | 2426 | if (dispc_mgr_is_lcd(channel)) { |
2427 | int pcd; | ||
2428 | u32 l; | ||
2423 | 2429 | ||
2424 | pcd = FLD_GET(l, 7, 0); | 2430 | l = dispc_read_reg(DISPC_DIVISORo(channel)); |
2425 | 2431 | ||
2426 | r = dispc_mgr_lclk_rate(channel); | 2432 | pcd = FLD_GET(l, 7, 0); |
2427 | 2433 | ||
2428 | return r / pcd; | 2434 | r = dispc_mgr_lclk_rate(channel); |
2435 | |||
2436 | return r / pcd; | ||
2437 | } else { | ||
2438 | struct omap_dss_device *dssdev = | ||
2439 | dispc_mgr_get_device(channel); | ||
2440 | |||
2441 | switch (dssdev->type) { | ||
2442 | case OMAP_DISPLAY_TYPE_VENC: | ||
2443 | return venc_get_pixel_clock(); | ||
2444 | case OMAP_DISPLAY_TYPE_HDMI: | ||
2445 | return hdmi_get_pixel_clock(); | ||
2446 | default: | ||
2447 | BUG(); | ||
2448 | } | ||
2449 | } | ||
2429 | } | 2450 | } |
2430 | 2451 | ||
2431 | void dispc_dump_clocks(struct seq_file *s) | 2452 | void dispc_dump_clocks(struct seq_file *s) |