linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvidiafb: Fix 6xxx/7xxx cards
@ 2005-12-07  8:33 Benjamin Herrenschmidt
  2005-12-08 20:54 ` Antonino A. Daplas
  0 siblings, 1 reply; 15+ messages in thread
From: Benjamin Herrenschmidt @ 2005-12-07  8:33 UTC (permalink / raw)
  To: Linux Fbdev development list; +Cc: Antonino A. Daplas, Andrew Morton

Recent X "nv" driver was fixed for various issues with modern 6xxx and
7xxx cards. This patch ports those fixes to nvidiafb. This makes it work
fine on the 6600 bundled with the newest G5 macs. I've verified it still
works on the 5200FX of the iMacG5.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Index: linux-work/drivers/video/nvidia/nv_hw.c
===================================================================
--- linux-work.orig/drivers/video/nvidia/nv_hw.c	2005-11-24 17:18:46.000000000 +1100
+++ linux-work/drivers/video/nvidia/nv_hw.c	2005-12-07 19:14:52.000000000 +1100
@@ -848,7 +848,7 @@ void NVCalcStateExt(struct nvidia_par *p
 		    int width,
 		    int hDisplaySize, int height, int dotClock, int flags)
 {
-	int pixelDepth, VClk;
+	int pixelDepth, VClk = 0;
 	/*
 	 * Save mode parameters.
 	 */
@@ -938,17 +938,26 @@ void NVLoadStateExt(struct nvidia_par *p
 
 	if (par->Architecture == NV_ARCH_04) {
 		NV_WR32(par->PFB, 0x0200, state->config);
-	} else if ((par->Chipset & 0xfff0) == 0x0090) {
-		for (i = 0; i < 15; i++) {
-			NV_WR32(par->PFB, 0x0600 + (i * 0x10), 0);
-			NV_WR32(par->PFB, 0x0604 + (i * 0x10), par->FbMapSize - 1);
-		}
-	} else {
+	} else if ((par->Architecture < NV_ARCH_40) ||
+		   (par->Chipset & 0xfff0) == 0x0040) {
 		for (i = 0; i < 8; i++) {
 			NV_WR32(par->PFB, 0x0240 + (i * 0x10), 0);
-			NV_WR32(par->PFB, 0x0244 + (i * 0x10), par->FbMapSize - 1);
+			NV_WR32(par->PFB, 0x0244 + (i * 0x10),
+				par->FbMapSize - 1);
 		}
-	}
+	} else {
+		int regions = 12;
+  	 
+		if (((par->Chipset & 0xfff0) == 0x0090) ||
+		    ((par->Chipset & 0xfff0) == 0x01D0) ||
+		    ((par->Chipset & 0xfff0) == 0x0290))
+			regions = 15;  	 
+		for(i = 0; i < regions; i++) {
+			NV_WR32(par->PFB, 0x0600 + (i * 0x10), 0);
+			NV_WR32(par->PFB, 0x0604 + (i * 0x10),
+				par->FbMapSize - 1);
+		}
+	} 
 
 	if (par->Architecture >= NV_ARCH_40) {
 		NV_WR32(par->PRAMIN, 0x0000 * 4, 0x80000010);
@@ -1182,11 +1191,17 @@ void NVLoadStateExt(struct nvidia_par *p
 			NV_WR32(par->PGRAPH, 0x0608, 0xFFFFFFFF);
 		} else {
 			if (par->Architecture >= NV_ARCH_40) {
+				u32 tmp;
+
 				NV_WR32(par->PGRAPH, 0x0084, 0x401287c0);
 				NV_WR32(par->PGRAPH, 0x008C, 0x60de8051);
 				NV_WR32(par->PGRAPH, 0x0090, 0x00008000);
 				NV_WR32(par->PGRAPH, 0x0610, 0x00be3c5f);
 
+				tmp = NV_RD32(par->REGS, 0x1540) & 0xff;
+				for(i = 0; tmp && !(tmp & 1); tmp >>= 1, i++);
+				NV_WR32(par->PGRAPH, 0x5000, i);
+ 
 				if ((par->Chipset & 0xfff0) == 0x0040) {
 					NV_WR32(par->PGRAPH, 0x09b0,
 						0x83280fff);
@@ -1211,6 +1226,7 @@ void NVLoadStateExt(struct nvidia_par *p
 						0xffff7fff);
 					break;
 				case 0x00C0:
+				case 0x0120:
 					NV_WR32(par->PGRAPH, 0x0828,
 						0x007596ff);
 					NV_WR32(par->PGRAPH, 0x082C,
@@ -1245,6 +1261,7 @@ void NVLoadStateExt(struct nvidia_par *p
 						0x00100000);
 					break;
 				case 0x0090:
+				case 0x0290:
 					NV_WR32(par->PRAMDAC, 0x0608,
 						NV_RD32(par->PRAMDAC, 0x0608) |
 						0x00100000);
@@ -1310,14 +1327,44 @@ void NVLoadStateExt(struct nvidia_par *p
 				}
 			}
 
-			if ((par->Chipset & 0xfff0) == 0x0090) {
-				for (i = 0; i < 60; i++)
-					NV_WR32(par->PGRAPH, 0x0D00 + i,
-						NV_RD32(par->PFB, 0x0600 + i));
+			if ((par->Architecture < NV_ARCH_40) ||
+			    ((par->Chipset & 0xfff0) == 0x0040)) {
+				for (i = 0; i < 32; i++) {
+					NV_WR32(par->PGRAPH, 0x0900 + i*4,
+						NV_RD32(par->PFB, 0x0240 +i*4));
+					NV_WR32(par->PGRAPH, 0x6900 + i*4,
+						NV_RD32(par->PFB, 0x0240 +i*4));
+				}
 			} else {
-				for (i = 0; i < 32; i++)
-					NV_WR32(par->PGRAPH, 0x0900 + i,
-						NV_RD32(par->PFB, 0x0240 + i));
+				if (((par->Chipset & 0xfff0) == 0x0090) ||
+				    ((par->Chipset & 0xfff0) == 0x01D0) ||
+				    ((par->Chipset & 0xfff0) == 0x0290)) {
+					for (i = 0; i < 60; i++) {
+						NV_WR32(par->PGRAPH,
+							0x0D00 + i*4,
+							NV_RD32(par->PFB,
+								0x0600 + i*4));
+						NV_WR32(par->PGRAPH,
+							0x6900 + i*4,
+							NV_RD32(par->PFB,
+								0x0600 + i*4));
+					}
+				} else {
+					for (i = 0; i < 48; i++) {
+						NV_WR32(par->PGRAPH,
+							0x0900 + i*4,
+							NV_RD32(par->PFB,
+								0x0600 + i*4));
+						if(((par->Chipset & 0xfff0)
+						    != 0x0160) &&
+						   ((par->Chipset & 0xfff0)
+						    != 0x0220))
+							NV_WR32(par->PGRAPH,
+								0x6900 + i*4,
+								NV_RD32(par->PFB,
+									0x0600 + i*4));
+					}
+				}
 			}
 
 			if (par->Architecture >= NV_ARCH_40) {
@@ -1338,7 +1385,9 @@ void NVLoadStateExt(struct nvidia_par *p
 					NV_WR32(par->PGRAPH, 0x0868,
 						par->FbMapSize - 1);
 				} else {
-					if((par->Chipset & 0xfff0) == 0x0090) {
+					if ((par->Chipset & 0xfff0) == 0x0090 ||
+					    (par->Chipset & 0xfff0) == 0x01D0 ||
+					    (par->Chipset & 0xfff0) == 0x0290) {
 						NV_WR32(par->PGRAPH, 0x0DF0,
 							NV_RD32(par->PFB, 0x0200));
 						NV_WR32(par->PGRAPH, 0x0DF4,
Index: linux-work/drivers/video/nvidia/nv_setup.c
===================================================================
--- linux-work.orig/drivers/video/nvidia/nv_setup.c	2005-11-24 17:18:46.000000000 +1100
+++ linux-work/drivers/video/nvidia/nv_setup.c	2005-12-07 19:09:01.000000000 +1100
@@ -285,7 +285,6 @@ static void nv10GetConfig(struct nvidia_
 			par->CrystalFreqKHz = 27000;
 	}
 
-	par->CursorStart = (par->RamAmountKBytes - 96) * 1024;
 	par->CURSOR = NULL;	/* can't set this here */
 	par->MinVClockFreqKHz = 12000;
 	par->MaxVClockFreqKHz = par->twoStagePLL ? 400000 : 350000;
@@ -382,6 +381,8 @@ void NVCommonSetup(struct fb_info *info)
 	case 0x0146:
 	case 0x0147:
 	case 0x0148:
+	case 0x0098:
+	case 0x0099:
 		mobile = 1;
 		break;
 	default:
Index: linux-work/drivers/video/nvidia/nvidia.c
===================================================================
--- linux-work.orig/drivers/video/nvidia/nvidia.c	2005-11-24 17:18:46.000000000 +1100
+++ linux-work/drivers/video/nvidia/nvidia.c	2005-12-07 18:52:36.000000000 +1100
@@ -1485,6 +1485,8 @@ static u32 __devinit nvidia_get_arch(str
 	case 0x0210:
 	case 0x0220:
 	case 0x0230:
+	case 0x0290:
+	case 0x0390:
 		arch = NV_ARCH_40;
 		break;
 	case 0x0020:		/* TNT, TNT2 */
@@ -1581,10 +1583,15 @@ static int __devinit nvidiafb_probe(stru
 	if (par->FbMapSize > 64 * 1024 * 1024)
 		par->FbMapSize = 64 * 1024 * 1024;
 
-	par->FbUsableSize = par->FbMapSize - (128 * 1024);
+	if(par->Architecture >= NV_ARCH_40)
+  	        par->FbUsableSize = par->FbMapSize - (560 * 1024);
+	else
+		par->FbUsableSize = par->FbMapSize - (128 * 1024);
 	par->ScratchBufferSize = (par->Architecture < NV_ARCH_10) ? 8 * 1024 :
 	    16 * 1024;
 	par->ScratchBufferStart = par->FbUsableSize - par->ScratchBufferSize;
+	par->CursorStart = par->FbUsableSize + (32 * 1024);
+
 	info->screen_base = ioremap(nvidiafb_fix.smem_start, par->FbMapSize);
 	info->screen_size = par->FbUsableSize;
 	nvidiafb_fix.smem_len = par->RamAmountKBytes * 1024;




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

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

* Re: [PATCH] nvidiafb: Fix 6xxx/7xxx cards
  2005-12-07  8:33 [PATCH] nvidiafb: Fix 6xxx/7xxx cards Benjamin Herrenschmidt
@ 2005-12-08 20:54 ` Antonino A. Daplas
  2005-12-08 22:17   ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 15+ messages in thread
From: Antonino A. Daplas @ 2005-12-08 20:54 UTC (permalink / raw)
  To: linux-fbdev-devel; +Cc: Antonino A. Daplas, Andrew Morton

Benjamin Herrenschmidt wrote:
> Recent X "nv" driver was fixed for various issues with modern 6xxx and
> 7xxx cards. This patch ports those fixes to nvidiafb. This makes it work
> fine on the 6600 bundled with the newest G5 macs. I've verified it still
> works on the 5200FX of the iMacG5.

Yes, I have a similar patch in my tree but I'm waiting for people to verify
the patch.

(And I have I more patch for pci-e cards, and still waiting for testers
to respond.)

> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Antonino Daplas <adaplas@pol.net>





-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

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

* Re: [PATCH] nvidiafb: Fix 6xxx/7xxx cards
  2005-12-08 20:54 ` Antonino A. Daplas
@ 2005-12-08 22:17   ` Benjamin Herrenschmidt
  2005-12-08 22:54     ` Antonino A. Daplas
  0 siblings, 1 reply; 15+ messages in thread
From: Benjamin Herrenschmidt @ 2005-12-08 22:17 UTC (permalink / raw)
  To: linux-fbdev-devel; +Cc: Antonino A. Daplas, Andrew Morton

On Fri, 2005-12-09 at 04:54 +0800, Antonino A. Daplas wrote:
> Benjamin Herrenschmidt wrote:
> > Recent X "nv" driver was fixed for various issues with modern 6xxx and
> > 7xxx cards. This patch ports those fixes to nvidiafb. This makes it work
> > fine on the 6600 bundled with the newest G5 macs. I've verified it still
> > works on the 5200FX of the iMacG5.
> 
> Yes, I have a similar patch in my tree but I'm waiting for people to verify
> the patch.
> 
> (And I have I more patch for pci-e cards, and still waiting for testers
> to respond.)

Can you send me your version of the patch ? I spotted a couple of bugs
in your previous code, I want to make sure it's all fixed :)

Ben.




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

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

* Re: [PATCH] nvidiafb: Fix 6xxx/7xxx cards
  2005-12-08 22:17   ` Benjamin Herrenschmidt
@ 2005-12-08 22:54     ` Antonino A. Daplas
  2005-12-11  7:54       ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 15+ messages in thread
From: Antonino A. Daplas @ 2005-12-08 22:54 UTC (permalink / raw)
  To: linux-fbdev-devel; +Cc: Antonino A. Daplas, Andrew Morton

Benjamin Herrenschmidt wrote:
> On Fri, 2005-12-09 at 04:54 +0800, Antonino A. Daplas wrote:
>> Benjamin Herrenschmidt wrote:
>>> Recent X "nv" driver was fixed for various issues with modern 6xxx and
>>> 7xxx cards. This patch ports those fixes to nvidiafb. This makes it work
>>> fine on the 6600 bundled with the newest G5 macs. I've verified it still
>>> works on the 5200FX of the iMacG5.
>> Yes, I have a similar patch in my tree but I'm waiting for people to verify
>> the patch.
>>
>> (And I have I more patch for pci-e cards, and still waiting for testers
>> to respond.)
> 
> Can you send me your version of the patch ? I spotted a couple of bugs
> in your previous code, I want to make sure it's all fixed :)
> 

I already told akpm to drop mine and take yours instead as you already
verified that it works.  I'll send you the pci-e support patch, diffed
against your patch if you want.

Tony


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

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

* Re: [PATCH] nvidiafb: Fix 6xxx/7xxx cards
  2005-12-08 22:54     ` Antonino A. Daplas
@ 2005-12-11  7:54       ` Benjamin Herrenschmidt
  2006-01-09  2:32         ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 15+ messages in thread
From: Benjamin Herrenschmidt @ 2005-12-11  7:54 UTC (permalink / raw)
  To: linux-fbdev-devel; +Cc: Antonino A. Daplas, Andrew Morton


> I already told akpm to drop mine and take yours instead as you already
> verified that it works.  I'll send you the pci-e support patch, diffed
> against your patch if you want.

That's fine, thanks.

Ben.




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

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

* Re: [PATCH] nvidiafb: Fix 6xxx/7xxx cards
  2005-12-11  7:54       ` Benjamin Herrenschmidt
@ 2006-01-09  2:32         ` Benjamin Herrenschmidt
  2006-01-09  3:13           ` Andrew Morton
  0 siblings, 1 reply; 15+ messages in thread
From: Benjamin Herrenschmidt @ 2006-01-09  2:32 UTC (permalink / raw)
  To: linux-fbdev-devel; +Cc: Antonino A. Daplas, Andrew Morton

On Sun, 2005-12-11 at 18:54 +1100, Benjamin Herrenschmidt wrote:
> > I already told akpm to drop mine and take yours instead as you already
> > verified that it works.  I'll send you the pci-e support patch, diffed
> > against your patch if you want.

It's not yet upstream and we are about to merge the new g5 support.
Andrew, will you send it to Linus or was there some issues with the
patch ?

Ben.




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

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

* Re: [PATCH] nvidiafb: Fix 6xxx/7xxx cards
  2006-01-09  2:32         ` Benjamin Herrenschmidt
@ 2006-01-09  3:13           ` Andrew Morton
  2006-01-09  4:13             ` Benjamin Herrenschmidt
                               ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Andrew Morton @ 2006-01-09  3:13 UTC (permalink / raw)
  To: linux-fbdev-devel; +Cc: benh, adaplas

Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> On Sun, 2005-12-11 at 18:54 +1100, Benjamin Herrenschmidt wrote:
> > > I already told akpm to drop mine and take yours instead as you already
> > > verified that it works.

I didn't get that message..

>  I'll send you the pci-e support patch, diffed
> > > against your patch if you want.
> 
> It's not yet upstream and we are about to merge the new g5 support.
> Andrew, will you send it to Linus or was there some issues with the
> patch ?
> 

Current nvidia patches which I have are:

nvidiafb-i2c-bus-name-beautification.patch
fbdev-nvidiafb-driver-cleanup.patch
nvidiafb-add-support-for-some-pci-e-chipsets.patch
nvidiafb-add-support-for-some-pci-e-chipsets-fix.patch
nvidiafb-add-boot-option-bpp.patch
nvidiafb-reduce-stack-usage.patch
nvidia-agp-use-time_before_eq.patch

None of those appear to do the same thing as Ben's patch, so I don't know
what's going on here.


Gad.  It looks like a variant of Ben's patch is in the powerpc tree.  wtf
is it doing there?


Anyway, all of the above patches apply OK to whatever is in git-powerpc so
I spose we can just merge git-powerpc and be happy.  Soon, I hope - I have
a few things held up by that tree.

Tell Paul to grovel appropriately to Linus when he sends it though -
putting non-arch stuff into an arch tree tends to upset him.  


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

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

* Re: [PATCH] nvidiafb: Fix 6xxx/7xxx cards
  2006-01-09  3:13           ` Andrew Morton
@ 2006-01-09  4:13             ` Benjamin Herrenschmidt
  2006-01-09  5:43               ` Andrew Morton
  2006-01-10  1:23             ` Antonino A. Daplas
  2006-01-10  1:26             ` Antonino A. Daplas
  2 siblings, 1 reply; 15+ messages in thread
From: Benjamin Herrenschmidt @ 2006-01-09  4:13 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-fbdev-devel, adaplas


> Gad.  It looks like a variant of Ben's patch is in the powerpc tree.  wtf
> is it doing there?

What's going on is that the powerpc tree contains that patch bcs it
contains all the necessary bits to boot a new g5 and that includes it.
However, paulus is currently cooking a merged tree for linus with all of
that stuff, but not the nvidiafb patch since it's not the proper way to
get it in sneaked inside a powerpc merge ;)

> Anyway, all of the above patches apply OK to whatever is in git-powerpc so
> I spose we can just merge git-powerpc and be happy.  Soon, I hope - I have
> a few things held up by that tree.

We are working on it.

> Tell Paul to grovel appropriately to Linus when he sends it though -
> putting non-arch stuff into an arch tree tends to upset him.  

Well, that's why we aren't sending it to Linus ourselves... I'll send it
back to you separately.

Ben.




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

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

* Re: [PATCH] nvidiafb: Fix 6xxx/7xxx cards
  2006-01-09  4:13             ` Benjamin Herrenschmidt
@ 2006-01-09  5:43               ` Andrew Morton
  2006-01-09  6:38                 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 15+ messages in thread
From: Andrew Morton @ 2006-01-09  5:43 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linux-fbdev-devel, adaplas

Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> > Anyway, all of the above patches apply OK to whatever is in git-powerpc so
> > I spose we can just merge git-powerpc and be happy.  Soon, I hope - I have
> > a few things held up by that tree.
> 
> We are working on it.
> 

hm, OK.

You now shrink-dentry-struct-spufs-fix.patch, which I'll resend.



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

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

* Re: [PATCH] nvidiafb: Fix 6xxx/7xxx cards
  2006-01-09  5:43               ` Andrew Morton
@ 2006-01-09  6:38                 ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 15+ messages in thread
From: Benjamin Herrenschmidt @ 2006-01-09  6:38 UTC (permalink / raw)
  To: linux-fbdev-devel

On Sun, 2006-01-08 at 21:43 -0800, Andrew Morton wrote:
> Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> >
> > > Anyway, all of the above patches apply OK to whatever is in git-powerpc so
> > > I spose we can just merge git-powerpc and be happy.  Soon, I hope - I have
> > > a few things held up by that tree.
> > 
> > We are working on it.
> > 
> 
> hm, OK.
> 
> You now shrink-dentry-struct-spufs-fix.patch, which I'll resend.

Ok. Paulus is just only back from vacation, so we have a big backlog of
stuffs. Hopefully he'll have something for Linus to pull tonight or
tomorrow.

Ben.




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

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

* Re: [PATCH] nvidiafb: Fix 6xxx/7xxx cards
  2006-01-09  3:13           ` Andrew Morton
  2006-01-09  4:13             ` Benjamin Herrenschmidt
@ 2006-01-10  1:23             ` Antonino A. Daplas
  2006-01-10  1:26             ` Antonino A. Daplas
  2 siblings, 0 replies; 15+ messages in thread
From: Antonino A. Daplas @ 2006-01-10  1:23 UTC (permalink / raw)
  To: linux-fbdev-devel; +Cc: benh, adaplas

Andrew Morton wrote:
> Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>> On Sun, 2005-12-11 at 18:54 +1100, Benjamin Herrenschmidt wrote:
>>>> I already told akpm to drop mine and take yours instead as you already
>>>> verified that it works.
> 
> I didn't get that message..

Probably got lost.  You already accepted it, and most probably sent it to
Linus, on Dec 10 and Dec 16 respectively. I have these in my inbox.

+ nvidiafb-fix-6xxx-7xxx-cards.patch added to -mm tree 12/10/2005
- nvidiafb-fix-6xxx-7xxx-cards.patch removed from -mm tree 12/16/2005

Tony


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

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

* Re: [PATCH] nvidiafb: Fix 6xxx/7xxx cards
  2006-01-09  3:13           ` Andrew Morton
  2006-01-09  4:13             ` Benjamin Herrenschmidt
  2006-01-10  1:23             ` Antonino A. Daplas
@ 2006-01-10  1:26             ` Antonino A. Daplas
  2006-01-10  2:35               ` Benjamin Herrenschmidt
  2 siblings, 1 reply; 15+ messages in thread
From: Antonino A. Daplas @ 2006-01-10  1:26 UTC (permalink / raw)
  To: linux-fbdev-devel; +Cc: benh, adaplas, Andrew Morton

Andrew Morton wrote:
> Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>> On Sun, 2005-12-11 at 18:54 +1100, Benjamin Herrenschmidt wrote:
>>>> I already told akpm to drop mine and take yours instead as you already
>>>> verified that it works.
> 
> I didn't get that message..

Probably got lost.  You already accepted it, and most probably sent it to
Linus, on Dec 10 and Dec 16 respectively. I have these in my inbox.

+ nvidiafb-fix-6xxx-7xxx-cards.patch added to -mm tree 12/10/2005
- nvidiafb-fix-6xxx-7xxx-cards.patch removed from -mm tree 12/16/2005

Tony



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

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

* Re: [PATCH] nvidiafb: Fix 6xxx/7xxx cards
  2006-01-10  1:26             ` Antonino A. Daplas
@ 2006-01-10  2:35               ` Benjamin Herrenschmidt
  2006-01-10  3:08                 ` Andrew Morton
  0 siblings, 1 reply; 15+ messages in thread
From: Benjamin Herrenschmidt @ 2006-01-10  2:35 UTC (permalink / raw)
  To: linux-fbdev-devel; +Cc: adaplas, Andrew Morton

On Tue, 2006-01-10 at 09:26 +0800, Antonino A. Daplas wrote:
> Andrew Morton wrote:
> > Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> >> On Sun, 2005-12-11 at 18:54 +1100, Benjamin Herrenschmidt wrote:
> >>>> I already told akpm to drop mine and take yours instead as you already
> >>>> verified that it works.
> > 
> > I didn't get that message..
> 
> Probably got lost.  You already accepted it, and most probably sent it to
> Linus, on Dec 10 and Dec 16 respectively. I have these in my inbox.
> 
> + nvidiafb-fix-6xxx-7xxx-cards.patch added to -mm tree 12/10/2005
> - nvidiafb-fix-6xxx-7xxx-cards.patch removed from -mm tree 12/16/2005

Well it wasn't in Linus tree yesterday...

Ben.




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

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

* Re: [PATCH] nvidiafb: Fix 6xxx/7xxx cards
  2006-01-10  2:35               ` Benjamin Herrenschmidt
@ 2006-01-10  3:08                 ` Andrew Morton
  2006-01-10  3:23                   ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 15+ messages in thread
From: Andrew Morton @ 2006-01-10  3:08 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linux-fbdev-devel, adaplas

Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> On Tue, 2006-01-10 at 09:26 +0800, Antonino A. Daplas wrote:
> > Andrew Morton wrote:
> > > Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> > >> On Sun, 2005-12-11 at 18:54 +1100, Benjamin Herrenschmidt wrote:
> > >>>> I already told akpm to drop mine and take yours instead as you already
> > >>>> verified that it works.
> > > 
> > > I didn't get that message..
> > 
> > Probably got lost.  You already accepted it, and most probably sent it to
> > Linus, on Dec 10 and Dec 16 respectively. I have these in my inbox.
> > 
> > + nvidiafb-fix-6xxx-7xxx-cards.patch added to -mm tree 12/10/2005
> > - nvidiafb-fix-6xxx-7xxx-cards.patch removed from -mm tree 12/16/2005
> 
> Well it wasn't in Linus tree yesterday...
> 

I'm about to send this:


From: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Recent X "nv" driver was fixed for various issues with modern 6xxx and 7xxx
cards.  This patch ports those fixes to nvidiafb.  This makes it work fine
on the 6600 bundled with the newest G5 macs.  I've verified it still works
on the 5200FX of the iMacG5.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 drivers/video/nvidia/nv_hw.c    |   81 ++++++++++++++++++++++++------
 drivers/video/nvidia/nv_setup.c |    3 -
 drivers/video/nvidia/nvidia.c   |    9 ++-
 3 files changed, 75 insertions(+), 18 deletions(-)

diff -puN drivers/video/nvidia/nv_hw.c~nvidiafb-fixes-for-new-g5 drivers/video/nvidia/nv_hw.c
--- devel/drivers/video/nvidia/nv_hw.c~nvidiafb-fixes-for-new-g5	2006-01-09 17:52:33.000000000 -0800
+++ devel-akpm/drivers/video/nvidia/nv_hw.c	2006-01-09 17:52:33.000000000 -0800
@@ -848,7 +848,7 @@ void NVCalcStateExt(struct nvidia_par *p
 		    int width,
 		    int hDisplaySize, int height, int dotClock, int flags)
 {
-	int pixelDepth, VClk;
+	int pixelDepth, VClk = 0;
 	/*
 	 * Save mode parameters.
 	 */
@@ -938,15 +938,24 @@ void NVLoadStateExt(struct nvidia_par *p
 
 	if (par->Architecture == NV_ARCH_04) {
 		NV_WR32(par->PFB, 0x0200, state->config);
-	} else if ((par->Chipset & 0xfff0) == 0x0090) {
-		for (i = 0; i < 15; i++) {
-			NV_WR32(par->PFB, 0x0600 + (i * 0x10), 0);
-			NV_WR32(par->PFB, 0x0604 + (i * 0x10), par->FbMapSize - 1);
-		}
-	} else {
+	} else if ((par->Architecture < NV_ARCH_40) ||
+		   (par->Chipset & 0xfff0) == 0x0040) {
 		for (i = 0; i < 8; i++) {
 			NV_WR32(par->PFB, 0x0240 + (i * 0x10), 0);
-			NV_WR32(par->PFB, 0x0244 + (i * 0x10), par->FbMapSize - 1);
+			NV_WR32(par->PFB, 0x0244 + (i * 0x10),
+				par->FbMapSize - 1);
+		}
+	} else {
+		int regions = 12;
+
+		if (((par->Chipset & 0xfff0) == 0x0090) ||
+		    ((par->Chipset & 0xfff0) == 0x01D0) ||
+		    ((par->Chipset & 0xfff0) == 0x0290))
+			regions = 15;
+		for(i = 0; i < regions; i++) {
+			NV_WR32(par->PFB, 0x0600 + (i * 0x10), 0);
+			NV_WR32(par->PFB, 0x0604 + (i * 0x10),
+				par->FbMapSize - 1);
 		}
 	}
 
@@ -1182,11 +1191,17 @@ void NVLoadStateExt(struct nvidia_par *p
 			NV_WR32(par->PGRAPH, 0x0608, 0xFFFFFFFF);
 		} else {
 			if (par->Architecture >= NV_ARCH_40) {
+				u32 tmp;
+
 				NV_WR32(par->PGRAPH, 0x0084, 0x401287c0);
 				NV_WR32(par->PGRAPH, 0x008C, 0x60de8051);
 				NV_WR32(par->PGRAPH, 0x0090, 0x00008000);
 				NV_WR32(par->PGRAPH, 0x0610, 0x00be3c5f);
 
+				tmp = NV_RD32(par->REGS, 0x1540) & 0xff;
+				for(i = 0; tmp && !(tmp & 1); tmp >>= 1, i++);
+				NV_WR32(par->PGRAPH, 0x5000, i);
+
 				if ((par->Chipset & 0xfff0) == 0x0040) {
 					NV_WR32(par->PGRAPH, 0x09b0,
 						0x83280fff);
@@ -1211,6 +1226,7 @@ void NVLoadStateExt(struct nvidia_par *p
 						0xffff7fff);
 					break;
 				case 0x00C0:
+				case 0x0120:
 					NV_WR32(par->PGRAPH, 0x0828,
 						0x007596ff);
 					NV_WR32(par->PGRAPH, 0x082C,
@@ -1245,6 +1261,7 @@ void NVLoadStateExt(struct nvidia_par *p
 						0x00100000);
 					break;
 				case 0x0090:
+				case 0x0290:
 					NV_WR32(par->PRAMDAC, 0x0608,
 						NV_RD32(par->PRAMDAC, 0x0608) |
 						0x00100000);
@@ -1310,14 +1327,44 @@ void NVLoadStateExt(struct nvidia_par *p
 				}
 			}
 
-			if ((par->Chipset & 0xfff0) == 0x0090) {
-				for (i = 0; i < 60; i++)
-					NV_WR32(par->PGRAPH, 0x0D00 + i,
-						NV_RD32(par->PFB, 0x0600 + i));
+			if ((par->Architecture < NV_ARCH_40) ||
+			    ((par->Chipset & 0xfff0) == 0x0040)) {
+				for (i = 0; i < 32; i++) {
+					NV_WR32(par->PGRAPH, 0x0900 + i*4,
+						NV_RD32(par->PFB, 0x0240 +i*4));
+					NV_WR32(par->PGRAPH, 0x6900 + i*4,
+						NV_RD32(par->PFB, 0x0240 +i*4));
+				}
 			} else {
-				for (i = 0; i < 32; i++)
-					NV_WR32(par->PGRAPH, 0x0900 + i,
-						NV_RD32(par->PFB, 0x0240 + i));
+				if (((par->Chipset & 0xfff0) == 0x0090) ||
+				    ((par->Chipset & 0xfff0) == 0x01D0) ||
+				    ((par->Chipset & 0xfff0) == 0x0290)) {
+					for (i = 0; i < 60; i++) {
+						NV_WR32(par->PGRAPH,
+							0x0D00 + i*4,
+							NV_RD32(par->PFB,
+								0x0600 + i*4));
+						NV_WR32(par->PGRAPH,
+							0x6900 + i*4,
+							NV_RD32(par->PFB,
+								0x0600 + i*4));
+					}
+				} else {
+					for (i = 0; i < 48; i++) {
+						NV_WR32(par->PGRAPH,
+							0x0900 + i*4,
+							NV_RD32(par->PFB,
+								0x0600 + i*4));
+						if(((par->Chipset & 0xfff0)
+						    != 0x0160) &&
+						   ((par->Chipset & 0xfff0)
+						    != 0x0220))
+							NV_WR32(par->PGRAPH,
+								0x6900 + i*4,
+								NV_RD32(par->PFB,
+									0x0600 + i*4));
+					}
+				}
 			}
 
 			if (par->Architecture >= NV_ARCH_40) {
@@ -1338,7 +1385,9 @@ void NVLoadStateExt(struct nvidia_par *p
 					NV_WR32(par->PGRAPH, 0x0868,
 						par->FbMapSize - 1);
 				} else {
-					if((par->Chipset & 0xfff0) == 0x0090) {
+					if ((par->Chipset & 0xfff0) == 0x0090 ||
+					    (par->Chipset & 0xfff0) == 0x01D0 ||
+					    (par->Chipset & 0xfff0) == 0x0290) {
 						NV_WR32(par->PGRAPH, 0x0DF0,
 							NV_RD32(par->PFB, 0x0200));
 						NV_WR32(par->PGRAPH, 0x0DF4,
diff -puN drivers/video/nvidia/nvidia.c~nvidiafb-fixes-for-new-g5 drivers/video/nvidia/nvidia.c
--- devel/drivers/video/nvidia/nvidia.c~nvidiafb-fixes-for-new-g5	2006-01-09 17:52:33.000000000 -0800
+++ devel-akpm/drivers/video/nvidia/nvidia.c	2006-01-09 17:52:33.000000000 -0800
@@ -1485,6 +1485,8 @@ static u32 __devinit nvidia_get_arch(str
 	case 0x0210:
 	case 0x0220:
 	case 0x0230:
+	case 0x0290:
+	case 0x0390:
 		arch = NV_ARCH_40;
 		break;
 	case 0x0020:		/* TNT, TNT2 */
@@ -1581,10 +1583,15 @@ static int __devinit nvidiafb_probe(stru
 	if (par->FbMapSize > 64 * 1024 * 1024)
 		par->FbMapSize = 64 * 1024 * 1024;
 
-	par->FbUsableSize = par->FbMapSize - (128 * 1024);
+	if(par->Architecture >= NV_ARCH_40)
+  	        par->FbUsableSize = par->FbMapSize - (560 * 1024);
+	else
+		par->FbUsableSize = par->FbMapSize - (128 * 1024);
 	par->ScratchBufferSize = (par->Architecture < NV_ARCH_10) ? 8 * 1024 :
 	    16 * 1024;
 	par->ScratchBufferStart = par->FbUsableSize - par->ScratchBufferSize;
+	par->CursorStart = par->FbUsableSize + (32 * 1024);
+
 	info->screen_base = ioremap(nvidiafb_fix.smem_start, par->FbMapSize);
 	info->screen_size = par->FbUsableSize;
 	nvidiafb_fix.smem_len = par->RamAmountKBytes * 1024;
diff -puN drivers/video/nvidia/nv_setup.c~nvidiafb-fixes-for-new-g5 drivers/video/nvidia/nv_setup.c
--- devel/drivers/video/nvidia/nv_setup.c~nvidiafb-fixes-for-new-g5	2006-01-09 17:52:33.000000000 -0800
+++ devel-akpm/drivers/video/nvidia/nv_setup.c	2006-01-09 17:52:33.000000000 -0800
@@ -285,7 +285,6 @@ static void nv10GetConfig(struct nvidia_
 			par->CrystalFreqKHz = 27000;
 	}
 
-	par->CursorStart = (par->RamAmountKBytes - 96) * 1024;
 	par->CURSOR = NULL;	/* can't set this here */
 	par->MinVClockFreqKHz = 12000;
 	par->MaxVClockFreqKHz = par->twoStagePLL ? 400000 : 350000;
@@ -382,6 +381,8 @@ void NVCommonSetup(struct fb_info *info)
 	case 0x0146:
 	case 0x0147:
 	case 0x0148:
+	case 0x0098:
+	case 0x0099:
 		mobile = 1;
 		break;
 	default:
_



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

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

* Re: [PATCH] nvidiafb: Fix 6xxx/7xxx cards
  2006-01-10  3:08                 ` Andrew Morton
@ 2006-01-10  3:23                   ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 15+ messages in thread
From: Benjamin Herrenschmidt @ 2006-01-10  3:23 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-fbdev-devel, adaplas

On Mon, 2006-01-09 at 19:08 -0800, Andrew Morton wrote:

> I'm about to send this:

Looks good to me.

Thanks !

Ben.

> 
> From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> 
> Recent X "nv" driver was fixed for various issues with modern 6xxx and 7xxx
> cards.  This patch ports those fixes to nvidiafb.  This makes it work fine
> on the 6600 bundled with the newest G5 macs.  I've verified it still works
> on the 5200FX of the iMacG5.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Acked-by: "Antonino A. Daplas" <adaplas@pol.net>
> Signed-off-by: Andrew Morton <akpm@osdl.org>
> ---
> 
>  drivers/video/nvidia/nv_hw.c    |   81 ++++++++++++++++++++++++------
>  drivers/video/nvidia/nv_setup.c |    3 -
>  drivers/video/nvidia/nvidia.c   |    9 ++-
>  3 files changed, 75 insertions(+), 18 deletions(-)
> 
> diff -puN drivers/video/nvidia/nv_hw.c~nvidiafb-fixes-for-new-g5 drivers/video/nvidia/nv_hw.c
> --- devel/drivers/video/nvidia/nv_hw.c~nvidiafb-fixes-for-new-g5	2006-01-09 17:52:33.000000000 -0800
> +++ devel-akpm/drivers/video/nvidia/nv_hw.c	2006-01-09 17:52:33.000000000 -0800
> @@ -848,7 +848,7 @@ void NVCalcStateExt(struct nvidia_par *p
>  		    int width,
>  		    int hDisplaySize, int height, int dotClock, int flags)
>  {
> -	int pixelDepth, VClk;
> +	int pixelDepth, VClk = 0;
>  	/*
>  	 * Save mode parameters.
>  	 */
> @@ -938,15 +938,24 @@ void NVLoadStateExt(struct nvidia_par *p
>  
>  	if (par->Architecture == NV_ARCH_04) {
>  		NV_WR32(par->PFB, 0x0200, state->config);
> -	} else if ((par->Chipset & 0xfff0) == 0x0090) {
> -		for (i = 0; i < 15; i++) {
> -			NV_WR32(par->PFB, 0x0600 + (i * 0x10), 0);
> -			NV_WR32(par->PFB, 0x0604 + (i * 0x10), par->FbMapSize - 1);
> -		}
> -	} else {
> +	} else if ((par->Architecture < NV_ARCH_40) ||
> +		   (par->Chipset & 0xfff0) == 0x0040) {
>  		for (i = 0; i < 8; i++) {
>  			NV_WR32(par->PFB, 0x0240 + (i * 0x10), 0);
> -			NV_WR32(par->PFB, 0x0244 + (i * 0x10), par->FbMapSize - 1);
> +			NV_WR32(par->PFB, 0x0244 + (i * 0x10),
> +				par->FbMapSize - 1);
> +		}
> +	} else {
> +		int regions = 12;
> +
> +		if (((par->Chipset & 0xfff0) == 0x0090) ||
> +		    ((par->Chipset & 0xfff0) == 0x01D0) ||
> +		    ((par->Chipset & 0xfff0) == 0x0290))
> +			regions = 15;
> +		for(i = 0; i < regions; i++) {
> +			NV_WR32(par->PFB, 0x0600 + (i * 0x10), 0);
> +			NV_WR32(par->PFB, 0x0604 + (i * 0x10),
> +				par->FbMapSize - 1);
>  		}
>  	}
>  
> @@ -1182,11 +1191,17 @@ void NVLoadStateExt(struct nvidia_par *p
>  			NV_WR32(par->PGRAPH, 0x0608, 0xFFFFFFFF);
>  		} else {
>  			if (par->Architecture >= NV_ARCH_40) {
> +				u32 tmp;
> +
>  				NV_WR32(par->PGRAPH, 0x0084, 0x401287c0);
>  				NV_WR32(par->PGRAPH, 0x008C, 0x60de8051);
>  				NV_WR32(par->PGRAPH, 0x0090, 0x00008000);
>  				NV_WR32(par->PGRAPH, 0x0610, 0x00be3c5f);
>  
> +				tmp = NV_RD32(par->REGS, 0x1540) & 0xff;
> +				for(i = 0; tmp && !(tmp & 1); tmp >>= 1, i++);
> +				NV_WR32(par->PGRAPH, 0x5000, i);
> +
>  				if ((par->Chipset & 0xfff0) == 0x0040) {
>  					NV_WR32(par->PGRAPH, 0x09b0,
>  						0x83280fff);
> @@ -1211,6 +1226,7 @@ void NVLoadStateExt(struct nvidia_par *p
>  						0xffff7fff);
>  					break;
>  				case 0x00C0:
> +				case 0x0120:
>  					NV_WR32(par->PGRAPH, 0x0828,
>  						0x007596ff);
>  					NV_WR32(par->PGRAPH, 0x082C,
> @@ -1245,6 +1261,7 @@ void NVLoadStateExt(struct nvidia_par *p
>  						0x00100000);
>  					break;
>  				case 0x0090:
> +				case 0x0290:
>  					NV_WR32(par->PRAMDAC, 0x0608,
>  						NV_RD32(par->PRAMDAC, 0x0608) |
>  						0x00100000);
> @@ -1310,14 +1327,44 @@ void NVLoadStateExt(struct nvidia_par *p
>  				}
>  			}
>  
> -			if ((par->Chipset & 0xfff0) == 0x0090) {
> -				for (i = 0; i < 60; i++)
> -					NV_WR32(par->PGRAPH, 0x0D00 + i,
> -						NV_RD32(par->PFB, 0x0600 + i));
> +			if ((par->Architecture < NV_ARCH_40) ||
> +			    ((par->Chipset & 0xfff0) == 0x0040)) {
> +				for (i = 0; i < 32; i++) {
> +					NV_WR32(par->PGRAPH, 0x0900 + i*4,
> +						NV_RD32(par->PFB, 0x0240 +i*4));
> +					NV_WR32(par->PGRAPH, 0x6900 + i*4,
> +						NV_RD32(par->PFB, 0x0240 +i*4));
> +				}
>  			} else {
> -				for (i = 0; i < 32; i++)
> -					NV_WR32(par->PGRAPH, 0x0900 + i,
> -						NV_RD32(par->PFB, 0x0240 + i));
> +				if (((par->Chipset & 0xfff0) == 0x0090) ||
> +				    ((par->Chipset & 0xfff0) == 0x01D0) ||
> +				    ((par->Chipset & 0xfff0) == 0x0290)) {
> +					for (i = 0; i < 60; i++) {
> +						NV_WR32(par->PGRAPH,
> +							0x0D00 + i*4,
> +							NV_RD32(par->PFB,
> +								0x0600 + i*4));
> +						NV_WR32(par->PGRAPH,
> +							0x6900 + i*4,
> +							NV_RD32(par->PFB,
> +								0x0600 + i*4));
> +					}
> +				} else {
> +					for (i = 0; i < 48; i++) {
> +						NV_WR32(par->PGRAPH,
> +							0x0900 + i*4,
> +							NV_RD32(par->PFB,
> +								0x0600 + i*4));
> +						if(((par->Chipset & 0xfff0)
> +						    != 0x0160) &&
> +						   ((par->Chipset & 0xfff0)
> +						    != 0x0220))
> +							NV_WR32(par->PGRAPH,
> +								0x6900 + i*4,
> +								NV_RD32(par->PFB,
> +									0x0600 + i*4));
> +					}
> +				}
>  			}
>  
>  			if (par->Architecture >= NV_ARCH_40) {
> @@ -1338,7 +1385,9 @@ void NVLoadStateExt(struct nvidia_par *p
>  					NV_WR32(par->PGRAPH, 0x0868,
>  						par->FbMapSize - 1);
>  				} else {
> -					if((par->Chipset & 0xfff0) == 0x0090) {
> +					if ((par->Chipset & 0xfff0) == 0x0090 ||
> +					    (par->Chipset & 0xfff0) == 0x01D0 ||
> +					    (par->Chipset & 0xfff0) == 0x0290) {
>  						NV_WR32(par->PGRAPH, 0x0DF0,
>  							NV_RD32(par->PFB, 0x0200));
>  						NV_WR32(par->PGRAPH, 0x0DF4,
> diff -puN drivers/video/nvidia/nvidia.c~nvidiafb-fixes-for-new-g5 drivers/video/nvidia/nvidia.c
> --- devel/drivers/video/nvidia/nvidia.c~nvidiafb-fixes-for-new-g5	2006-01-09 17:52:33.000000000 -0800
> +++ devel-akpm/drivers/video/nvidia/nvidia.c	2006-01-09 17:52:33.000000000 -0800
> @@ -1485,6 +1485,8 @@ static u32 __devinit nvidia_get_arch(str
>  	case 0x0210:
>  	case 0x0220:
>  	case 0x0230:
> +	case 0x0290:
> +	case 0x0390:
>  		arch = NV_ARCH_40;
>  		break;
>  	case 0x0020:		/* TNT, TNT2 */
> @@ -1581,10 +1583,15 @@ static int __devinit nvidiafb_probe(stru
>  	if (par->FbMapSize > 64 * 1024 * 1024)
>  		par->FbMapSize = 64 * 1024 * 1024;
>  
> -	par->FbUsableSize = par->FbMapSize - (128 * 1024);
> +	if(par->Architecture >= NV_ARCH_40)
> +  	        par->FbUsableSize = par->FbMapSize - (560 * 1024);
> +	else
> +		par->FbUsableSize = par->FbMapSize - (128 * 1024);
>  	par->ScratchBufferSize = (par->Architecture < NV_ARCH_10) ? 8 * 1024 :
>  	    16 * 1024;
>  	par->ScratchBufferStart = par->FbUsableSize - par->ScratchBufferSize;
> +	par->CursorStart = par->FbUsableSize + (32 * 1024);
> +
>  	info->screen_base = ioremap(nvidiafb_fix.smem_start, par->FbMapSize);
>  	info->screen_size = par->FbUsableSize;
>  	nvidiafb_fix.smem_len = par->RamAmountKBytes * 1024;
> diff -puN drivers/video/nvidia/nv_setup.c~nvidiafb-fixes-for-new-g5 drivers/video/nvidia/nv_setup.c
> --- devel/drivers/video/nvidia/nv_setup.c~nvidiafb-fixes-for-new-g5	2006-01-09 17:52:33.000000000 -0800
> +++ devel-akpm/drivers/video/nvidia/nv_setup.c	2006-01-09 17:52:33.000000000 -0800
> @@ -285,7 +285,6 @@ static void nv10GetConfig(struct nvidia_
>  			par->CrystalFreqKHz = 27000;
>  	}
>  
> -	par->CursorStart = (par->RamAmountKBytes - 96) * 1024;
>  	par->CURSOR = NULL;	/* can't set this here */
>  	par->MinVClockFreqKHz = 12000;
>  	par->MaxVClockFreqKHz = par->twoStagePLL ? 400000 : 350000;
> @@ -382,6 +381,8 @@ void NVCommonSetup(struct fb_info *info)
>  	case 0x0146:
>  	case 0x0147:
>  	case 0x0148:
> +	case 0x0098:
> +	case 0x0099:
>  		mobile = 1;
>  		break;
>  	default:
> _



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

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

end of thread, other threads:[~2006-01-10  3:28 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-07  8:33 [PATCH] nvidiafb: Fix 6xxx/7xxx cards Benjamin Herrenschmidt
2005-12-08 20:54 ` Antonino A. Daplas
2005-12-08 22:17   ` Benjamin Herrenschmidt
2005-12-08 22:54     ` Antonino A. Daplas
2005-12-11  7:54       ` Benjamin Herrenschmidt
2006-01-09  2:32         ` Benjamin Herrenschmidt
2006-01-09  3:13           ` Andrew Morton
2006-01-09  4:13             ` Benjamin Herrenschmidt
2006-01-09  5:43               ` Andrew Morton
2006-01-09  6:38                 ` Benjamin Herrenschmidt
2006-01-10  1:23             ` Antonino A. Daplas
2006-01-10  1:26             ` Antonino A. Daplas
2006-01-10  2:35               ` Benjamin Herrenschmidt
2006-01-10  3:08                 ` Andrew Morton
2006-01-10  3:23                   ` Benjamin Herrenschmidt

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).