From: Archit Taneja <archit@ti.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 01/14] OMAPDSS: DISPC: store core clk rate
Date: Wed, 20 Mar 2013 11:20:33 +0000 [thread overview]
Message-ID: <514998B1.8040907@ti.com> (raw)
In-Reply-To: <1362743569-10289-2-git-send-email-tomi.valkeinen@ti.com>
Hi,
On Friday 08 March 2013 05:22 PM, Tomi Valkeinen wrote:
> Store dispc core clock rate so that it's available for calculations even
> if the HW is disabled.
I think the core_clk_rate variable should change when we change the lcd
clock source through dss_select_lcd_clk_source() for omap3.
If we have the following sequence:
...
dispc_mgr_set_lcd_divisor();
dss_select_lcd_clk_source();
...
The value of core_clock variable would be based on the previous clock
source, and not the current one.
This situation doesn't occur currently as the 'apply' framework delays
all dispc writes to the point when we enable the manager. So the
sequence above cannot occur. But maybe we should keep this in mind when
we move more things to omapdrm, where 'apply' isn't in use.
Archit
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
> drivers/video/omap2/dss/dispc.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
> index 05ff2b9..f564955 100644
> --- a/drivers/video/omap2/dss/dispc.c
> +++ b/drivers/video/omap2/dss/dispc.c
> @@ -97,6 +97,8 @@ static struct {
>
> int irq;
>
> + unsigned long core_clk_rate;
> +
> u32 fifo_size[DISPC_MAX_NR_FIFOS];
> /* maps which plane is using a fifo. fifo-id -> plane-id */
> int fifo_assignment[DISPC_MAX_NR_FIFOS];
> @@ -2951,6 +2953,10 @@ static void dispc_mgr_set_lcd_divisor(enum omap_channel channel, u16 lck_div,
>
> dispc_write_reg(DISPC_DIVISORo(channel),
> FLD_VAL(lck_div, 23, 16) | FLD_VAL(pck_div, 7, 0));
> +
> + if (dss_has_feature(FEAT_CORE_CLK_DIV) = false &&
> + channel = OMAP_DSS_CHANNEL_LCD)
> + dispc.core_clk_rate = dispc_fclk_rate() / lck_div;
> }
>
> static void dispc_mgr_get_lcd_divisor(enum omap_channel channel, int *lck_div,
> @@ -3056,15 +3062,7 @@ unsigned long dispc_mgr_pclk_rate(enum omap_channel channel)
>
> unsigned long dispc_core_clk_rate(void)
> {
> - int lcd;
> - unsigned long fclk = dispc_fclk_rate();
> -
> - if (dss_has_feature(FEAT_CORE_CLK_DIV))
> - lcd = REG_GET(DISPC_DIVISOR, 23, 16);
> - else
> - lcd = REG_GET(DISPC_DIVISORo(OMAP_DSS_CHANNEL_LCD), 23, 16);
> -
> - return fclk / lcd;
> + return dispc.core_clk_rate;
> }
>
> static unsigned long dispc_plane_pclk_rate(enum omap_plane plane)
> @@ -3451,6 +3449,8 @@ static void _omap_dispc_initial_config(void)
> l = FLD_MOD(l, 1, 0, 0);
> l = FLD_MOD(l, 1, 23, 16);
> dispc_write_reg(DISPC_DIVISOR, l);
> +
> + dispc.core_clk_rate = dispc_fclk_rate();
> }
>
> /* FUNCGATED */
>
next prev parent reply other threads:[~2013-03-20 11:20 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-08 11:52 [PATCH 00/14] OMAPDSS: new clock calculation + DSI VM Tomi Valkeinen
2013-03-08 11:52 ` [PATCH 01/14] OMAPDSS: DISPC: store core clk rate Tomi Valkeinen
2013-03-20 11:20 ` Archit Taneja [this message]
2013-03-20 11:36 ` Tomi Valkeinen
2013-03-08 11:52 ` [PATCH 02/14] OMAPDSS: DSI: fix wrong unsigned long long use Tomi Valkeinen
2013-03-08 11:52 ` [PATCH 03/14] OMAPDSS: DSI: simplify dsi configuration Tomi Valkeinen
2013-03-20 11:36 ` Archit Taneja
2013-03-20 11:44 ` Tomi Valkeinen
2013-03-08 11:52 ` [PATCH 04/14] OMAPDSS: DSI: get line buffer size at probe Tomi Valkeinen
2013-03-08 11:52 ` [PATCH 05/14] OMAPDSS: DSI: add enum omap_dss_dsi_trans_mode Tomi Valkeinen
2013-03-20 11:42 ` Archit Taneja
2013-03-08 11:52 ` [PATCH 06/14] OMAPDSS: DSI remove unneeded clk source setup code Tomi Valkeinen
2013-03-08 11:52 ` [PATCH 07/14] OMAPDSS: DISPC: add new clock calculation code Tomi Valkeinen
2013-03-08 11:52 ` [PATCH 08/14] OMAPDSS: DSS: " Tomi Valkeinen
2013-03-20 15:29 ` Archit Taneja
2013-03-20 15:28 ` Tomi Valkeinen
2013-03-21 6:26 ` Archit Taneja
2013-03-21 8:13 ` Tomi Valkeinen
2013-03-08 11:52 ` [PATCH 09/14] OMAPDSS: DSI: " Tomi Valkeinen
2013-03-08 11:52 ` [PATCH 10/14] OMAPDSS: SDI: use " Tomi Valkeinen
2013-03-08 11:52 ` [PATCH 11/14] OMAPDSS: DPI: " Tomi Valkeinen
2013-03-08 11:52 ` [PATCH 12/14] OMAPDSS: DSI: " Tomi Valkeinen
2013-03-08 11:52 ` [PATCH 13/14] OMAPDSS: remove unused old " Tomi Valkeinen
2013-03-08 11:52 ` [PATCH 14/14] OMAPDSS: remove dsi videomode from dssdev Tomi Valkeinen
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=514998B1.8040907@ti.com \
--to=archit@ti.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=tomi.valkeinen@ti.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;
as well as URLs for NNTP newsgroup(s).