diff mbox series

video: mxsfb: call remove() when booting OS

Message ID 20200125224456.14609-1-agust@denx.de
State Accepted
Commit 8382b1019283d2c1e9ba09cf0a10205deaf32fe1
Delegated to: Anatolij Gustschin
Headers show
Series video: mxsfb: call remove() when booting OS | expand

Commit Message

Anatolij Gustschin Jan. 25, 2020, 10:44 p.m. UTC
Add DM_FLAG_OS_PREPARE flag to ensure that the driver's
remove() callback is invoked before booting the kernel.
This is required to stop the LCDIF controller. This was
the behaviour with old driver without DM_VIDEO support.
Without stopping the LCDIF we sometimes observe incorrect
Linux logo position.

Fixes: ae0760584b38 ("imx: mx6ul_14x14_evk: convert to DM_VIDEO")
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Reported-by: Fabio Estevam <festevam@gmail.com>
---
 drivers/video/mxsfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Fabio Estevam Jan. 25, 2020, 10:59 p.m. UTC | #1
Hi Anatolij,

On Sat, Jan 25, 2020 at 7:44 PM Anatolij Gustschin <agust@denx.de> wrote:
>
> Add DM_FLAG_OS_PREPARE flag to ensure that the driver's
> remove() callback is invoked before booting the kernel.
> This is required to stop the LCDIF controller. This was
> the behaviour with old driver without DM_VIDEO support.
> Without stopping the LCDIF we sometimes observe incorrect
> Linux logo position.
>
> Fixes: ae0760584b38 ("imx: mx6ul_14x14_evk: convert to DM_VIDEO")
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> Reported-by: Fabio Estevam <festevam@gmail.com>
> ---
>  drivers/video/mxsfb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
> index c52981053e..c097682d00 100644
> --- a/drivers/video/mxsfb.c
> +++ b/drivers/video/mxsfb.c
> @@ -429,6 +429,6 @@ U_BOOT_DRIVER(mxs_video) = {
>         .bind   = mxs_video_bind,
>         .probe  = mxs_video_probe,
>         .remove = mxs_video_remove,
> -       .flags  = DM_FLAG_PRE_RELOC,
> +       .flags  = DM_FLAG_PRE_RELOC | DM_FLAG_OS_PREPARE,

Thanks! This fixes the Linux logo shift issue:

Reviewed-by: Fabio Estevam <festevam@gmail.com>

One thing I noticed is that after this patch we get a white screen
during U-Boot handoff until the kernel logo is shown.

This was not observed with the non DM driver.

Is there a way we could keep the screen black instead of white during
the transition?

Thanks
Anatolij Gustschin Jan. 25, 2020, 11:43 p.m. UTC | #2
Hi Fabio,

On Sat, 25 Jan 2020 19:59:47 -0300
Fabio Estevam festevam@gmail.com wrote:
...
> > -       .flags  = DM_FLAG_PRE_RELOC,
> > +       .flags  = DM_FLAG_PRE_RELOC | DM_FLAG_OS_PREPARE,  
> 
> Thanks! This fixes the Linux logo shift issue:

Thanks for testing!

...
> One thing I noticed is that after this patch we get a white screen
> during U-Boot handoff until the kernel logo is shown.
> 
> This was not observed with the non DM driver.

I'm not sure where it comes from.

> Is there a way we could keep the screen black instead of white during
> the transition?

Maybe turning off the backlight could help to keep it black?
I've sent a patch, could you please test it? Thanks!


--
Anatolij
Fabio Estevam Jan. 26, 2020, 12:24 p.m. UTC | #3
Hi Anatolij,

On Sat, Jan 25, 2020 at 8:43 PM Anatolij Gustschin <agust@denx.de> wrote:

> Maybe turning off the backlight could help to keep it black?
> I've sent a patch, could you please test it? Thanks!

Yes, your patch worked! Thanks!
Michael Nazzareno Trimarchi Jan. 26, 2020, 12:30 p.m. UTC | #4
HI

On Sun, Jan 26, 2020 at 1:24 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Anatolij,
>
> On Sat, Jan 25, 2020 at 8:43 PM Anatolij Gustschin <agust@denx.de> wrote:
>
> > Maybe turning off the backlight could help to keep it black?
> > I've sent a patch, could you please test it? Thanks!
>
> Yes, your patch worked! Thanks!

This is not a general use case. We want sometime to preserve the
graphics framebuffer in order
to linux to show persistent one.

Michael
diff mbox series

Patch

diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index c52981053e..c097682d00 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -429,6 +429,6 @@  U_BOOT_DRIVER(mxs_video) = {
 	.bind	= mxs_video_bind,
 	.probe	= mxs_video_probe,
 	.remove = mxs_video_remove,
-	.flags	= DM_FLAG_PRE_RELOC,
+	.flags	= DM_FLAG_PRE_RELOC | DM_FLAG_OS_PREPARE,
 };
 #endif /* ifndef CONFIG_DM_VIDEO */