From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
To: ext Mike Chan <mike@android.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: [PATCH] video: omap2: dss: RET on idle, enable/disable dss clocks only when needed.
Date: Fri, 18 Sep 2009 11:27:52 +0300 [thread overview]
Message-ID: <1253262472.28956.10.camel@tubuntu> (raw)
In-Reply-To: <1253230586-931-1-git-send-email-mike@android.com>
Hi,
If you disable the clocks to allow RET, you also allow OFF mode. And
resuming from OFF mode hasn't been implemented for DSI, if I recall
right. And when I was testing it, it didn't seem to be trivial with the
DSI PLL.
That's why currently you need to disable the display to turn off the
clocks, and the whole DSI block is re-configured when enabling the
display again.
Tomi
On Fri, 2009-09-18 at 01:36 +0200, ext Mike Chan wrote:
> Signed-off-by: Mike Chan <mike@android.com>
> ---
> drivers/video/omap2/dss/dispc.c | 6 ++++-
> drivers/video/omap2/dss/dsi.c | 50 +++++++++++++++++++++++++++++++++++---
> 2 files changed, 51 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
> index d061d75..4216466 100644
> --- a/drivers/video/omap2/dss/dispc.c
> +++ b/drivers/video/omap2/dss/dispc.c
> @@ -484,13 +484,17 @@ static inline void enable_clocks(bool enable)
> bool dispc_go_busy(enum omap_channel channel)
> {
> int bit;
> + bool ret;
>
> if (channel == OMAP_DSS_CHANNEL_LCD)
> bit = 5; /* GOLCD */
> else
> bit = 6; /* GODIGIT */
>
> - return REG_GET(DISPC_CONTROL, bit, bit) == 1;
> + enable_clocks(1);
> + ret = REG_GET(DISPC_CONTROL, bit, bit) == 1;
> + enable_clocks(0);
> + return ret;
> }
>
> void dispc_go(enum omap_channel channel)
> diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
> index 5e3d653..e9d8a5f 100644
> --- a/drivers/video/omap2/dss/dsi.c
> +++ b/drivers/video/omap2/dss/dsi.c
> @@ -1186,6 +1186,9 @@ int dsi_pll_init(bool enable_hsclk, bool enable_hsdiv)
> if (r)
> goto err1;
>
> + enable_clocks(0);
> + dsi_enable_pll_clock(0);
> +
> DSSDBG("PLL init done\n");
>
> return 0;
> @@ -1199,11 +1202,9 @@ err0:
>
> void dsi_pll_uninit(void)
> {
> - enable_clocks(0);
> - dsi_enable_pll_clock(0);
> -
> dsi.pll_locked = 0;
> dsi_pll_power(DSI_PLL_POWER_OFF);
> +
> regulator_disable(dsi.vdds_dsi_reg);
> DSSDBG("PLL uninit done\n");
> }
> @@ -1848,6 +1849,9 @@ static int dsi_vc_send_bta_sync(int channel)
>
> INIT_COMPLETION(dsi.bta_completion);
>
> + enable_clocks(1);
> + dsi_enable_pll_clock(1);
> +
> dsi_vc_enable_bta_irq(channel);
>
> r = dsi_vc_send_bta(channel);
> @@ -1870,6 +1874,9 @@ static int dsi_vc_send_bta_sync(int channel)
> err:
> dsi_vc_disable_bta_irq(channel);
>
> + enable_clocks(0);
> + dsi_enable_pll_clock(0);
> +
> return r;
> }
>
> @@ -1921,6 +1928,9 @@ static int dsi_vc_send_long(int channel, u8 data_type, u8 *data, u16 len,
> return -EINVAL;
> }
>
> + enable_clocks(1);
> + dsi_enable_pll_clock(1);
> +
> dsi_vc_write_long_header(channel, data_type, len, ecc);
>
> /*dsi_vc_print_status(0); */
> @@ -1964,6 +1974,9 @@ static int dsi_vc_send_long(int channel, u8 data_type, u8 *data, u16 len,
> dsi_vc_write_long_payload(channel, b1, b2, b3, 0);
> }
>
> + enable_clocks(0);
> + dsi_enable_pll_clock(0);
> +
> return r;
> }
>
> @@ -1979,6 +1992,9 @@ static int dsi_vc_send_short(int channel, u8 data_type, u16 data, u8 ecc)
> channel,
> data_type, data & 0xff, (data >> 8) & 0xff);
>
> + enable_clocks(1);
> + dsi_enable_pll_clock(1);
> +
> if (FLD_GET(dsi_read_reg(DSI_VC_CTRL(channel)), 16, 16)) {
> DSSERR("ERROR FIFO FULL, aborting transfer\n");
> return -EINVAL;
> @@ -1990,6 +2006,9 @@ static int dsi_vc_send_short(int channel, u8 data_type, u16 data, u8 ecc)
>
> dsi_write_reg(DSI_VC_SHORT_PACKET_HEADER(channel), r);
>
> + enable_clocks(0);
> + dsi_enable_pll_clock(0);
> +
> return 0;
> }
>
> @@ -2775,13 +2794,15 @@ static int dsi_update_thread(void *data)
> break;
>
> dsi_bus_lock();
> -
> if (dsi.update_mode == OMAP_DSS_UPDATE_DISABLED ||
> kthread_should_stop()) {
> dsi_bus_unlock();
> break;
> }
>
> + enable_clocks(1);
> + dsi_enable_pll_clock(1);
> +
> dsi_perf_mark_setup();
>
> if (dsi.update_region.dirty) {
> @@ -2872,6 +2893,9 @@ static int dsi_update_thread(void *data)
>
> complete_all(&dsi.update_completion);
>
> + enable_clocks(0);
> + dsi_enable_pll_clock(0);
> +
> dsi_bus_unlock();
>
> /* XXX We need to give others chance to get the bus lock. Is
> @@ -3068,6 +3092,9 @@ static int dsi_display_enable(struct omap_dss_device *dssdev)
> if (dsi.update_mode == OMAP_DSS_UPDATE_AUTO)
> dsi_start_auto_update(dssdev);
>
> + enable_clocks(0);
> + dsi_enable_pll_clock(0);
> +
> dsi_bus_unlock();
> mutex_unlock(&dsi.lock);
>
> @@ -3101,6 +3128,9 @@ static void dsi_display_disable(struct omap_dss_device *dssdev)
> dsi.update_mode = OMAP_DSS_UPDATE_DISABLED;
> dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
>
> + enable_clocks(1);
> + dsi_enable_pll_clock(1);
> +
> dsi_display_uninit_dispc(dssdev);
>
> dsi_display_uninit_dsi(dssdev);
> @@ -3128,6 +3158,9 @@ static int dsi_display_suspend(struct omap_dss_device *dssdev)
> dsi.update_mode = OMAP_DSS_UPDATE_DISABLED;
> dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
>
> + enable_clocks(1);
> + dsi_enable_pll_clock(1);
> +
> dsi_display_uninit_dispc(dssdev);
>
> dsi_display_uninit_dsi(dssdev);
> @@ -3181,6 +3214,9 @@ static int dsi_display_resume(struct omap_dss_device *dssdev)
> if (dsi.update_mode == OMAP_DSS_UPDATE_AUTO)
> dsi_start_auto_update(dssdev);
>
> + enable_clocks(0);
> + dsi_enable_pll_clock(0);
> +
> dsi_bus_unlock();
> mutex_unlock(&dsi.lock);
>
> @@ -3325,6 +3361,9 @@ static int dsi_display_enable_te(struct omap_dss_device *dssdev, bool enable)
>
> dsi_bus_lock();
>
> + enable_clocks(1);
> + dsi_enable_pll_clock(1);
> +
> dsi.te_enabled = enable;
>
> if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
> @@ -3332,6 +3371,9 @@ static int dsi_display_enable_te(struct omap_dss_device *dssdev, bool enable)
>
> dsi_set_te(dssdev, enable);
> end:
> + enable_clocks(0);
> + dsi_enable_pll_clock(0);
> +
> dsi_bus_unlock();
>
> return 0;
next prev parent reply other threads:[~2009-09-18 8:27 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-17 23:36 [PATCH] video: omap2: dss: RET on idle, enable/disable dss clocks only when needed Mike Chan
2009-09-17 23:38 ` Mike Chan
2009-09-18 8:27 ` Tomi Valkeinen [this message]
2009-09-18 17:33 ` Mike Chan
2009-09-21 6:26 ` Tomi Valkeinen
2009-09-22 14:54 ` Kevin Hilman
2009-09-23 7:20 ` Tomi Valkeinen
2009-09-23 15:44 ` Kevin Hilman
2009-09-24 10:39 ` Tomi Valkeinen
2009-09-24 15:52 ` Kevin Hilman
2009-09-25 9:19 ` Tomi Valkeinen
2009-09-30 18:31 ` Kevin Hilman
2009-10-01 14:40 ` Tomi Valkeinen
2009-10-01 16:19 ` Kevin Hilman
2009-10-02 8:03 ` Tomi Valkeinen
2009-10-02 14:27 ` Kevin Hilman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1253262472.28956.10.camel@tubuntu \
--to=tomi.valkeinen@nokia.com \
--cc=linux-omap@vger.kernel.org \
--cc=mike@android.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox