From: "Antonino A. Daplas" This patch converts most drivers to use the new FB_BLANK_* constants. These drivers have correct fb_blank() implementations. Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton --- 25-akpm/drivers/video/amifb.c | 9 ++++--- 25-akpm/drivers/video/aty/aty128fb.c | 6 ++--- 25-akpm/drivers/video/aty/atyfb_base.c | 23 ++++++++++--------- 25-akpm/drivers/video/bw2.c | 10 ++++---- 25-akpm/drivers/video/cg3.c | 10 ++++---- 25-akpm/drivers/video/cg6.c | 10 ++++---- 25-akpm/drivers/video/controlfb.c | 10 ++++---- 25-akpm/drivers/video/cyber2000fb.c | 8 +++--- 25-akpm/drivers/video/ffb.c | 10 ++++---- 25-akpm/drivers/video/gbefb.c | 4 +-- 25-akpm/drivers/video/imsttfb.c | 10 ++++---- 25-akpm/drivers/video/intelfb/intelfbdrv.c | 4 +-- 25-akpm/drivers/video/intelfb/intelfbhw.c | 10 ++++---- 25-akpm/drivers/video/leo.c | 10 ++++---- 25-akpm/drivers/video/matrox/matroxfb_base.c | 10 ++++---- 25-akpm/drivers/video/neofb.c | 10 ++++---- 25-akpm/drivers/video/p9100.c | 10 ++++---- 25-akpm/drivers/video/pm2fb.c | 10 ++++---- 25-akpm/drivers/video/pxafb.c | 9 ++++--- 25-akpm/drivers/video/riva/fbdev.c | 32 +++++++++++++++------------ 25-akpm/drivers/video/sa1100fb.c | 9 ++++--- 25-akpm/drivers/video/tcx.c | 10 ++++---- 25-akpm/drivers/video/tdfxfb.c | 10 ++++---- 25-akpm/drivers/video/tgafb.c | 10 ++++---- 25-akpm/drivers/video/tridentfb.c | 14 +++++++---- 25-akpm/drivers/video/valkyriefb.c | 10 ++++---- 25-akpm/drivers/video/vga16fb.c | 10 ++++---- 27 files changed, 150 insertions(+), 138 deletions(-) diff -puN drivers/video/amifb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/amifb.c --- 25/drivers/video/amifb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.484924976 -0800 +++ 25-akpm/drivers/video/amifb.c 2004-11-07 16:32:45.531917832 -0800 @@ -2469,6 +2469,7 @@ static void amifb_deinit(void) static int amifb_blank(int blank, struct fb_info *info) { do_blank = blank ? blank : -1; + return 0; } @@ -3247,20 +3248,20 @@ static void ami_do_blank(void) custom.dmacon = DMAF_RASTER | DMAF_SPRITE; red = green = blue = 0; if (!IS_OCS && do_blank > 1) { - switch (do_blank-1) { - case VESA_VSYNC_SUSPEND: + switch (do_blank) { + case FB_BLANK_VSYNC_SUSPEND: custom.hsstrt = hsstrt2hw(par->hsstrt); custom.hsstop = hsstop2hw(par->hsstop); custom.vsstrt = vsstrt2hw(par->vtotal+4); custom.vsstop = vsstop2hw(par->vtotal+4); break; - case VESA_HSYNC_SUSPEND: + case FB_BLANK_HSYNC_SUSPEND: custom.hsstrt = hsstrt2hw(par->htotal+16); custom.hsstop = hsstop2hw(par->htotal+16); custom.vsstrt = vsstrt2hw(par->vsstrt); custom.vsstop = vsstrt2hw(par->vsstop); break; - case VESA_POWERDOWN: + case FB_BLANK_POWERDOWN: custom.hsstrt = hsstrt2hw(par->htotal+16); custom.hsstop = hsstop2hw(par->htotal+16); custom.vsstrt = vsstrt2hw(par->vtotal+4); diff -puN drivers/video/aty/aty128fb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/aty/aty128fb.c --- 25/drivers/video/aty/aty128fb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.486924672 -0800 +++ 25-akpm/drivers/video/aty/aty128fb.c 2004-11-07 16:32:45.533917528 -0800 @@ -2042,11 +2042,11 @@ static int aty128fb_blank(int blank, str set_backlight_enable(0); #endif /* CONFIG_PMAC_BACKLIGHT */ - if (blank & VESA_VSYNC_SUSPEND) + if (blank & FB_BLANK_VSYNC_SUSPEND) state |= 2; - if (blank & VESA_HSYNC_SUSPEND) + if (blank & FB_BLANK_HSYNC_SUSPEND) state |= 1; - if (blank & VESA_POWERDOWN) + if (blank & FB_BLANK_POWERDOWN) state |= 4; aty_st_8(CRTC_EXT_CNTL+1, state); diff -puN drivers/video/aty/atyfb_base.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/aty/atyfb_base.c --- 25/drivers/video/aty/atyfb_base.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.489924216 -0800 +++ 25-akpm/drivers/video/aty/atyfb_base.c 2004-11-07 16:32:45.535917224 -0800 @@ -2045,7 +2045,7 @@ static int atyfb_pci_suspend(struct pci_ aty_reset_engine(par); /* Blank display and LCD */ - atyfb_blank(VESA_POWERDOWN + 1, info); + atyfb_blank(FB_BLANK_POWERDOWN, info); par->asleep = 1; par->lock_blank = 1; @@ -2054,7 +2054,7 @@ static int atyfb_pci_suspend(struct pci_ if (aty_power_mgmt(1, par)) { par->asleep = 0; par->lock_blank = 0; - atyfb_blank(0, info); + atyfb_blank(FB_BLANK_UNBLANK, info); fb_set_suspend(info, 0); release_console_sem(); return -EIO; @@ -2089,7 +2089,7 @@ static int atyfb_pci_resume(struct pci_d /* Unblank */ par->lock_blank = 0; - atyfb_blank(0, info); + atyfb_blank(FB_BLANK_UNBLANK, info); release_console_sem(); @@ -2625,22 +2625,23 @@ static int atyfb_blank(int blank, struct #endif gen_cntl = aty_ld_8(CRTC_GEN_CNTL, par); - if (blank > 0) - switch (blank - 1) { - case VESA_NO_BLANKING: + switch (blank) { + case FB_BLANK_UNBLANK: + gen_cntl &= ~(0x4c); + break; + case FB_BLANK_NORMAL: gen_cntl |= 0x40; break; - case VESA_VSYNC_SUSPEND: + case FB_BLANK_VSYNC_SUSPEND: gen_cntl |= 0x8; break; - case VESA_HSYNC_SUSPEND: + case FB_BLANK_HSYNC_SUSPEND: gen_cntl |= 0x4; break; - case VESA_POWERDOWN: + case FB_BLANK_POWERDOWN: gen_cntl |= 0x4c; break; - } else - gen_cntl &= ~(0x4c); + } aty_st_8(CRTC_GEN_CNTL, gen_cntl, par); #ifdef CONFIG_PMAC_BACKLIGHT diff -puN drivers/video/bw2.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/bw2.c --- 25/drivers/video/bw2.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.490924064 -0800 +++ 25-akpm/drivers/video/bw2.c 2004-11-07 16:32:45.536917072 -0800 @@ -138,17 +138,17 @@ bw2_blank(int blank, struct fb_info *inf spin_lock_irqsave(&par->lock, flags); switch (blank) { - case 0: /* Unblanking */ + case FB_BLANK_UNBLANK: /* Unblanking */ val = sbus_readb(®s->control); val |= BWTWO_CTL_ENABLE_VIDEO; sbus_writeb(val, ®s->control); par->flags &= ~BW2_FLAG_BLANKED; break; - case 1: /* Normal blanking */ - case 2: /* VESA blank (vsync off) */ - case 3: /* VESA blank (hsync off) */ - case 4: /* Poweroff */ + case FB_BLANK_NORMAL: /* Normal blanking */ + case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */ + case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */ + case FB_BLANK_POWERDOWN: /* Poweroff */ val = sbus_readb(®s->control); val &= ~BWTWO_CTL_ENABLE_VIDEO; sbus_writeb(val, ®s->control); diff -puN drivers/video/cg3.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/cg3.c --- 25/drivers/video/cg3.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.492923760 -0800 +++ 25-akpm/drivers/video/cg3.c 2004-11-07 16:32:45.537916920 -0800 @@ -197,17 +197,17 @@ cg3_blank(int blank, struct fb_info *inf spin_lock_irqsave(&par->lock, flags); switch (blank) { - case 0: /* Unblanking */ + case FB_BLANK_UNBLANK: /* Unblanking */ val = sbus_readl(®s->control); val |= CG3_CR_ENABLE_VIDEO; sbus_writel(val, ®s->control); par->flags &= ~CG3_FLAG_BLANKED; break; - case 1: /* Normal blanking */ - case 2: /* VESA blank (vsync off) */ - case 3: /* VESA blank (hsync off) */ - case 4: /* Poweroff */ + case FB_BLANK_NORMAL: /* Normal blanking */ + case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */ + case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */ + case FB_BLANK_POWERDOWN: /* Poweroff */ val = sbus_readl(®s->control); val |= CG3_CR_ENABLE_VIDEO; sbus_writel(val, ®s->control); diff -puN drivers/video/cg6.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/cg6.c --- 25/drivers/video/cg6.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.493923608 -0800 +++ 25-akpm/drivers/video/cg6.c 2004-11-07 16:32:45.537916920 -0800 @@ -456,17 +456,17 @@ cg6_blank(int blank, struct fb_info *inf spin_lock_irqsave(&par->lock, flags); switch (blank) { - case 0: /* Unblanking */ + case FB_BLANK_UNBLANK: /* Unblanking */ val = sbus_readl(&thc->thc_misc); val |= CG6_THC_MISC_VIDEO; sbus_writel(val, &thc->thc_misc); par->flags &= ~CG6_FLAG_BLANKED; break; - case 1: /* Normal blanking */ - case 2: /* VESA blank (vsync off) */ - case 3: /* VESA blank (hsync off) */ - case 4: /* Poweroff */ + case FB_BLANK_NORMAL: /* Normal blanking */ + case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */ + case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */ + case FB_BLANK_POWERDOWN: /* Poweroff */ val = sbus_readl(&thc->thc_misc); val &= ~CG6_THC_MISC_VIDEO; sbus_writel(val, &thc->thc_misc); diff -puN drivers/video/controlfb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/controlfb.c --- 25/drivers/video/controlfb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.494923456 -0800 +++ 25-akpm/drivers/video/controlfb.c 2004-11-07 16:32:45.538916768 -0800 @@ -329,17 +329,17 @@ static int controlfb_blank(int blank_mod ctrl = ld_le32(CNTRL_REG(p,ctrl)); if (blank_mode > 0) - switch (blank_mode - 1) { - case VESA_VSYNC_SUSPEND: + switch (blank_mode) { + case FB_BLANK_VSYNC_SUSPEND: ctrl &= ~3; break; - case VESA_HSYNC_SUSPEND: + case FB_BLANK_HSYNC_SUSPEND: ctrl &= ~0x30; break; - case VESA_POWERDOWN: + case FB_BLANK_POWERDOWN: ctrl &= ~0x33; /* fall through */ - case VESA_NO_BLANKING: + case FB_BLANK_NORMAL: ctrl |= 0x400; break; default: diff -puN drivers/video/cyber2000fb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/cyber2000fb.c --- 25/drivers/video/cyber2000fb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.496923152 -0800 +++ 25-akpm/drivers/video/cyber2000fb.c 2004-11-07 16:32:45.540916464 -0800 @@ -1003,16 +1003,16 @@ static int cyber2000fb_blank(int blank, int i; switch (blank) { - case 4: /* powerdown - both sync lines down */ + case FB_BLANK_POWERDOWN: /* powerdown - both sync lines down */ sync = EXT_SYNC_CTL_VS_0 | EXT_SYNC_CTL_HS_0; break; - case 3: /* hsync off */ + case FB_BLANK_HSYNC_SUSPEND: /* hsync off */ sync = EXT_SYNC_CTL_VS_NORMAL | EXT_SYNC_CTL_HS_0; break; - case 2: /* vsync off */ + case FB_BLANK_VSYNC_SUSPEND: /* vsync off */ sync = EXT_SYNC_CTL_VS_0 | EXT_SYNC_CTL_HS_NORMAL; break; - case 1: /* soft blank */ + case FB_BLANK_NORMAL: /* soft blank */ default: /* unblank */ break; } diff -puN drivers/video/ffb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/ffb.c --- 25/drivers/video/ffb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.498922848 -0800 +++ 25-akpm/drivers/video/ffb.c 2004-11-07 16:32:45.541916312 -0800 @@ -676,7 +676,7 @@ ffb_blank(int blank, struct fb_info *inf FFBWait(par); switch (blank) { - case 0: /* Unblanking */ + case FB_BLANK_UNBLANK: /* Unblanking */ upa_writel(0x6000, &dac->type); tmp = (upa_readl(&dac->value) | 0x1); upa_writel(0x6000, &dac->type); @@ -684,10 +684,10 @@ ffb_blank(int blank, struct fb_info *inf par->flags &= ~FFB_FLAG_BLANKED; break; - case 1: /* Normal blanking */ - case 2: /* VESA blank (vsync off) */ - case 3: /* VESA blank (hsync off) */ - case 4: /* Poweroff */ + case FB_BLANK_NORMAL: /* Normal blanking */ + case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */ + case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */ + case FB_BLANK_POWERDOWN: /* Poweroff */ upa_writel(0x6000, &dac->type); tmp = (upa_readl(&dac->value) & ~0x1); upa_writel(0x6000, &dac->type); diff -puN drivers/video/gbefb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/gbefb.c --- 25/drivers/video/gbefb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.499922696 -0800 +++ 25-akpm/drivers/video/gbefb.c 2004-11-07 16:32:45.542916160 -0800 @@ -384,11 +384,11 @@ static int gbefb_blank(int blank, struct { /* 0 unblank, 1 blank, 2 no vsync, 3 no hsync, 4 off */ switch (blank) { - case 0: /* unblank */ + case FB_BLANK_UNBLANK: /* unblank */ gbe_turn_on(); break; - case 1: /* blank */ + case FB_BLANK_NORMAL: /* blank */ gbe_turn_off(); break; diff -puN drivers/video/imsttfb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/imsttfb.c --- 25/drivers/video/imsttfb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.501922392 -0800 +++ 25-akpm/drivers/video/imsttfb.c 2004-11-07 16:32:45.544915856 -0800 @@ -940,9 +940,9 @@ imsttfb_blank(int blank, struct fb_info ctrl = read_reg_le32(par->dc_regs, STGCTL); if (blank > 0) { - switch (blank - 1) { - case VESA_NO_BLANKING: - case VESA_POWERDOWN: + switch (blank) { + case FB_BLANK_NORMAL: + case FB_BLANK_POWERDOWN: ctrl &= ~0x00000380; if (par->ramdac == IBM) { par->cmap_regs[PIDXHI] = 0; eieio(); @@ -958,10 +958,10 @@ imsttfb_blank(int blank, struct fb_info par->cmap_regs[PIDXDATA] = 0xc0; } break; - case VESA_VSYNC_SUSPEND: + case FB_BLANK_VSYNC_SUSPEND: ctrl &= ~0x00000020; break; - case VESA_HSYNC_SUSPEND: + case FB_BLANK_HSYNC_SUSPEND: ctrl &= ~0x00000010; break; } diff -puN drivers/video/intelfb/intelfbdrv.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/intelfb/intelfbdrv.c --- 25/drivers/video/intelfb/intelfbdrv.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.502922240 -0800 +++ 25-akpm/drivers/video/intelfb/intelfbdrv.c 2004-11-07 16:32:45.545915704 -0800 @@ -1191,7 +1191,7 @@ intelfb_set_par(struct fb_info *info) DBG_MSG("intelfb_set_par (%dx%d-%d)\n", info->var.xres, info->var.yres, info->var.bits_per_pixel); - intelfb_blank(1, info); + intelfb_blank(FB_BLANK_POWERDOWN, info); if (dinfo->accel) intelfbhw_2d_stop(dinfo); @@ -1214,7 +1214,7 @@ intelfb_set_par(struct fb_info *info) intelfb_pan_display(&info->var, info); - intelfb_blank(0, info); + intelfb_blank(FB_BLANK_UNBLANK, info); if (ACCEL(dinfo, info)) { info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN | diff -puN drivers/video/intelfb/intelfbhw.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/intelfb/intelfbhw.c --- 25/drivers/video/intelfb/intelfbhw.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.504921936 -0800 +++ 25-akpm/drivers/video/intelfb/intelfbhw.c 2004-11-07 16:32:45.546915552 -0800 @@ -341,17 +341,17 @@ intelfbhw_do_blank(int blank, struct fb_ /* Set DPMS level */ tmp = INREG(ADPA) & ~ADPA_DPMS_CONTROL_MASK; switch (blank) { - case 0: - case 1: + case FB_BLANK_UNBLANK: + case FB_BLANK_NORMAL: tmp |= ADPA_DPMS_D0; break; - case 2: + case FB_BLANK_VSYNC_SUSPEND: tmp |= ADPA_DPMS_D1; break; - case 3: + case FB_BLANK_HSYNC_SUSPEND: tmp |= ADPA_DPMS_D2; break; - case 4: + case FB_BLANK_POWERDOWN: tmp |= ADPA_DPMS_D3; break; } diff -puN drivers/video/leo.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/leo.c --- 25/drivers/video/leo.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.505921784 -0800 +++ 25-akpm/drivers/video/leo.c 2004-11-07 16:32:45.547915400 -0800 @@ -270,17 +270,17 @@ static int leo_blank(int blank, struct f spin_lock_irqsave(&par->lock, flags); switch (blank) { - case 0: /* Unblanking */ + case FB_BLANK_UNBLANK: /* Unblanking */ val = sbus_readl(&lx_krn->krn_csr); val |= LEO_KRN_CSR_ENABLE; sbus_writel(val, &lx_krn->krn_csr); par->flags &= ~LEO_FLAG_BLANKED; break; - case 1: /* Normal blanking */ - case 2: /* VESA blank (vsync off) */ - case 3: /* VESA blank (hsync off) */ - case 4: /* Poweroff */ + case FB_BLANK_NORMAL: /* Normal blanking */ + case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */ + case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */ + case FB_BLANK_POWERDOWN: /* Poweroff */ val = sbus_readl(&lx_krn->krn_csr); val &= ~LEO_KRN_CSR_ENABLE; sbus_writel(val, &lx_krn->krn_csr); diff -puN drivers/video/matrox/matroxfb_base.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/matrox/matroxfb_base.c --- 25/drivers/video/matrox/matroxfb_base.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.507921480 -0800 +++ 25-akpm/drivers/video/matrox/matroxfb_base.c 2004-11-07 16:32:45.549915096 -0800 @@ -1183,11 +1183,11 @@ static int matroxfb_blank(int blank, str return 1; switch (blank) { - case 1: seq = 0x20; crtc = 0x00; break; /* works ??? */ - case 2: seq = 0x20; crtc = 0x10; break; - case 3: seq = 0x20; crtc = 0x20; break; - case 4: seq = 0x20; crtc = 0x30; break; - default: seq = 0x00; crtc = 0x00; break; + case FB_BLANK_NORMAL: seq = 0x20; crtc = 0x00; break; /* works ??? */ + case FB_BLANK_VSYNC_SUSPEND: seq = 0x20; crtc = 0x10; break; + case FB_BLANK_HSYNC_SUSPEND: seq = 0x20; crtc = 0x20; break; + case FB_BLANK_POWERDOWN: seq = 0x20; crtc = 0x30; break; + default: seq = 0x00; crtc = 0x00; break; } CRITBEGIN diff -puN drivers/video/neofb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/neofb.c --- 25/drivers/video/neofb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.509921176 -0800 +++ 25-akpm/drivers/video/neofb.c 2004-11-07 16:32:45.551914792 -0800 @@ -1340,7 +1340,7 @@ int neofb_blank(int blank_mode, struct f int seqflags, lcdflags, dpmsflags, reg; switch (blank_mode) { - case 4: /* powerdown - both sync lines down */ + case FB_BLANK_POWERDOWN: /* powerdown - both sync lines down */ seqflags = VGA_SR01_SCREEN_OFF; /* Disable sequencer */ lcdflags = 0; /* LCD off */ dpmsflags = NEO_GR01_SUPPRESS_HSYNC | @@ -1358,22 +1358,22 @@ int neofb_blank(int blank_mode, struct f } #endif break; - case 3: /* hsync off */ + case FB_BLANK_HSYNC_SUSPEND: /* hsync off */ seqflags = VGA_SR01_SCREEN_OFF; /* Disable sequencer */ lcdflags = 0; /* LCD off */ dpmsflags = NEO_GR01_SUPPRESS_HSYNC; break; - case 2: /* vsync off */ + case FB_BLANK_VSYNC_SUSPEND: /* vsync off */ seqflags = VGA_SR01_SCREEN_OFF; /* Disable sequencer */ lcdflags = 0; /* LCD off */ dpmsflags = NEO_GR01_SUPPRESS_VSYNC; break; - case 1: /* just blank screen (backlight stays on) */ + case FB_BLANK_NORMAL: /* just blank screen (backlight stays on) */ seqflags = VGA_SR01_SCREEN_OFF; /* Disable sequencer */ lcdflags = par->PanelDispCntlReg1 & 0x02; /* LCD normal */ dpmsflags = 0; /* no hsync/vsync suppression */ break; - case 0: /* unblank */ + case FB_BLANK_UNBLANK: /* unblank */ seqflags = 0; /* Enable sequencer */ lcdflags = par->PanelDispCntlReg1 & 0x02; /* LCD normal */ dpmsflags = 0x00; /* no hsync/vsync suppression */ diff -puN drivers/video/p9100.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/p9100.c --- 25/drivers/video/p9100.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.510921024 -0800 +++ 25-akpm/drivers/video/p9100.c 2004-11-07 16:32:45.552914640 -0800 @@ -193,17 +193,17 @@ p9100_blank(int blank, struct fb_info *i spin_lock_irqsave(&par->lock, flags); switch (blank) { - case 0: /* Unblanking */ + case FB_BLANK_UNBLANK: /* Unblanking */ val = sbus_readl(®s->vid_screenpaint_timectl1); val |= SCREENPAINT_TIMECTL1_ENABLE_VIDEO; sbus_writel(val, ®s->vid_screenpaint_timectl1); par->flags &= ~P9100_FLAG_BLANKED; break; - case 1: /* Normal blanking */ - case 2: /* VESA blank (vsync off) */ - case 3: /* VESA blank (hsync off) */ - case 4: /* Poweroff */ + case FB_BLANK_NORMAL: /* Normal blanking */ + case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */ + case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */ + case FB_BLANK_POWERDOWN: /* Poweroff */ val = sbus_readl(®s->vid_screenpaint_timectl1); val &= ~SCREENPAINT_TIMECTL1_ENABLE_VIDEO; sbus_writel(val, ®s->vid_screenpaint_timectl1); diff -puN drivers/video/pm2fb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/pm2fb.c --- 25/drivers/video/pm2fb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.511920872 -0800 +++ 25-akpm/drivers/video/pm2fb.c 2004-11-07 16:32:45.553914488 -0800 @@ -971,23 +971,23 @@ static int pm2fb_blank(int blank_mode, s DPRINTK("blank_mode %d\n", blank_mode); switch (blank_mode) { - case 0: + case FB_BLANK_UNBLANK: /* Screen: On */ video |= PM2F_VIDEO_ENABLE; break; - case VESA_NO_BLANKING + 1: + case FB_BLANK_NORMAL: /* Screen: Off */ video &= ~PM2F_VIDEO_ENABLE; break; - case VESA_VSYNC_SUSPEND + 1: + case FB_BLANK_VSYNC_SUSPEND: /* VSync: Off */ video &= ~(PM2F_VSYNC_MASK | PM2F_BLANK_LOW ); break; - case VESA_HSYNC_SUSPEND + 1: + case FB_BLANK_HSYNC_SUSPEND: /* HSync: Off */ video &= ~(PM2F_HSYNC_MASK | PM2F_BLANK_LOW ); break; - case VESA_POWERDOWN + 1: + case FB_BLANK_POWERDOWN: /* HSync: Off, VSync: Off */ video &= ~(PM2F_VSYNC_MASK | PM2F_HSYNC_MASK| PM2F_BLANK_LOW); break; diff -puN drivers/video/pxafb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/pxafb.c --- 25/drivers/video/pxafb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.513920568 -0800 +++ 25-akpm/drivers/video/pxafb.c 2004-11-07 16:32:45.554914336 -0800 @@ -371,9 +371,10 @@ static int pxafb_blank(int blank, struct DPRINTK("pxafb_blank: blank=%d\n", blank); switch (blank) { - case VESA_POWERDOWN: - case VESA_VSYNC_SUSPEND: - case VESA_HSYNC_SUSPEND: + case FB_BLANK_POWERDOWN: + case FB_BLANK_VSYNC_SUSPEND: + case FB_BLANK_HSYNC_SUSPEND: + case FB_BLANK_NORMAL: if (fbi->fb.fix.visual == FB_VISUAL_PSEUDOCOLOR || fbi->fb.fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR) for (i = 0; i < fbi->palette_size; i++) @@ -383,7 +384,7 @@ static int pxafb_blank(int blank, struct //TODO if (pxafb_blank_helper) pxafb_blank_helper(blank); break; - case VESA_NO_BLANKING: + case FB_BLANK_UNBLANK: //TODO if (pxafb_blank_helper) pxafb_blank_helper(blank); if (fbi->fb.fix.visual == FB_VISUAL_PSEUDOCOLOR || fbi->fb.fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR) diff -puN drivers/video/riva/fbdev.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/riva/fbdev.c --- 25/drivers/video/riva/fbdev.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.514920416 -0800 +++ 25-akpm/drivers/video/riva/fbdev.c 2004-11-07 16:32:45.556914032 -0800 @@ -1240,22 +1240,25 @@ static int rivafb_blank(int blank, struc vesa = CRTCin(par, 0x1a) & ~0xc0; /* sync on/off */ NVTRACE_ENTER(); - if (blank) { + + if (blank) tmp |= 0x20; - switch (blank - 1) { - case VESA_NO_BLANKING: - break; - case VESA_VSYNC_SUSPEND: - vesa |= 0x80; - break; - case VESA_HSYNC_SUSPEND: - vesa |= 0x40; - break; - case VESA_POWERDOWN: - vesa |= 0xc0; - break; - } + + switch (blank) { + case FB_BLANK_UNBLANK: + case FB_BLANK_NORMAL: + break; + case FB_BLANK_VSYNC_SUSPEND: + vesa |= 0x80; + break; + case FB_BLANK_HSYNC_SUSPEND: + vesa |= 0x40; + break; + case FB_BLANK_POWERDOWN: + vesa |= 0xc0; + break; } + SEQout(par, 0x01, tmp); CRTCout(par, 0x1a, vesa); @@ -1266,6 +1269,7 @@ static int rivafb_blank(int blank, struc #endif NVTRACE_LEAVE(); + return 0; } diff -puN drivers/video/sa1100fb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/sa1100fb.c --- 25/drivers/video/sa1100fb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.516920112 -0800 +++ 25-akpm/drivers/video/sa1100fb.c 2004-11-07 16:32:45.557913880 -0800 @@ -1061,9 +1061,10 @@ static int sa1100fb_blank(int blank, str DPRINTK("sa1100fb_blank: blank=%d\n", blank); switch (blank) { - case VESA_POWERDOWN: - case VESA_VSYNC_SUSPEND: - case VESA_HSYNC_SUSPEND: + case FB_BLANK_POWERDOWN: + case FB_BLANK_VSYNC_SUSPEND: + case FB_BLANK_HSYNC_SUSPEND: + case FB_BLANK_NORMAL: if (fbi->fb.fix.visual == FB_VISUAL_PSEUDOCOLOR || fbi->fb.fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR) for (i = 0; i < fbi->palette_size; i++) @@ -1071,7 +1072,7 @@ static int sa1100fb_blank(int blank, str sa1100fb_schedule_work(fbi, C_DISABLE); break; - case VESA_NO_BLANKING: + case FB_BLANK_UNBLANK: if (fbi->fb.fix.visual == FB_VISUAL_PSEUDOCOLOR || fbi->fb.fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR) fb_set_cmap(&fbi->fb.cmap, info); diff -puN drivers/video/tcx.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/tcx.c --- 25/drivers/video/tcx.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.517919960 -0800 +++ 25-akpm/drivers/video/tcx.c 2004-11-07 16:32:45.558913728 -0800 @@ -207,26 +207,26 @@ tcx_blank(int blank, struct fb_info *inf val = sbus_readl(&thc->thc_misc); switch (blank) { - case 0: /* Unblanking */ + case FB_BLAnK_UNBLANK: /* Unblanking */ val &= ~(TCX_THC_MISC_VSYNC_DIS | TCX_THC_MISC_HSYNC_DIS); val |= TCX_THC_MISC_VIDEO; par->flags &= ~TCX_FLAG_BLANKED; break; - case 1: /* Normal blanking */ + case FB_BLANK_NORMAL: /* Normal blanking */ val &= ~TCX_THC_MISC_VIDEO; par->flags |= TCX_FLAG_BLANKED; break; - case 2: /* VESA blank (vsync off) */ + case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */ val |= TCX_THC_MISC_VSYNC_DIS; break; - case 3: /* VESA blank (hsync off) */ + case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */ val |= TCX_THC_MISC_HSYNC_DIS; break; - case 4: /* Poweroff */ + case FB_BLANK_POWERDOWN: /* Poweroff */ break; }; diff -puN drivers/video/tdfxfb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/tdfxfb.c --- 25/drivers/video/tdfxfb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.519919656 -0800 +++ 25-akpm/drivers/video/tdfxfb.c 2004-11-07 16:32:45.559913576 -0800 @@ -837,23 +837,23 @@ static int tdfxfb_blank(int blank, struc dacmode = tdfx_inl(par, DACMODE); switch (blank) { - case 0: /* Screen: On; HSync: On, VSync: On */ + case FB_BLANK_UNBLANK: /* Screen: On; HSync: On, VSync: On */ state = 0; vgablank = 0; break; - case 1: /* Screen: Off; HSync: On, VSync: On */ + case FB_BLANK_NORMAL: /* Screen: Off; HSync: On, VSync: On */ state = 0; vgablank = 1; break; - case 2: /* Screen: Off; HSync: On, VSync: Off */ + case FB_BLANK_VSYNC_SUSPEND: /* Screen: Off; HSync: On, VSync: Off */ state = BIT(3); vgablank = 1; break; - case 3: /* Screen: Off; HSync: Off, VSync: On */ + case FB_BLANK_HSYNC_SUSPEND: /* Screen: Off; HSync: Off, VSync: On */ state = BIT(1); vgablank = 1; break; - case 4: /* Screen: Off; HSync: Off, VSync: Off */ + case FB_BLANK_POWERDOWN: /* Screen: Off; HSync: Off, VSync: Off */ state = BIT(1) | BIT(3); vgablank = 1; break; diff -puN drivers/video/tgafb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/tgafb.c --- 25/drivers/video/tgafb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.520919504 -0800 +++ 25-akpm/drivers/video/tgafb.c 2004-11-07 16:32:45.560913424 -0800 @@ -468,7 +468,7 @@ tgafb_blank(int blank, struct fb_info *i vvvr &= ~(TGA_VALID_VIDEO | TGA_VALID_BLANK); switch (blank) { - case 0: /* Unblanking */ + case FB_BLANK_UNBLANK: /* Unblanking */ if (par->vesa_blanked) { TGA_WRITE_REG(par, vhcr & 0xbfffffff, TGA_HORIZ_REG); TGA_WRITE_REG(par, vvcr & 0xbfffffff, TGA_VERT_REG); @@ -477,24 +477,24 @@ tgafb_blank(int blank, struct fb_info *i TGA_WRITE_REG(par, vvvr | TGA_VALID_VIDEO, TGA_VALID_REG); break; - case 1: /* Normal blanking */ + case FB_BLANK_NORMAL: /* Normal blanking */ TGA_WRITE_REG(par, vvvr | TGA_VALID_VIDEO | TGA_VALID_BLANK, TGA_VALID_REG); break; - case 2: /* VESA blank (vsync off) */ + case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */ TGA_WRITE_REG(par, vvcr | 0x40000000, TGA_VERT_REG); TGA_WRITE_REG(par, vvvr | TGA_VALID_BLANK, TGA_VALID_REG); par->vesa_blanked = 1; break; - case 3: /* VESA blank (hsync off) */ + case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */ TGA_WRITE_REG(par, vhcr | 0x40000000, TGA_HORIZ_REG); TGA_WRITE_REG(par, vvvr | TGA_VALID_BLANK, TGA_VALID_REG); par->vesa_blanked = 1; break; - case 4: /* Poweroff */ + case FB_BLANK_POWERDOWN: /* Poweroff */ TGA_WRITE_REG(par, vhcr | 0x40000000, TGA_HORIZ_REG); TGA_WRITE_REG(par, vvcr | 0x40000000, TGA_VERT_REG); TGA_WRITE_REG(par, vvvr | TGA_VALID_BLANK, TGA_VALID_REG); diff -puN drivers/video/tridentfb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/tridentfb.c --- 25/drivers/video/tridentfb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.522919200 -0800 +++ 25-akpm/drivers/video/tridentfb.c 2004-11-07 16:32:45.561913272 -0800 @@ -1017,22 +1017,24 @@ static int tridentfb_blank(int blank_mod DPMSCont = read3CE(PowerStatus) & 0xFC; switch (blank_mode) { - case VESA_NO_BLANKING: + case FB_BLANK_UNBLANK: /* Screen: On, HSync: On, VSync: On */ + case FB_BLANK_NORMAL: + /* Screen: Off, HSync: On, VSync: On */ PMCont |= 0x03; DPMSCont |= 0x00; break; - case VESA_HSYNC_SUSPEND: + case FB_BLANK_HSYNC_SUSPEND: /* Screen: Off, HSync: Off, VSync: On */ PMCont |= 0x02; DPMSCont |= 0x01; break; - case VESA_VSYNC_SUSPEND: + case FB_BLANK_VSYNC_SUSPEND: /* Screen: Off, HSync: On, VSync: Off */ PMCont |= 0x02; DPMSCont |= 0x02; break; - case VESA_POWERDOWN: + case FB_BLANK_POWERDOWN: /* Screen: Off, HSync: Off, VSync: Off */ PMCont |= 0x00; DPMSCont |= 0x03; @@ -1044,7 +1046,9 @@ static int tridentfb_blank(int blank_mod t_outb(PMCont,0x83C6); debug("exit\n"); - return 0; + + /* let fbcon do a softblank for us */ + return (blank_mode == FB_BLANK_NORMAL) ? 1 : 0; } static int __devinit trident_pci_probe(struct pci_dev * dev, const struct pci_device_id * id) diff -puN drivers/video/valkyriefb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/valkyriefb.c --- 25/drivers/video/valkyriefb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.523919048 -0800 +++ 25-akpm/drivers/video/valkyriefb.c 2004-11-07 16:32:45.562913120 -0800 @@ -207,13 +207,13 @@ static int valkyriefb_blank(int blank_mo return 1; switch (blank_mode) { - case 0: /* unblank */ + case FB_BLANK_UNBLANK: /* unblank */ out_8(&p->valkyrie_regs->mode.r, init->mode); break; - case 1: + case FB_BLANK_NORMAL: return 1; /* get caller to set CLUT to all black */ - case VESA_VSYNC_SUSPEND+1: - case VESA_HSYNC_SUSPEND+1: + case FB_BLANK_VSYNC_SUSPEND: + case FB_BLANK_HSYNC_SUSPEND: /* * [kps] Value extracted from MacOS. I don't know * whether this bit disables hsync or vsync, or @@ -221,7 +221,7 @@ static int valkyriefb_blank(int blank_mo */ out_8(&p->valkyrie_regs->mode.r, init->mode | 0x40); break; - case VESA_POWERDOWN+1: + case FB_BLANK_POWERDOWN: out_8(&p->valkyrie_regs->mode.r, 0x66); break; } diff -puN drivers/video/vga16fb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants drivers/video/vga16fb.c --- 25/drivers/video/vga16fb.c~fbdev-convert-drivers-to-use-the-new-fb_blank_-constants 2004-11-07 16:32:45.525918744 -0800 +++ 25-akpm/drivers/video/vga16fb.c 2004-11-07 16:32:45.563912968 -0800 @@ -771,7 +771,7 @@ static void vga_vesa_blank(struct vga16f * to maximum (incl. overflow) * Result: turn off vertical sync (VSync) pulse. */ - if (mode & VESA_VSYNC_SUSPEND) { + if (mode & FB_BLANK_VSYNC_SUSPEND) { outb_p(0x10,vga_video_port_reg); /* StartVertRetrace */ outb_p(0xff,vga_video_port_val); /* maximum value */ outb_p(0x11,vga_video_port_reg); /* EndVertRetrace */ @@ -780,7 +780,7 @@ static void vga_vesa_blank(struct vga16f outb_p(par->vga_state.Overflow | 0x84,vga_video_port_val); /* bits 9,10 of vert. retrace */ } - if (mode & VESA_HSYNC_SUSPEND) { + if (mode & FB_BLANK_HSYNC_SUSPEND) { /* * Set to minimum (0) and * to maximum @@ -853,7 +853,7 @@ static int vga16fb_blank(int blank, stru struct vga16fb_par *par = (struct vga16fb_par *) info->par; switch (blank) { - case 0: /* Unblank */ + case FB_BLANK_UNBLANK: /* Unblank */ if (par->vesa_blanked) { vga_vesa_unblank(par); par->vesa_blanked = 0; @@ -862,12 +862,12 @@ static int vga16fb_blank(int blank, stru par->palette_blanked = 0; } break; - case 1: /* blank */ + case FB_BLANK_NORMAL: /* blank */ vga_pal_blank(); par->palette_blanked = 1; break; default: /* VESA blanking */ - vga_vesa_blank(par, blank-1); + vga_vesa_blank(par, blank); par->vesa_blanked = 1; break; } _