diff options
| author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-05-26 07:54:05 -0400 |
|---|---|---|
| committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-07-25 03:22:06 -0400 |
| commit | 39020710e707a01d80ea6c9e55dad4de93bb4730 (patch) | |
| tree | 3686e8c7a03de39feafd395126d3105e0ef365c3 /drivers/video | |
| parent | 6d9f29dd62142a173b54c0a5645fbdfb296f1316 (diff) | |
OMAP: DSS2: Remove ctx loss count from dss.c
dss.c only saves 1 register (3 in OMAP3) so the extra overhead from
need_ctx_restore & co. is probably bigger than the time spent saving and
restoring those few registers every time.
So remove the code from dss.c and restore context every time dss has
been off.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
| -rw-r--r-- | drivers/video/omap2/dss/dss.c | 62 |
1 files changed, 1 insertions, 61 deletions
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c index a83c449d2ed..2424064c9ce 100644 --- a/drivers/video/omap2/dss/dss.c +++ b/drivers/video/omap2/dss/dss.c | |||
| @@ -62,8 +62,6 @@ static struct { | |||
| 62 | struct platform_device *pdev; | 62 | struct platform_device *pdev; |
| 63 | void __iomem *base; | 63 | void __iomem *base; |
| 64 | 64 | ||
| 65 | int ctx_loss_cnt; | ||
| 66 | |||
| 67 | struct clk *dpll4_m4_ck; | 65 | struct clk *dpll4_m4_ck; |
| 68 | struct clk *dss_clk; | 66 | struct clk *dss_clk; |
| 69 | 67 | ||
| @@ -631,61 +629,6 @@ void dss_select_hdmi_venc_clk_source(enum dss_hdmi_venc_clk_source_select hdmi) | |||
| 631 | REG_FLD_MOD(DSS_CONTROL, hdmi, 15, 15); /* VENC_HDMI_SWITCH */ | 629 | REG_FLD_MOD(DSS_CONTROL, hdmi, 15, 15); /* VENC_HDMI_SWITCH */ |
| 632 | } | 630 | } |
| 633 | 631 | ||
| 634 | /* CONTEXT */ | ||
| 635 | static void dss_init_ctx_loss_count(void) | ||
| 636 | { | ||
| 637 | struct device *dev = &dss.pdev->dev; | ||
| 638 | struct omap_display_platform_data *pdata = dev->platform_data; | ||
| 639 | struct omap_dss_board_info *board_data = pdata->board_data; | ||
| 640 | int cnt = 0; | ||
| 641 | |||
| 642 | /* | ||
| 643 | * get_context_loss_count returns negative on error. We'll ignore the | ||
| 644 | * error and store the error to ctx_loss_cnt, which will cause | ||
| 645 | * dss_need_ctx_restore() call to return true. | ||
| 646 | */ | ||
| 647 | |||
| 648 | if (board_data->get_context_loss_count) | ||
| 649 | cnt = board_data->get_context_loss_count(dev); | ||
| 650 | |||
| 651 | WARN_ON(cnt < 0); | ||
| 652 | |||
| 653 | dss.ctx_loss_cnt = cnt; | ||
| 654 | |||
| 655 | DSSDBG("initial ctx_loss_cnt %u\n", cnt); | ||
| 656 | } | ||
| 657 | |||
| 658 | static bool dss_need_ctx_restore(void) | ||
| 659 | { | ||
| 660 | struct device *dev = &dss.pdev->dev; | ||
| 661 | struct omap_display_platform_data *pdata = dev->platform_data; | ||
| 662 | struct omap_dss_board_info *board_data = pdata->board_data; | ||
| 663 | int cnt; | ||
| 664 | |||
| 665 | /* | ||
| 666 | * If get_context_loss_count is not available, assume that we need | ||
| 667 | * context restore always. | ||
| 668 | */ | ||
| 669 | if (!board_data->get_context_loss_count) | ||
| 670 | return true; | ||
| 671 | |||
| 672 | cnt = board_data->get_context_loss_count(dev); | ||
| 673 | if (cnt < 0) { | ||
| 674 | dev_err(dev, "getting context loss count failed, will force " | ||
| 675 | "context restore\n"); | ||
| 676 | dss.ctx_loss_cnt = cnt; | ||
| 677 | return true; | ||
| 678 | } | ||
| 679 | |||
| 680 | if (cnt == dss.ctx_loss_cnt) | ||
| 681 | return false; | ||
| 682 | |||
| 683 | DSSDBG("ctx_loss_cnt %d -> %d\n", dss.ctx_loss_cnt, cnt); | ||
| 684 | dss.ctx_loss_cnt = cnt; | ||
| 685 | |||
| 686 | return true; | ||
| 687 | } | ||
| 688 | |||
| 689 | static int dss_get_clocks(void) | 632 | static int dss_get_clocks(void) |
| 690 | { | 633 | { |
| 691 | struct clk *clk; | 634 | struct clk *clk; |
| @@ -797,8 +740,6 @@ static int omap_dsshw_probe(struct platform_device *pdev) | |||
| 797 | if (r) | 740 | if (r) |
| 798 | goto err_clocks; | 741 | goto err_clocks; |
| 799 | 742 | ||
| 800 | dss_init_ctx_loss_count(); | ||
| 801 | |||
| 802 | pm_runtime_enable(&pdev->dev); | 743 | pm_runtime_enable(&pdev->dev); |
| 803 | 744 | ||
| 804 | r = dss_runtime_get(); | 745 | r = dss_runtime_get(); |
| @@ -875,8 +816,7 @@ static int dss_runtime_suspend(struct device *dev) | |||
| 875 | static int dss_runtime_resume(struct device *dev) | 816 | static int dss_runtime_resume(struct device *dev) |
| 876 | { | 817 | { |
| 877 | clk_enable(dss.dss_clk); | 818 | clk_enable(dss.dss_clk); |
| 878 | if (dss_need_ctx_restore()) | 819 | dss_restore_context(); |
| 879 | dss_restore_context(); | ||
| 880 | return 0; | 820 | return 0; |
| 881 | } | 821 | } |
| 882 | 822 | ||
