Subject: Re: tga2 + X
To: Johan Danielsson <>
From: R. C. Dowdeswell <>
List: port-alpha
Date: 10/12/2000 01:53:13
On 971334862 seconds since the Beginning of the UNIX epoch
Johan Danielsson wrote:
>To follow up on this old thread, I decided to dig some more into this.
>I noticed that a gdb backtrace showed a NULL getting passed to
>tga_intr, so I put a ddb breakpoint in that function to see when this
>happened. Which it didn't. An added assert at the start of that
>function gave nothing either (except the usual memory management
>traps). What does the trick is a printf in that function. This leads
>me to believe that the problem is timing related.
>How can I debug this further?

Try the attached patch.  I'm a bit tired, and will continue to look
at it, but it occurs to me that I probably need a spltty() in the
code right around there.  There may be additional problems and
I'll scan around for them soon.

>A related problem is with the Xserver itself. It seems to behave badly
>when moving windows, best described by the image at
>This is the result of moving the xterm window down; moving it
>horizontally doesn't seem to have this effect.

Have you tried running the Xserver with the -noaccel option to see if this
is being caused by the accelerations?  This would help track down the bug
a bit.


 == Roland Dowdeswell                      http://www.Imrryr.ORG/~elric/  ==
 == The Unofficial NetBSD Web Pages        http://www.Imrryr.ORG/NetBSD/  ==
 == The NetBSD Project                            http://www.NetBSD.ORG/  ==

Index: tga.c
RCS file: /cvsroot/syssrc/sys/dev/pci/tga.c,v
retrieving revision 1.26
diff -u -r1.26 tga.c
--- tga.c	2000/06/26 04:56:25	1.26
+++ tga.c	2000/10/12 08:47:10
@@ -551,11 +551,14 @@
 	void	(*f) __P((void *));
 	struct tga_devconfig *dc = v;
+	int s;
 	if (dc->dc_intrenabled) {
 		/* Arrange for f to be called at the next end-of-frame interrupt */
+		s = spltty();
 		dc->dc_ramdac_intr = f;
 		TGAWREG(dc, TGA_REG_SISR, 0x00010000);
+		splx(s);
 	} else {
 		/* Spin until the end-of-frame, then call f */
 		TGAWREG(dc, TGA_REG_SISR, 0x00010001);