RE: [PATCH] OMAP: DSS: Fix for dsi_pll to dpll4 clk switch

2010-06-30 Thread Tomi Valkeinen
On Tue, 2010-06-29 at 16:13 +0200, ext Nagarajan, Rajkumar wrote:
> 
> > -Original Message-
> > From: Tomi Valkeinen [mailto:tomi.valkei...@nokia.com] 
> > Sent: Thursday, June 24, 2010 4:21 PM
> > To: Nagarajan, Rajkumar
> > Cc: linux-omap@vger.kernel.org
> > Subject: Re: [PATCH] OMAP: DSS: Fix for dsi_pll to dpll4 clk switch
> > 
> > On Thu, 2010-06-17 at 07:12 +0200, ext Nagarajan, Rajkumar wrote:
> > > When switching between clocks, The new functional clock is
> > > effective when the next vertical blanking interval occurs.
> > > GOLCD bit has to be set for the new clock to take effect.
> > 
> > Where did you encounter this problem?
> > 
> Raj: The below experiments will make you to understand the significance of 
> the patch:
> 
> 1. Select "dsi_pll" as default clock.
> 2. After the zoom3 display comes up,switch the default screen on LCD to TV 
> using below commands.
>   echo "0" > /sys/devices/platform/omapdss/overlay0/enabled
>   echo "720,574" > /sys/devices/platform/omapdss/overlay0/input_size
>   echo "720,574" > /sys/devices/platform/omapdss/overlay0/output_size
>   echo "tv" >  /sys/devices/platform/omapdss/overlay0/manager
>   echo "1" > /sys/devices/platform/omapdss/display1/enabled
>   echo "1" > /sys/devices/platform/omapdss/overlay0/enabled
> 3. Now the display is appearing on TV.So, Now switch the display back to LCD 
> using the below commands.
>   echo "0" > /sys/devices/platform/omapdss/overlay0/enabled
>   echo "800,480" > /sys/devices/platform/omapdss/overlay0/input_size
>   echo "800,480" > /sys/devices/platform/omapdss/overlay0/output_size
>   echo "lcd" >  /sys/devices/platform/omapdss/overlay0/manager
>   echo "1" > /sys/devices/platform/omapdss/display1/enabled
>   echo "1" > /sys/devices/platform/omapdss/overlay0/enabled
> 4. Now the display will not appear on LCD,if the patch is not included.
> But,the display will appear on LCD, if the patch is included.

The LCD is never turned off in the sequence above. Was that supposed to
be there somewhere?

> > > Signed-off-by: Kishore Y 
> > > Signed-off-by: Mukund Mittal 
> > > Signed-off-by: Rajkumar N 
> > > ---
> > >  drivers/video/omap2/dss/dpi.c |5 +
> > >  1 files changed, 5 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/drivers/video/omap2/dss/dpi.c 
> > b/drivers/video/omap2/dss/dpi.c
> > > index 960e977..5d778d6 100644
> > > --- a/drivers/video/omap2/dss/dpi.c
> > > +++ b/drivers/video/omap2/dss/dpi.c
> > > @@ -214,10 +214,15 @@ void 
> > omapdss_dpi_display_disable(struct omap_dss_device *dssdev)
> > >  
> > >  #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
> > >   dss_select_dispc_clk_source(DSS_SRC_DSS1_ALWON_FCLK);
> > > + dispc_go(OMAP_DSS_CHANNEL_LCD);
> > 
> > I don't think GO does anything here, as the channel has already been
> > disabled.
> Raj:This is the actual fix.So, the above experiment that I explained will be 
> the usecase to understand the need of this statement.

So, how does the OMAP DSS HW actually work then? My understanding was
that GO bit doesn't do anything if the channel is disabled. It's only
used when the channel is enabled.

Setting the GO bit should make the new register changes to be effective
after next VFP. If the channel is disabled, there's no VFP, thus it
shouldn't do anything...?

Also related to using DSI PLL, there's an OMAP bug that causes glitches
on TV-out if DSI PLL is used for DISPC fclk, basically making DSI PLL
unusable for DISPC fclk. Have you encountered this?

 Tomi


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] OMAP: DSS: Fix for dsi_pll to dpll4 clk switch

2010-06-29 Thread Nagarajan, Rajkumar
 

> -Original Message-
> From: Tomi Valkeinen [mailto:tomi.valkei...@nokia.com] 
> Sent: Thursday, June 24, 2010 4:21 PM
> To: Nagarajan, Rajkumar
> Cc: linux-omap@vger.kernel.org
> Subject: Re: [PATCH] OMAP: DSS: Fix for dsi_pll to dpll4 clk switch
> 
> On Thu, 2010-06-17 at 07:12 +0200, ext Nagarajan, Rajkumar wrote:
> > When switching between clocks, The new functional clock is
> > effective when the next vertical blanking interval occurs.
> > GOLCD bit has to be set for the new clock to take effect.
> 
> Where did you encounter this problem?
> 
Raj: The below experiments will make you to understand the significance of the 
patch:

