igfx: support blanking by turning off panel power and backlight

tested on t61, x200, x230, x301, t420, w520
This commit is contained in:
mischief 2018-08-21 11:31:45 -07:00
parent 0c7fe8ae06
commit 4e938841f0

View file

@ -55,9 +55,46 @@ igfxenable(VGAscr* scr)
scr->softscreen = 1;
}
static void
igfxblank(VGAscr *scr, int blank)
{
u32int off;
switch(scr->pci->did){
default:
return;
case 0x2a02: /* GM965 */
case 0x2a42: /* GM45 */
off = 0x61204;
break;
case 0x0126: /* SNB */
case 0x0166: /* IVB */
off = 0xC7204;
break;
}
/* toggle PP_CONTROL backlight & power state */
if(blank)
scr->mmio[off/4] &= ~0x5;
else
scr->mmio[off/4] |= 0x5;
}
static void
igfxdrawinit(VGAscr *scr)
{
scr->blank = igfxblank;
}
VGAdev vgaigfxdev = {
"igfx",
igfxenable,
nil,
nil,
nil,
igfxdrawinit,
};
static void