2004-10-29 01:18:08

by Mark Fortescue

[permalink] [raw]
Subject: PATCH to fix initialisation issue for GC3 (linux-2.5.64 +).

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 <[email protected]>
#
# 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);
--------------------------------------------------------------------------


2004-10-29 01:19:04

by William Lee Irwin III

[permalink] [raw]
Subject: Re: PATCH to fix initialisation issue for GC3 (linux-2.5.64 +).

On Fri, Oct 29, 2004 at 01:27:51AM +0100, Mark Fortescue wrote:
> 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.

Yes, all my systems are headless unfortunately.


-- wli

2004-10-29 03:51:59

by Lee Revell

[permalink] [raw]
Subject: Re: PATCH to fix initialisation issue for GC3 (linux-2.5.64 +).

On Thu, 2004-10-28 at 17:34 -0700, William Lee Irwin III wrote:
> Yes, all my systems are headless unfortunately.

*All* of them? I am impressed...

Lee

2004-10-29 03:56:12

by William Lee Irwin III

[permalink] [raw]
Subject: Re: PATCH to fix initialisation issue for GC3 (linux-2.5.64 +).

On Thu, 2004-10-28 at 17:34 -0700, William Lee Irwin III wrote:
>> Yes, all my systems are headless unfortunately.

On Thu, Oct 28, 2004 at 11:51:32PM -0400, Lee Revell wrote:
> *All* of them? I am impressed...

All of the UltraSPARC and SPARC systems, yes.


-- wli