Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 261975
b: refs/heads/master
c: 3902071
h: refs/heads/master
i:
  261973: 664409a
  261971: 4a55c6f
  261967: 4baf81e
v: v3
  • Loading branch information
Tomi Valkeinen committed Jul 25, 2011
1 parent 56ea009 commit 30204dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 62 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6d9f29dd62142a173b54c0a5645fbdfb296f1316
refs/heads/master: 39020710e707a01d80ea6c9e55dad4de93bb4730
62 changes: 1 addition & 61 deletions trunk/drivers/video/omap2/dss/dss.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ static struct {
struct platform_device *pdev;
void __iomem *base;

int ctx_loss_cnt;

struct clk *dpll4_m4_ck;
struct clk *dss_clk;

Expand Down Expand Up @@ -631,61 +629,6 @@ void dss_select_hdmi_venc_clk_source(enum dss_hdmi_venc_clk_source_select hdmi)
REG_FLD_MOD(DSS_CONTROL, hdmi, 15, 15); /* VENC_HDMI_SWITCH */
}

/* CONTEXT */
static void dss_init_ctx_loss_count(void)
{
struct device *dev = &dss.pdev->dev;
struct omap_display_platform_data *pdata = dev->platform_data;
struct omap_dss_board_info *board_data = pdata->board_data;
int cnt = 0;

/*
* get_context_loss_count returns negative on error. We'll ignore the
* error and store the error to ctx_loss_cnt, which will cause
* dss_need_ctx_restore() call to return true.
*/

if (board_data->get_context_loss_count)
cnt = board_data->get_context_loss_count(dev);

WARN_ON(cnt < 0);

dss.ctx_loss_cnt = cnt;

DSSDBG("initial ctx_loss_cnt %u\n", cnt);
}

static bool dss_need_ctx_restore(void)
{
struct device *dev = &dss.pdev->dev;
struct omap_display_platform_data *pdata = dev->platform_data;
struct omap_dss_board_info *board_data = pdata->board_data;
int cnt;

/*
* If get_context_loss_count is not available, assume that we need
* context restore always.
*/
if (!board_data->get_context_loss_count)
return true;

cnt = board_data->get_context_loss_count(dev);
if (cnt < 0) {
dev_err(dev, "getting context loss count failed, will force "
"context restore\n");
dss.ctx_loss_cnt = cnt;
return true;
}

if (cnt == dss.ctx_loss_cnt)
return false;

DSSDBG("ctx_loss_cnt %d -> %d\n", dss.ctx_loss_cnt, cnt);
dss.ctx_loss_cnt = cnt;

return true;
}

static int dss_get_clocks(void)
{
struct clk *clk;
Expand Down Expand Up @@ -797,8 +740,6 @@ static int omap_dsshw_probe(struct platform_device *pdev)
if (r)
goto err_clocks;

dss_init_ctx_loss_count();

pm_runtime_enable(&pdev->dev);

r = dss_runtime_get();
Expand Down Expand Up @@ -875,8 +816,7 @@ static int dss_runtime_suspend(struct device *dev)
static int dss_runtime_resume(struct device *dev)
{
clk_enable(dss.dss_clk);
if (dss_need_ctx_restore())
dss_restore_context();
dss_restore_context();
return 0;
}

Expand Down

0 comments on commit 30204dd

Please sign in to comment.