Re: [BK PATCHS] fbdev updates.

Russell King (rmk@arm.linux.org.uk)
Tue, 15 Oct 2002 10:00:24 +0100


On Mon, Oct 14, 2002 at 09:39:31AM -0700, James Simmons wrote:
> drivers/video/clps711xfb.c | 2

Ok, this won't clash with the updates Linus pulled recently from me
that actually allow this driver to build again in 2.5.42.

> diff -Nru a/drivers/video/clps711xfb.c b/drivers/video/clps711xfb.c
> --- a/drivers/video/clps711xfb.c Mon Oct 14 09:36:34 2002
> +++ b/drivers/video/clps711xfb.c Mon Oct 14 09:36:34 2002
> @@ -194,7 +194,6 @@
> .owner = THIS_MODULE,
> .fb_check_var = clps7111fb_check_var,
> .fb_set_par = clps7111fb_set_par,
> - .fb_set_var = gen_set_var,
> .fb_setcolreg = clps7111fb_setcolreg,
> .fb_blank = clps7111fb_blank,
> .fb_fillrect = cfb_fillrect,
> @@ -322,7 +321,6 @@
> clps_writeb(clps_readb(PDDR) | EDB_PD3_LCDBL, PDDR);
> }
>
> - gen_set_var(&cfb->var, -1, cfb);
> err = register_framebuffer(cfb);
>
> out: return err;

I'm not sure this "set var" business has been thought out as much as it
should be.

If can_soft_blank is not set, the driver will never, ever receive any
calls to perform blanking via the fb_blank callback. Even the power
management blanking calls are blocked, and fbcon clears the screen
instead. This in itself is fine.

However, since the set_var method has gone, drivers are now unable to
set can_soft_blank according to their capabilities because
fbgen.c:gen_set_disp will do it for them thusly:

if (info->fix.visual == FB_VISUAL_PSEUDOCOLOR ||
info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
display->can_soft_blank = info->fbops->fb_blank ? 1 : 0;
display->dispsw_data = NULL;
} else {
display->can_soft_blank = 0;
display->dispsw_data = info->pseudo_palette;
}

This sucks on devices where blanking can be performed by hardware means.
For example, on embedded devices, you can turn off the LCD controller
and LCD panel (and thereby save power). There's no point in having both
these powered/running when the display is not in use, draining valuable
battery power.

This is also true of most, if not all VGA cards when VESA blanking is in
effect. As the code currently stands, if the console is in pseudo colour
or direct colour mode, everything works as expected. However, if it isn't,
you can't even power down your monitor when the screen blanks.

In 2.5.42, there is a work around possible - it is possible to intercept
the call to gen_set_var, and set con_soft_blank according to your driver
capabilities. However, with the fb_set_var method going away, this is no
longer possible.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/