Hi Tony, On Fri, Feb 10, 2006 at 07:53:11PM +0800, Antonino A. Daplas wrote: > You can save a few lines by > > par->PanelDispCntlRegRead = (blank_mode) ? 0 : 1; > > Tony > That's just beautiful. I'm a bloody n00b when it comes to C, so I lack the feeling for such subtleties : ) Thanks a bunch! Reworked patch below, also adding proper initialization which got missing during back-and-forth testing. Signed-off-by: Christian Trefzer <[email protected]> --- a/include/video/neomagic.h 2006-01-03 04:21:10.000000000 +0100 +++ b/include/video/neomagic.h 2006-02-09 20:59:20.164839408 +0100 @@ -159,6 +159,7 @@ unsigned char PanelDispCntlReg1; unsigned char PanelDispCntlReg2; unsigned char PanelDispCntlReg3; + unsigned char PanelDispCntlRegRead; unsigned char PanelVertCenterReg1; unsigned char PanelVertCenterReg2; unsigned char PanelVertCenterReg3; --- a/drivers/video/neofb.c 2006-02-08 21:24:05.000000000 +0100 +++ b/drivers/video/neofb.c 2006-02-10 14:54:17.312841824 +0100 @@ -843,6 +843,9 @@ par->SysIfaceCntl2 = 0xc0; /* VESA Bios sets this to 0x80! */ + /* Initialize: by default, we want display config register to be read */ + par->PanelDispCntlRegRead = 1; + /* Enable any user specified display devices. */ par->PanelDispCntlReg1 = 0x00; if (par->internal_display) @@ -1334,8 +1337,12 @@ struct neofb_par *par = (struct neofb_par *)info->par; int seqflags, lcdflags, dpmsflags, reg; - /* Reload the value stored in the register, might have been changed via FN keystroke */ - par->PanelDispCntlReg1 = vga_rgfx(NULL, 0x20) & 0x03; + /* Reload the value stored in the register, if sensible. It might have been + * changed via FN keystroke. */ + if (par->PanelDispCntlRegRead && !blank_mode) { + par->PanelDispCntlReg1 = vga_rgfx(NULL, 0x20) & 0x03; + } + par->PanelDispCntlRegRead = (blank_mode) ? 0 : 1; switch (blank_mode) { case FB_BLANK_POWERDOWN: /* powerdown - both sync lines down */
Attachment:
pgpY4JlceCqjA.pgp
Description: PGP signature
- References:
- [PATCH] neofb: avoid resetting display config on unblank
- From: Christian Trefzer <[email protected]>
- [PATCH] neofb: add more logic to determine sensibility of register readback
- From: Christian Trefzer <[email protected]>
- Re: [PATCH] neofb: add more logic to determine sensibility of register readback
- From: "Antonino A. Daplas" <[email protected]>
- [PATCH] neofb: avoid resetting display config on unblank
- Prev by Date: Re: [linux-pm] Re: [PATCH, RFC] [1/3] Generic in-kernel AC status
- Next by Date: Re: git for dummies, anyone? (was: Re: How in tarnation do I git v2.6.16-rc2? hg died and I still don't git git)
- Previous by thread: Re: [PATCH] neofb: add more logic to determine sensibility of register readback
- Next by thread: Re: [PATCH] neofb: add more logic to determine sensibility of register readback
- Index(es):