diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/video/neofb.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c index 24b12f71d5a8..2f156b724d1c 100644 --- a/drivers/video/neofb.c +++ b/drivers/video/neofb.c | |||
| @@ -1333,17 +1333,22 @@ static int neofb_blank(int blank_mode, struct fb_info *info) | |||
| 1333 | * run "setterm -powersave powerdown" to take advantage | 1333 | * run "setterm -powersave powerdown" to take advantage |
| 1334 | */ | 1334 | */ |
| 1335 | struct neofb_par *par = info->par; | 1335 | struct neofb_par *par = info->par; |
| 1336 | int seqflags, lcdflags, dpmsflags, reg; | 1336 | int seqflags, lcdflags, dpmsflags, reg, tmpdisp; |
| 1337 | |||
| 1338 | 1337 | ||
| 1339 | /* | 1338 | /* |
| 1340 | * Reload the value stored in the register, if sensible. It might have | 1339 | * Read back the register bits related to display configuration. They might |
| 1341 | * been changed via FN keystroke. | 1340 | * have been changed underneath the driver via Fn key stroke. |
| 1341 | */ | ||
| 1342 | neoUnlock(); | ||
| 1343 | tmpdisp = vga_rgfx(NULL, 0x20) & 0x03; | ||
| 1344 | neoLock(&par->state); | ||
| 1345 | |||
| 1346 | /* In case we blank the screen, we want to store the possibly new | ||
| 1347 | * configuration in the driver. During un-blank, we re-apply this setting, | ||
| 1348 | * since the LCD bit will be cleared in order to switch off the backlight. | ||
| 1342 | */ | 1349 | */ |
| 1343 | if (par->PanelDispCntlRegRead) { | 1350 | if (par->PanelDispCntlRegRead) { |
| 1344 | neoUnlock(); | 1351 | par->PanelDispCntlReg1 = tmpdisp; |
| 1345 | par->PanelDispCntlReg1 = vga_rgfx(NULL, 0x20) & 0x03; | ||
| 1346 | neoLock(&par->state); | ||
| 1347 | } | 1352 | } |
| 1348 | par->PanelDispCntlRegRead = !blank_mode; | 1353 | par->PanelDispCntlRegRead = !blank_mode; |
| 1349 | 1354 | ||
| @@ -1378,12 +1383,21 @@ static int neofb_blank(int blank_mode, struct fb_info *info) | |||
| 1378 | break; | 1383 | break; |
| 1379 | case FB_BLANK_NORMAL: /* just blank screen (backlight stays on) */ | 1384 | case FB_BLANK_NORMAL: /* just blank screen (backlight stays on) */ |
| 1380 | seqflags = VGA_SR01_SCREEN_OFF; /* Disable sequencer */ | 1385 | seqflags = VGA_SR01_SCREEN_OFF; /* Disable sequencer */ |
| 1381 | lcdflags = par->PanelDispCntlReg1 & 0x02; /* LCD normal */ | 1386 | /* |
| 1387 | * During a blank operation with the LID shut, we might store "LCD off" | ||
| 1388 | * by mistake. Due to timing issues, the BIOS may switch the lights | ||
| 1389 | * back on, and we turn it back off once we "unblank". | ||
| 1390 | * | ||
| 1391 | * So here is an attempt to implement ">=" - if we are in the process | ||
| 1392 | * of unblanking, and the LCD bit is unset in the driver but set in the | ||
| 1393 | * register, we must keep it. | ||
| 1394 | */ | ||
| 1395 | lcdflags = ((par->PanelDispCntlReg1 | tmpdisp) & 0x02); /* LCD normal */ | ||
| 1382 | dpmsflags = 0x00; /* no hsync/vsync suppression */ | 1396 | dpmsflags = 0x00; /* no hsync/vsync suppression */ |
| 1383 | break; | 1397 | break; |
| 1384 | case FB_BLANK_UNBLANK: /* unblank */ | 1398 | case FB_BLANK_UNBLANK: /* unblank */ |
| 1385 | seqflags = 0; /* Enable sequencer */ | 1399 | seqflags = 0; /* Enable sequencer */ |
| 1386 | lcdflags = par->PanelDispCntlReg1 & 0x02; /* LCD normal */ | 1400 | lcdflags = ((par->PanelDispCntlReg1 | tmpdisp) & 0x02); /* LCD normal */ |
| 1387 | dpmsflags = 0x00; /* no hsync/vsync suppression */ | 1401 | dpmsflags = 0x00; /* no hsync/vsync suppression */ |
| 1388 | #ifdef CONFIG_TOSHIBA | 1402 | #ifdef CONFIG_TOSHIBA |
| 1389 | /* Do we still need this ? */ | 1403 | /* Do we still need this ? */ |