1. Select "dsi_pll" as default clock.
2. After the zoom3 display comes up,switch the default screen on LCD to TV 
using below commands.
echo "0" > /sys/devices/platform/omapdss/overlay0/enabled
echo "720,574" > /sys/devices/platform/omapdss/overlay0/input_size
echo "720,574" > /sys/devices/platform/omapdss/overlay0/output_size
echo "tv" >  /sys/devices/platform/omapdss/overlay0/manager
echo "1" > /sys/devices/platform/omapdss/display1/enabled
echo "1" > /sys/devices/platform/omapdss/overlay0/enabled
3. Now the display is appearing on TV.So, Now switch the display back to LCD 
using the below commands.
echo "0" > /sys/devices/platform/omapdss/overlay0/enabled
echo "800,480" > /sys/devices/platform/omapdss/overlay0/input_size
echo "800,480" > /sys/devices/platform/omapdss/overlay0/output_size
echo "lcd" >  /sys/devices/platform/omapdss/overlay0/manager
echo "1" > /sys/devices/platform/omapdss/display1/enabled
echo "1" > /sys/devices/platform/omapdss/overlay0/enabled
4. Now the display will not appear on LCD,if the patch is not included.
But,the display will appear on LCD, if the patch is included.

> > Signed-off-by: Kishore Y 
> > Signed-off-by: Mukund Mittal 
> > Signed-off-by: Rajkumar N 
> > ---
> >  drivers/video/omap2/dss/dpi.c |5 +
> >  1 files changed, 5 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/video/omap2/dss/dpi.c 
> b/drivers/video/omap2/dss/dpi.c
> > index 960e977..5d778d6 100644
> > --- a/drivers/video/omap2/dss/dpi.c
> > +++ b/drivers/video/omap2/dss/dpi.c
> > @@ -214,10 +214,15 @@ void 
> omapdss_dpi_display_disable(struct omap_dss_device *dssdev)
> >  
> >  #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
> > dss_select_dispc_clk_source(DSS_SRC_DSS1_ALWON_FCLK);
> > +   dispc_go(OMAP_DSS_CHANNEL_LCD);
> 
> I don't think GO does anything here, as the channel has already been
> disabled.
Raj:This is the actual fix.So, the above experiment that I explained will be 
the usecase to understand the need of this statement.
> 
> > +   while   (dispc_go_busy(OMAP_DSS_CHANNEL_LCD))
> > +   ;
> 
> Busy looping is not good.
Raj: will replace with non blocking call in the next version of this patch.
> 
> > dsi_pll_uninit();
> > dss_clk_disable(DSS_CLK_FCK2);
> >  #endif
> >  
> > +   dispc_enable_channel(OMAP_DSS_CHANNEL_LCD, 0);
> > +
> 
> The channel has already been disabled above, in
> dssdev->manager->disable(dssdev->manager);
Raj: will remove this statement in the next version of this patch.
> 
>  Tomi
> 
> 
> 

Re: [PATCH] OMAP: DSS: Fix for dsi_pll to dpll4 clk switch

2010-06-24 Thread Tomi Valkeinen
On Thu, 2010-06-17 at 07:12 +0200, ext Nagarajan, Rajkumar wrote:
> When switching between clocks, The new functional clock is
> effective when the next vertical blanking interval occurs.
> GOLCD bit has to be set for the new clock to take effect.

Where did you encounter this problem?

> Signed-off-by: Kishore Y 
> Signed-off-by: Mukund Mittal 
> Signed-off-by: Rajkumar N 
> ---
>  drivers/video/omap2/dss/dpi.c |5 +
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
> index 960e977..5d778d6 100644
> --- a/drivers/video/omap2/dss/dpi.c
> +++ b/drivers/video/omap2/dss/dpi.c
> @@ -214,10 +214,15 @@ void omapdss_dpi_display_disable(struct omap_dss_device 
> *dssdev)
>  
>  #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
>   dss_select_dispc_clk_source(DSS_SRC_DSS1_ALWON_FCLK);
> + dispc_go(OMAP_DSS_CHANNEL_LCD);

I don't think GO does anything here, as the channel has already been
disabled.

> + while   (dispc_go_busy(OMAP_DSS_CHANNEL_LCD))
> + ;

Busy looping is not good.

>   dsi_pll_uninit();
>   dss_clk_disable(DSS_CLK_FCK2);
>  #endif
>  
> + dispc_enable_channel(OMAP_DSS_CHANNEL_LCD, 0);
> +

The channel has already been disabled above, in
dssdev->manager->disable(dssdev->manager);

 Tomi


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] OMAP: DSS: Fix for dsi_pll to dpll4 clk switch

2010-06-21 Thread Grazvydas Ignotas
when sending DSS patches, CC Tomi and fbdev.

On Thu, Jun 17, 2010 at 8:12 AM, Nagarajan, Rajkumar  wrote:
>
> When switching between clocks, The new functional clock is
> effective when the next vertical blanking interval occurs.
> GOLCD bit has to be set for the new clock to take effect.
>
> Signed-off-by: Kishore Y 
> Signed-off-by: Mukund Mittal 
> Signed-off-by: Rajkumar N 
> ---
>  drivers/video/omap2/dss/dpi.c |    5 +
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
> index 960e977..5d778d6 100644
> --- a/drivers/video/omap2/dss/dpi.c
> +++ b/drivers/video/omap2/dss/dpi.c
> @@ -214,10 +214,15 @@ void omapdss_dpi_display_disable(struct omap_dss_device 
> *dssdev)
>
>  #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
>        dss_select_dispc_clk_source(DSS_SRC_DSS1_ALWON_FCLK);
> +       dispc_go(OMAP_DSS_CHANNEL_LCD);
> +       while   (dispc_go_busy(OMAP_DSS_CHANNEL_LCD))
> +               ;
>        dsi_pll_uninit();
>        dss_clk_disable(DSS_CLK_FCK2);
>  #endif
>
> +       dispc_enable_channel(OMAP_DSS_CHANNEL_LCD, 0);
> +
>        dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
>
>        if (cpu_is_omap34xx())
> --
> 1.5.4.3
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html