aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/aty/aty128fb.c
diff options
context:
space:
mode:
authorWitold Filipczyk <witekfl@poczta.onet.pl>2007-05-08 03:37:07 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:15:25 -0400
commit125e1137cd2d93377028f521801d916729485733 (patch)
treee7cc2bc82c19d760dad61d1dfbee515c668449d8 /drivers/video/aty/aty128fb.c
parentc8e1693a4f63e317966f3dfe8f815eda95e26610 (diff)
aty128fb: fix blanking
I have a problem with blanking. The soundcard uses speakers of the monitor. Sound is muted when the screen blanks due to a bug in aty128fb.c. Here is a fragment of linux/fb.h /* VESA Blanking Levels */ #define VESA_NO_BLANKING 0 #define VESA_VSYNC_SUSPEND 1 #define VESA_HSYNC_SUSPEND 2 #define VESA_POWERDOWN 3 enum { /* screen: unblanked, hsync: on, vsync: on */ FB_BLANK_UNBLANK = VESA_NO_BLANKING, /* screen: blanked, hsync: on, vsync: on */ FB_BLANK_NORMAL = VESA_NO_BLANKING + 1, /* screen: blanked, hsync: on, vsync: off */ FB_BLANK_VSYNC_SUSPEND = VESA_VSYNC_SUSPEND + 1, /* screen: blanked, hsync: off, vsync: on */ FB_BLANK_HSYNC_SUSPEND = VESA_HSYNC_SUSPEND + 1, /* screen: blanked, hsync: off, vsync: off */ FB_BLANK_POWERDOWN = VESA_POWERDOWN + 1 }; So FB_BLANK_NORMAL is 1, FB_BLANK_VSYNC_SUSPEND is 2, FB_BLANK_HSYNC_SUSPEND is 3, FB_BLANK_POWERDOWN is 4. And now: blank = FB_BLANK_NORMAL (1) blank & FB_BLANK_HSYNC_SUSPEND (1 & 3) is true, so normal blank caused hsync suspend and sound is muted. Cc: James Simmons <jsimmons@infradead.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/aty/aty128fb.c')
-rw-r--r--drivers/video/aty/aty128fb.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index e86d7e0c9825..7fea4d8ae8e2 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -2165,18 +2165,29 @@ static void __devexit aty128_remove(struct pci_dev *pdev)
2165static int aty128fb_blank(int blank, struct fb_info *fb) 2165static int aty128fb_blank(int blank, struct fb_info *fb)
2166{ 2166{
2167 struct aty128fb_par *par = fb->par; 2167 struct aty128fb_par *par = fb->par;
2168 u8 state = 0; 2168 u8 state;
2169 2169
2170 if (par->lock_blank || par->asleep) 2170 if (par->lock_blank || par->asleep)
2171 return 0; 2171 return 0;
2172 2172
2173 if (blank & FB_BLANK_VSYNC_SUSPEND) 2173 switch (blank) {
2174 state |= 2; 2174 case FB_BLANK_NORMAL:
2175 if (blank & FB_BLANK_HSYNC_SUSPEND) 2175 state = 4;
2176 state |= 1; 2176 break;
2177 if (blank & FB_BLANK_POWERDOWN) 2177 case FB_BLANK_VSYNC_SUSPEND:
2178 state |= 4; 2178 state = 6;
2179 2179 break;
2180 case FB_BLANK_HSYNC_SUSPEND:
2181 state = 5;
2182 break;
2183 case FB_BLANK_POWERDOWN:
2184 state = 7;
2185 break;
2186 case FB_BLANK_UNBLANK:
2187 default:
2188 state = 0;
2189 break;
2190 }
2180 aty_st_8(CRTC_EXT_CNTL+1, state); 2191 aty_st_8(CRTC_EXT_CNTL+1, state);
2181 2192
2182 if (par->chip_gen == rage_M3) { 2193 if (par->chip_gen == rage_M3) {
@@ -2430,7 +2441,7 @@ static int aty128_pci_suspend(struct pci_dev *pdev, pm_message_t state)
2430 wait_for_idle(par); 2441 wait_for_idle(par);
2431 2442
2432 /* Blank display and LCD */ 2443 /* Blank display and LCD */
2433 aty128fb_blank(VESA_POWERDOWN, info); 2444 aty128fb_blank(FB_BLANK_POWERDOWN, info);
2434 2445
2435 /* Sleep */ 2446 /* Sleep */
2436 par->asleep = 1; 2447 par->asleep = 1;