[PATCH] video imx-ipu-fb: add clear screen

Alex Gershgorin alexg at meprolight.com
Mon Sep 10 06:16:26 EDT 2012


Hi Sascha,

 On Fri, Sep 07, 2012 at 01:46:39PM +0300, Alex Gershgorin wrote:
> This patch clear screen before usage
>
> Signed-off-by: Alex Gershgorin <alexg at meprolight.com>
> ---
>  drivers/video/imx-ipu-fb.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/video/imx-ipu-fb.c b/drivers/video/imx-ipu-fb.c
> index 8039de0..d46cced 100644
> --- a/drivers/video/imx-ipu-fb.c
> +++ b/drivers/video/imx-ipu-fb.c
> @@ -1012,6 +1012,10 @@ static int imxfb_probe(struct device_d *dev)
>                                              (info->bits_per_pixel >> 3));
>               if (!fbi->info.screen_base)
>                       return -ENOMEM;
> +
> +             /* Clear the screen */
> +             memset((char *)fbi->info.screen_base, 0,
> +             info->xres * info->yres * (info->bits_per_pixel >> 3));

> > Not clearing the screen is intentional. Normally the fb drivers do not
> > enable the framebuffer until explicitely requested via fb0.enable=1. The
> > environment normally is supposed to set a picture on the screen and
> > enable it afterwards.
> > That said, we can clear the screen as with MMU enabled this probably
> > does not take long time. But then it should be done in the fb core.

Thanks for your explanation.
In my case, I displayed picture on the screen, of course as you said I added to "init" script   
fb0.enable = 1
bmp / env / logo.bmp
it was easy.

The problem is that I have a screen with resolution 800x600, but picture that I displayed on the my screen is much smaller,
resulting in a picture is displayed fine, but on the sides I get garbage. 
This patch fixes this issue, of course it is not the only way to solve this issue.

Regards,
Alex


More information about the barebox mailing list