* [RESEND][PATCH] sm501fb: clear framebuffer memory and palette
@ 2008-01-21 10:59 Magnus Damm
2008-01-30 11:14 ` Ben Dooks
0 siblings, 1 reply; 2+ messages in thread
From: Magnus Damm @ 2008-01-21 10:59 UTC (permalink / raw)
To: linux-fbdev-devel; +Cc: akpm, lethal, magnus.damm, ben-linux
sm501fb: clear framebuffer memory and palette
Avoid displaying garbage on unused framebuffers. For most users a single
framebuffer is used together with fbcon. sm501fb supports two framebuffers
where one often is assigned to fbcon and the other one is left unused during
the boot.
The problem here is that framebuffers not in use by fbcon happen to display
garbage. This can easily be solved by making sure that framebuffer memory and
palette ram are cleared.
The problem can be observed by using looking at the panel output (fb1)
after booting the kernel with fbcon on crt (fb0). This is the default
configuration. It's also possible to watch the garbage on the crt framebuffer
by passing "fbcon=map:1" on the kernel cmdline. This will assign fbcon to
the panel (fb1) and leave the crt (fb0) unused.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
---
This is the same patch that was sent to linux-fbdev-devel on 20071228.
drivers/video/sm501fb.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- 0002/drivers/video/sm501fb.c
+++ work/drivers/video/sm501fb.c 2007-12-27 13:24:20.000000000 +0900
@@ -1264,6 +1264,7 @@ static int sm501fb_start(struct sm501fb_
{
struct resource *res;
struct device *dev;
+ int k;
int ret;
info->dev = dev = &pdev->dev;
@@ -1325,6 +1326,13 @@ static int sm501fb_start(struct sm501fb_
info->fbmem_len = (res->end - res->start)+1;
+ /* clear framebuffer memory - avoids garbage data on unused fb */
+ memset(info->fbmem, 0, info->fbmem_len);
+
+ /* clear palette ram - undefined at power on */
+ for (k = 0; k < (256 * 3); k++)
+ writel(0, info->regs + SM501_DC_PANEL_PALETTE + (k * 4));
+
/* enable display controller */
sm501_unit_power(dev->parent, SM501_GATE_DISPLAY, 1);
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [RESEND][PATCH] sm501fb: clear framebuffer memory and palette
2008-01-21 10:59 [RESEND][PATCH] sm501fb: clear framebuffer memory and palette Magnus Damm
@ 2008-01-30 11:14 ` Ben Dooks
0 siblings, 0 replies; 2+ messages in thread
From: Ben Dooks @ 2008-01-30 11:14 UTC (permalink / raw)
To: linux-fbdev-devel
On Mon, Jan 21, 2008 at 07:59:25PM +0900, Magnus Damm wrote:
> sm501fb: clear framebuffer memory and palette
>
> Avoid displaying garbage on unused framebuffers. For most users a single
> framebuffer is used together with fbcon. sm501fb supports two framebuffers
> where one often is assigned to fbcon and the other one is left unused during
> the boot.
>
> The problem here is that framebuffers not in use by fbcon happen to display
> garbage. This can easily be solved by making sure that framebuffer memory and
> palette ram are cleared.
>
> The problem can be observed by using looking at the panel output (fb1)
> after booting the kernel with fbcon on crt (fb0). This is the default
> configuration. It's also possible to watch the garbage on the crt framebuffer
> by passing "fbcon=map:1" on the kernel cmdline. This will assign fbcon to
> the panel (fb1) and leave the crt (fb0) unused.
Can you please add a no-clear-on-init flag incase people do not want
their framebuffers cleared.
> Signed-off-by: Magnus Damm <damm@igel.co.jp>
> ---
>
> This is the same patch that was sent to linux-fbdev-devel on 20071228.
>
> drivers/video/sm501fb.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> --- 0002/drivers/video/sm501fb.c
> +++ work/drivers/video/sm501fb.c 2007-12-27 13:24:20.000000000 +0900
> @@ -1264,6 +1264,7 @@ static int sm501fb_start(struct sm501fb_
> {
> struct resource *res;
> struct device *dev;
> + int k;
> int ret;
>
> info->dev = dev = &pdev->dev;
> @@ -1325,6 +1326,13 @@ static int sm501fb_start(struct sm501fb_
>
> info->fbmem_len = (res->end - res->start)+1;
>
> + /* clear framebuffer memory - avoids garbage data on unused fb */
> + memset(info->fbmem, 0, info->fbmem_len);
> +
> + /* clear palette ram - undefined at power on */
> + for (k = 0; k < (256 * 3); k++)
> + writel(0, info->regs + SM501_DC_PANEL_PALETTE + (k * 4));
> +
> /* enable display controller */
> sm501_unit_power(dev->parent, SM501_GATE_DISPLAY, 1);
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Linux-fbdev-devel mailing list
> Linux-fbdev-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-01-30 11:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-21 10:59 [RESEND][PATCH] sm501fb: clear framebuffer memory and palette Magnus Damm
2008-01-30 11:14 ` Ben Dooks
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).