static void tegra_dc_one_shot_worker(struct work_struct *work) { struct tegra_dc *dc = container_of( to_delayed_work(work), struct tegra_dc, one_shot_work); mutex_lock(&dc->lock); /* memory client has gone idle */ tegra_dc_clear_bandwidth(dc); if (dc->out_ops->idle) dc->out_ops->idle(dc); mutex_unlock(&dc->lock); }
static void tegra_dc_one_shot_worker(struct work_struct *work) { struct tegra_dc *dc = container_of( to_delayed_work(work), struct tegra_dc, one_shot_work); mutex_lock(&dc->lock); /* memory client has gone idle */ tegra_dc_clear_bandwidth(dc); if (dc->out->flags & TEGRA_DC_OUT_ONE_SHOT_LP_MODE) tegra_dc_host_suspend(dc); mutex_unlock(&dc->lock); }
static bool _tegra_dc_controller_enable(struct tegra_dc *dc) { int failed_init = 0; if (dc->out->enable) dc->out->enable(); tegra_dc_setup_clk(dc, dc->clk); tegra_dc_clk_enable(dc); /* do not accept interrupts during initialization */ tegra_dc_writel(dc, 0, DC_CMD_INT_MASK); enable_dc_irq(dc->irq); failed_init = tegra_dc_init(dc); if (failed_init) { tegra_dc_writel(dc, 0, DC_CMD_INT_MASK); disable_irq(dc->irq); tegra_dc_clear_bandwidth(dc); tegra_dc_clk_disable(dc); if (dc->out && dc->out->disable) dc->out->disable(); return false; } if (dc->out_ops && dc->out_ops->enable) dc->out_ops->enable(dc); /* force a full blending update */ dc->blend.z[0] = -1; tegra_dc_ext_enable(dc->ext); trace_printk("%s:enable\n", dc->ndev->name); tegra_dc_writel(dc, GENERAL_UPDATE, DC_CMD_STATE_CONTROL); tegra_dc_writel(dc, GENERAL_ACT_REQ, DC_CMD_STATE_CONTROL); if (dc->out->postpoweron) dc->out->postpoweron(); return true; }
static void _tegra_dc_controller_disable(struct tegra_dc *dc) { unsigned i; if (dc->out && dc->out->prepoweroff) dc->out->prepoweroff(); if (dc->out_ops && dc->out_ops->disable) dc->out_ops->disable(dc); tegra_dc_writel(dc, 0, DC_CMD_INT_MASK); tegra_dc_writel(dc, 0, DC_CMD_INT_ENABLE); disable_irq(dc->irq); tegra_dc_clear_bandwidth(dc); tegra_dc_clk_disable(dc); if (dc->out && dc->out->disable) dc->out->disable(); for (i = 0; i < dc->n_windows; i++) { struct tegra_dc_win *w = &dc->windows[i]; /* reset window bandwidth */ w->bandwidth = 0; w->new_bandwidth = 0; /* disable windows */ w->flags &= ~TEGRA_WIN_FLAG_ENABLED; /* flush any pending syncpt waits */ while (dc->syncpt[i].min < dc->syncpt[i].max) { trace_printk("%s:syncpt flush id=%d\n", dc->ndev->name, dc->syncpt[i].id); dc->syncpt[i].min++; nvhost_syncpt_cpu_incr_ext(dc->ndev, dc->syncpt[i].id); } } trace_printk("%s:disabled\n", dc->ndev->name); }