Commit 104b198d authored by Jordan Crouse's avatar Jordan Crouse Committed by Linus Torvalds

lxfb: fix console blanking

Simply enabling DAC blanking without turning off the CRT seems to be resulting
in characters remaining on the screen when the monitor blanks.  This patch
turns off the CRT for all modes, and also powers down the DACs when vsync
and/or hsync are disabled.
Signed-off-by: default avatarJordan Crouse <jordan.crouse@amd.com>
Acked-by: default avatarAndres Salomon <dilinger@debian.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent be935d5b
...@@ -517,25 +517,25 @@ void lx_set_palette_reg(struct fb_info *info, unsigned regno, ...@@ -517,25 +517,25 @@ void lx_set_palette_reg(struct fb_info *info, unsigned regno,
int lx_blank_display(struct fb_info *info, int blank_mode) int lx_blank_display(struct fb_info *info, int blank_mode)
{ {
struct lxfb_par *par = info->par; struct lxfb_par *par = info->par;
u32 dcfg, fp_pm; u32 dcfg, misc, fp_pm;
int blank, hsync, vsync, crt; int blank, hsync, vsync;
/* CRT power saving modes. */ /* CRT power saving modes. */
switch (blank_mode) { switch (blank_mode) {
case FB_BLANK_UNBLANK: case FB_BLANK_UNBLANK:
blank = 0; hsync = 1; vsync = 1; crt = 1; blank = 0; hsync = 1; vsync = 1;
break; break;
case FB_BLANK_NORMAL: case FB_BLANK_NORMAL:
blank = 1; hsync = 1; vsync = 1; crt = 1; blank = 1; hsync = 1; vsync = 1;
break; break;
case FB_BLANK_VSYNC_SUSPEND: case FB_BLANK_VSYNC_SUSPEND:
blank = 1; hsync = 1; vsync = 0; crt = 1; blank = 1; hsync = 1; vsync = 0;
break; break;
case FB_BLANK_HSYNC_SUSPEND: case FB_BLANK_HSYNC_SUSPEND:
blank = 1; hsync = 0; vsync = 1; crt = 1; blank = 1; hsync = 0; vsync = 1;
break; break;
case FB_BLANK_POWERDOWN: case FB_BLANK_POWERDOWN:
blank = 1; hsync = 0; vsync = 0; crt = 0; blank = 1; hsync = 0; vsync = 0;
break; break;
default: default:
return -EINVAL; return -EINVAL;
...@@ -545,15 +545,23 @@ int lx_blank_display(struct fb_info *info, int blank_mode) ...@@ -545,15 +545,23 @@ int lx_blank_display(struct fb_info *info, int blank_mode)
dcfg &= ~(VP_DCFG_DAC_BL_EN | VP_DCFG_HSYNC_EN | VP_DCFG_VSYNC_EN | dcfg &= ~(VP_DCFG_DAC_BL_EN | VP_DCFG_HSYNC_EN | VP_DCFG_VSYNC_EN |
VP_DCFG_CRT_EN); VP_DCFG_CRT_EN);
if (!blank) if (!blank)
dcfg |= VP_DCFG_DAC_BL_EN; dcfg |= VP_DCFG_DAC_BL_EN | VP_DCFG_CRT_EN;
if (hsync) if (hsync)
dcfg |= VP_DCFG_HSYNC_EN; dcfg |= VP_DCFG_HSYNC_EN;
if (vsync) if (vsync)
dcfg |= VP_DCFG_VSYNC_EN; dcfg |= VP_DCFG_VSYNC_EN;
if (crt)
dcfg |= VP_DCFG_CRT_EN;
write_vp(par, VP_DCFG, dcfg); write_vp(par, VP_DCFG, dcfg);
misc = read_vp(par, VP_MISC);
if (vsync && hsync)
misc &= ~VP_MISC_DACPWRDN;
else
misc |= VP_MISC_DACPWRDN;
write_vp(par, VP_MISC, misc);
/* Power on/off flat panel */ /* Power on/off flat panel */
if (par->output & OUTPUT_PANEL) { if (par->output & OUTPUT_PANEL) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment