9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] GeForece4 MX (Inno3D Tornedo)
@ 2003-04-15  7:25 okamoto
  2003-04-15  8:34 ` okamoto
  0 siblings, 1 reply; 6+ messages in thread
From: okamoto @ 2003-04-15  7:25 UTC (permalink / raw)
  To: 9fans

Hi,

I'm trying to use a GeForce 4 MX 440 (did=0x171) card, and
have problem.

New vgabvidia.c detects this GeForece 4 card successfully,
and run rio etc in a sence.

When I run it, my display (1376x1024x32, mf5421) shows
a smaller two separate window horizontally.   Vertically, it's
normal.   I think I'm using wrong horizontal timing, however,
how I can fix this?   Itried to tune the display's control panel,
but it's beyond the control range.

Below is a small fix to /sys/src/9/pc/vganvidia.c to avoid
strange cursor shape for this card.   I'd be happy if it could
be included in the source tree.

Kenji

------------cut here-----------
static void
nvidiacurload(VGAscr* scr, Cursor* curs)
{
	ulong*	p;
	int		i,j;
	ushort	c,s;
	ulong	tmp;
	Pcidev *pd;			/* K.Okamoto for Geforece4 MX */

	if(scr->io == 0)
		return;

	vgaxo(Crtx, 0x31, vgaxi(Crtx, 0x31) & ~0x01);

	p = KADDR(scr->io + hwCurImage);

	for(i=0; i<16; i++) {
		pd = nvidiapci();
		if(pd->did == 0x171) {	/* for Geforece4 MX bug, K.Okamoto */
			c = (curs->clr[2 * i+1] << 8) | curs->clr[2 * i];
			s = (curs->set[2 * i+1] << 8) | curs->set[2 * i];
		} else {
			c = (curs->clr[2 * i] << 8) | curs->clr[2 * i+1];
			s = (curs->set[2 * i] << 8) | curs->set[2 * i+1];
		}
		tmp = 0;
		for (j=0; j<16; j++){
			if(s&0x8000)
				tmp |= 0x80000000;
			else if(c&0x8000)
				tmp |= 0xFFFF0000;
			if (j&0x1){
				*p++ = tmp;
				tmp = 0;
			} else {
				tmp>>=16;
			}
			c<<=1;
			s<<=1;
		}
		for (j=0; j<8; j++)
			*p++ = 0;
	}
	for (i=0; i<256; i++)
		*p++ = 0;

	scr->offset = curs->offset;
	vgaxo(Crtx, 0x31, vgaxi(Crtx, 0x31) | 0x01);

	return;
}

------cut here------



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

* Re: [9fans] GeForece4 MX (Inno3D Tornedo)
  2003-04-15  7:25 [9fans] GeForece4 MX (Inno3D Tornedo) okamoto
@ 2003-04-15  8:34 ` okamoto
  2003-04-15  9:59   ` okamoto
  0 siblings, 1 reply; 6+ messages in thread
From: okamoto @ 2003-04-15  8:34 UTC (permalink / raw)
  To: 9fans

> When I run it, my display (1376x1024x32, mf5421) shows
> a smaller two separate window horizontally.   Vertically, it's
> normal.

I meant half font size in horizontal, and normal size in vertical.
It looks like window is compressed to 1/2 size horizontally,
and then, I see two windows side by side horizonttally.

Kenji



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

* Re: [9fans] GeForece4 MX (Inno3D Tornedo)
  2003-04-15  8:34 ` okamoto
@ 2003-04-15  9:59   ` okamoto
  2003-04-15 15:23     ` Russ Cox
  0 siblings, 1 reply; 6+ messages in thread
From: okamoto @ 2003-04-15  9:59 UTC (permalink / raw)
  To: 9fans

> I meant half font size in horizontal, and normal size in vertical.
> It looks like window is compressed to 1/2 size horizontally,
> and then, I see two windows side by side horizonttally.

This was solved by a small change to the snarf() function in
/sys/src/cmd/aux/vga/nvidia.c by adding three lines as follows:

static void
snarf(Vga* vga, Ctlr* ctlr)
{
	Nvidia *nv;
	Pcidev *p;
	ulong m, *mmio, tmp;
	int i;

	if(vga->private == nil){

..............

	/*
	 * Unlock
	 */
	vgaxo(Crtx, 0x1F, 0x57);

	if (nv->pextdev[0x00000000] & 0x00000040){
		nv->crystalfreq = RefFreq;
		vga->m[1] = 14;
	} else {
		nv->crystalfreq = 13500000;
		vga->m[1] = 13;
	}

>	if(nv->pci->did == 0x171)
>		if(nv->pextdev[0x00000000] & (1 << 22))
>			nv->crystalfreq = 27000000;

	if (nv->arch == 4) {
		tmp = nv->pfb[0x00000000];
		if (tmp & 0x0100) {
			vga->vmz = ((tmp >> 12) & 0x0F) * 1024 + 1024 * 2;
		} else {
			tmp &= 0x03;
			if (tmp)
				vga->vmz = (1024*1024*2) << tmp;
			else
				vga->vmz = 1024*1024*32;
		}
	}
.................

}


Kenji



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

* Re: [9fans] GeForece4 MX (Inno3D Tornedo)
  2003-04-15  9:59   ` okamoto
@ 2003-04-15 15:23     ` Russ Cox
  2003-04-16  0:50       ` okamoto
  0 siblings, 1 reply; 6+ messages in thread
From: Russ Cox @ 2003-04-15 15:23 UTC (permalink / raw)
  To: 9fans

Do you have a bigger monitor?  I'd be interested to know
if the higher resolution modes work at all for you.

I tried a 0x0181 card recently and just could not get
it to do anything >= 1280x1024.  I made the clock
frequency change, but that wasn't enough.  It was as
though the "I am a mode < 1280 pixels wide" bit (0x04
in CRT 0x1A) was set, even though it was very clearly not set:
I could run in 1268x1024 just fine, but pushing it up to 1280
broke things.  Modes like 1600x1200 just gave completely
blank screens.

I traced through the VGA BIOS initializing the card
and still couldn't figure out what was going on in the
1280x1024 case.  The BIOS did not give 1600x1200 as a
mode option, though 1400x1050 was (and didn't shed any
light on the subject).  This was all in digital mode.

Finally I rewrote the driver to be almost exactly like
the XFree86 driver (even closer than the current one)
and then nothing worked, presumably because of some
bugs I introduced but didn't track down.  At this point
a week had gone by, and I gave up, threw out all the code
I'd changed, and just used VMware.  So much for Nvidia's
great backwards compatibility.

Sigh.



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

* Re: [9fans] GeForece4 MX (Inno3D Tornedo)
  2003-04-15 15:23     ` Russ Cox
@ 2003-04-16  0:50       ` okamoto
  2003-04-16  1:36         ` okamoto
  0 siblings, 1 reply; 6+ messages in thread
From: okamoto @ 2003-04-16  0:50 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 418 bytes --]

I have two kinds of Nvidia cards, one is GeForece2 MX200(32MB), and
the other is GeForece4 MX(64MB), the latter of which was the card I
reported problem and solution.   For Geforece2 cards we have no
problem up to 1600x1200x32 to run with your new driver, which
recognizes the nvidia cards automatically.   In the case of our GeForce4
card, I think the problem was caused by the bug of the card itself.

Kenji

[-- Attachment #2: Type: message/rfc822, Size: 2866 bytes --]

From: "Russ Cox" <rsc@plan9.bell-labs.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] GeForece4 MX (Inno3D Tornedo)
Date: Tue, 15 Apr 2003 11:23:28 -0400
Message-ID: <2479282393cac7dbc85ee9dc2b22d590@plan9.bell-labs.com>

Do you have a bigger monitor?  I'd be interested to know
if the higher resolution modes work at all for you.

I tried a 0x0181 card recently and just could not get
it to do anything >= 1280x1024.  I made the clock
frequency change, but that wasn't enough.  It was as
though the "I am a mode < 1280 pixels wide" bit (0x04
in CRT 0x1A) was set, even though it was very clearly not set:
I could run in 1268x1024 just fine, but pushing it up to 1280
broke things.  Modes like 1600x1200 just gave completely
blank screens.

I traced through the VGA BIOS initializing the card
and still couldn't figure out what was going on in the
1280x1024 case.  The BIOS did not give 1600x1200 as a
mode option, though 1400x1050 was (and didn't shed any
light on the subject).  This was all in digital mode.

Finally I rewrote the driver to be almost exactly like
the XFree86 driver (even closer than the current one)
and then nothing worked, presumably because of some
bugs I introduced but didn't track down.  At this point
a week had gone by, and I gave up, threw out all the code
I'd changed, and just used VMware.  So much for Nvidia's
great backwards compatibility.

Sigh.

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

* Re: [9fans] GeForece4 MX (Inno3D Tornedo)
  2003-04-16  0:50       ` okamoto
@ 2003-04-16  1:36         ` okamoto
  0 siblings, 0 replies; 6+ messages in thread
From: okamoto @ 2003-04-16  1:36 UTC (permalink / raw)
  To: 9fans

> I have two kinds of Nvidia cards, one is GeForece2 MX200(32MB), and
> the other is GeForece4 MX(64MB),

More precisely, GeForce4 MX-440(64MB, Inno3D Tornado), and
device id = 0x171.

kenji



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

end of thread, other threads:[~2003-04-16  1:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-15  7:25 [9fans] GeForece4 MX (Inno3D Tornedo) okamoto
2003-04-15  8:34 ` okamoto
2003-04-15  9:59   ` okamoto
2003-04-15 15:23     ` Russ Cox
2003-04-16  0:50       ` okamoto
2003-04-16  1:36         ` okamoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).