All of lore.kernel.org
 help / color / mirror / Atom feed
* PATCH to fix initialisation issue for GC3 (linux-2.5.64 +).
@ 2004-10-29  0:27 ` Mark Fortescue
  0 siblings, 0 replies; 11+ messages in thread
From: Mark Fortescue @ 2004-10-29  0:27 UTC (permalink / raw)
  To: davem, ecd, jj, anton, wli; +Cc: linux-kernel, sparclinux, ultralinux, trivial

Hi All,

This patch fixes an error in the blanking code for the GCThree SBUS
video card. Now I get a logo and black screen, not just a blank (no
video) screen. It is a trivual fix that has taken too long to identify as
it is such a small typing error during the rewriting of the code for
the new frame buffer system introduced in the 2.5 series kernels.

Given that it still exists in the 2.6.8.1 kernel, I assume that not many
people have tried using the latest kernel on systems with a CGThree.
  
Regards
	Mark Fortescue.
------------------------------------------------------------------------
#######################################################################
#
# Mark Fortescue <mark@mtfhpc.demon.co.uk>
#
# Patch to fix the blanking on the CG3 (SBUS) video card.
# The file (formally cgthreefb.c, now cg3.c) has a typing error that
# messes up the card initialisation when blanking is enabled/disabled.
# Given that the blanking functions are called in the initialisation
# routine, this makes the card un-usable. This patch fixes the error
# and needs to be applied to all kernels from 2.5.64 to 2.8.6.1 and
# possibly later if the CG3 is to be used sucessfully. 
#
#######################################################################
diff -rupd ref-2.6.8.1/drivers/video/cg3.c linux-2.6.8.1/drivers/video/cg3.c
--- ref-2.6.8.1/drivers/video/cg3.c	Sat Aug 14 11:55:35 2004
+++ linux-2.6.8.1/drivers/video/cg3.c	Fri Oct 29 01:03:03 2004
@@ -198,9 +204,9 @@ cg3_blank(int blank, struct fb_info *inf
 
 	switch (blank) {
 	case 0: /* Unblanking */
-		val = sbus_readl(&regs->control);
+		val = sbus_readb(&regs->control);
 		val |= CG3_CR_ENABLE_VIDEO;
-		sbus_writel(val, &regs->control);
+		sbus_writeb(val, &regs->control);
 		par->flags &= ~CG3_FLAG_BLANKED;
 		break;
 
@@ -208,11 +214,16 @@ cg3_blank(int blank, struct fb_info *inf
 	case 2: /* VESA blank (vsync off) */
 	case 3: /* VESA blank (hsync off) */
 	case 4: /* Poweroff */
-		val = sbus_readl(&regs->control);
-		val |= CG3_CR_ENABLE_VIDEO;
-		sbus_writel(val, &regs->control);
+		val = sbus_readb(&regs->control);
+		val &= ~CG3_CR_ENABLE_VIDEO;
+		sbus_writeb(val, &regs->control);
 		par->flags |= CG3_FLAG_BLANKED;
 		break;
+
+	default:
+		printk ("Invalid Blanking mode (%d), unblanking\n", blank);
+		spin_unlock_irqrestore(&par->lock, flags);
+		return 1;
 	}
 
 	spin_unlock_irqrestore(&par->lock, flags);
--------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: PATCH to fix initialisation issue for GC3 (linux-2.5.64 +).
@ 2005-02-16 14:15 Meelis Roos
  2005-02-16 16:13 ` David S. Miller
  2005-02-16 16:27 ` Mark Fortescue
  0 siblings, 2 replies; 11+ messages in thread
From: Meelis Roos @ 2005-02-16 14:15 UTC (permalink / raw)
  To: sparclinux

MF> This patch fixes an error in the blanking code for the GCThree SBUS
MF> video card. Now I get a logo and black screen, not just a blank (no
MF> video) screen. It is a trivual fix that has taken too long to identify as
MF> it is such a small typing error during the rewriting of the code for
MF> the new frame buffer system introduced in the 2.5 series kernels.

The "val &= ~CG3_CR_ENABLE_VIDEO;" bit is in main kernel now. But what
about the readl/writel vs readb/writeb - is this also needed? Why?

-- 
Meelis Roos

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-02-16 16:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-29  0:27 PATCH to fix initialisation issue for GC3 (linux-2.5.64 +) Mark Fortescue
2004-10-29  0:27 ` Mark Fortescue
2004-10-29  0:34 ` William Lee Irwin III
2004-10-29  0:34   ` William Lee Irwin III
2004-10-29  3:51   ` Lee Revell
2004-10-29  3:51     ` Lee Revell
2004-10-29  3:55     ` William Lee Irwin III
2004-10-29  3:55       ` William Lee Irwin III
  -- strict thread matches above, loose matches on Subject: below --
2005-02-16 14:15 Meelis Roos
2005-02-16 16:13 ` David S. Miller
2005-02-16 16:27 ` Mark Fortescue

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.