From: "B. James Phillippe" <bryan@terran.org>
To: RedHat AXP list <axp-list@redhat.com>
Subject: [PATCH] TGA framebuffer VESA blank support
Date: Sat, 21 Nov 1998 21:05:53 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.04.9811212059130.6892-200000@earth.terran.org> (raw)
[-- Attachment #1: Type: TEXT/PLAIN, Size: 541 bytes --]
Hello,
Enclosed is a patch relative to 2.1.128 (should apply to .129 also,
I would imagine) which adds VESA powersave blanking support to the TGA
framebuffer driver. I have tested it on my Mustang (Avanti) with ZLXp-E2
with success. If anyone would like to test it out, I would greatly
appreciate hearing the results.
thanks,
-bp
--
B. James Phillippe . bryan@terran.org
UNIX Software Engineer . http://www.terran.org/~bryan
Member since 1.1.59 . finger:bryan@earth.terran.org
MOTM: US West is the worst telco company I have ever known
[-- Attachment #2: tgafb.diff --]
[-- Type: TEXT/PLAIN, Size: 2220 bytes --]
--- drivers/video/tgafb.c.orig Sat Nov 14 00:23:43 1998
+++ drivers/video/tgafb.c Fri Nov 20 12:09:14 1998
@@ -803,13 +803,69 @@
static void tgafbcon_blank(int blank, struct fb_info *info)
{
- /* Should also do stuff here for vesa blanking -tor */
+ static int tga_vesa_blanked = 0;
+ u32 vhcr, vvcr;
+ unsigned long flags;
+
+ save_flags(flags);
+ cli();
- if (blank > 0) {
+ vhcr = TGA_READ_REG(TGA_HORIZ_REG);
+ vvcr = TGA_READ_REG(TGA_VERT_REG);
+
+ switch( blank ) {
+ case 0: /* VESA unblanking */
+ if( tga_vesa_blanked ) {
+#ifdef DEBUG
+ printk( KERN_INFO "tgafb: VESA unblank\n" );
+#endif /* DEBUG */
+ TGA_WRITE_REG(vhcr & 0xbfffffff, TGA_HORIZ_REG);
+ TGA_WRITE_REG(vvcr & 0xbfffffff, TGA_VERT_REG);
+ tga_vesa_blanked = 0;
+ }
+ TGA_WRITE_REG(0x01, TGA_VALID_REG); /* SCANNING */
+ break;
+
+ case 1: /* Normal blanking */
TGA_WRITE_REG(0x03, TGA_VALID_REG); /* SCANNING and BLANK */
- } else {
- TGA_WRITE_REG(0x01, TGA_VALID_REG); /* SCANNING */
+ break;
+
+ case 2: /* VESA blank (vsync off) */
+#ifdef DEBUG
+ printk( KERN_INFO "tgafb: VESA suspend (vsync)\n" );
+#endif /* DEBUG */
+ TGA_WRITE_REG(vvcr | 0x40000000, TGA_VERT_REG);
+ TGA_WRITE_REG(0x02, TGA_VALID_REG); /* BLANK */
+ tga_vesa_blanked = 1;
+ break;
+
+ case 3: /* VESA blank (hsync off) */
+#ifdef DEBUG
+ printk( KERN_INFO "tgafb: VESA suspend (hsync)\n" );
+#endif /* DEBUG */
+ TGA_WRITE_REG(vhcr | 0x40000000, TGA_HORIZ_REG);
+ TGA_WRITE_REG(0x02, TGA_VALID_REG); /* BLANK */
+ tga_vesa_blanked = 1;
+ break;
+
+ case 4: /* Poweroff */
+#ifdef DEBUG
+ printk( KERN_INFO "tgafb: VESA powerdown\n" );
+#endif /* DEBUG */
+ TGA_WRITE_REG(vhcr | 0x40000000, TGA_HORIZ_REG);
+ TGA_WRITE_REG(vvcr | 0x40000000, TGA_VERT_REG);
+ TGA_WRITE_REG(0x02, TGA_VALID_REG); /* BLANK */
+ tga_vesa_blanked = 1;
+ break;
}
+
+ restore_flags(flags);
+
+#ifdef DEBUG
+ printk( KERN_INFO "tgafb pre h %#08x v %#08x\n", vhcr, vvcr );
+ printk( KERN_INFO "tgafb post h %#08lx v %#08lx\n",
+ TGA_READ_REG(TGA_HORIZ_REG), TGA_READ_REG(TGA_VERT_REG));
+#endif /* DEBUG */
}
/*
reply other threads:[~1998-11-22 5:05 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox