Skip to contentSkip to conversation

2.4.20 AGP for I845 wrong ?

DISCUSSION Nicolas ASPERT 4 participants 10 messages Dec 11, 2002 – Dec 12, 2002 1 message not in the archive Char and misc drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 9 lines · Margit Schubert-While

From drivers/char/agp/agpgart_be.c
4554,4559

    { PCI_DEVICE_ID_INTEL_845_G_0,
                 PCI_VENDOR_ID_INTEL,
                 INTEL_I845_G,
                 "Intel",
                 "i845G",
                 intel_830mp_setup },
Quoted 3 lines

Surely this is wrong or ?
Should be "intel_845_setup", I think.

IIRC, the 845G is a "new" version of the 830MP chipset (it had been added by Abraham vd Merwe & Graeme Fisher some months ago), but acts basically just as the 830MP. Therefore the entry is correct.... Or maybe if it gets confusing adding a comment would not hurt...

Quoted 3 lines

Also in drivers/char/drm/drm_agpsupport.h, the switch statement at 262 is missing the cases for INTEL_I830_M, INTEL_I845_G.

That's true. It is also missing in 2.5.51.
I attach two patches, one for 2.4.21-pre1 and one for 2.5.51 that should fix this.

Regards

Nicolas.

drivers/char/drm/drm_agpsupport.h +2 -0
diff -ru linux-2.4.21-pre1.clean/drivers/char/drm/drm_agpsupport.h linux-2.4.21-pre1/drivers/char/drm/drm_agpsupport.h
@@ -267,8 +267,10 @@
 		case INTEL_I810:	head->chipset = "Intel i810";    break;
 		case INTEL_I815:	head->chipset = "Intel i815";	 break;
 	 	case INTEL_I820:	head->chipset = "Intel i820";	 break;
+		case INTEL_I830_M:	head->chipset = "Intel i830M";	 break;
 		case INTEL_I840:	head->chipset = "Intel i840";    break;
 		case INTEL_I845:	head->chipset = "Intel i845";    break;
+		case INTEL_I845_G:	head->chipset = "Intel i845G";	 break;
 		case INTEL_I850:	head->chipset = "Intel i850";	 break;
 
 		case VIA_GENERIC:	head->chipset = "VIA";           break;
drivers/char/drm/drm_agpsupport.h +2 -0
diff -ru linux-2.5.51.clean/drivers/char/drm/drm_agpsupport.h linux-2.5.51/drivers/char/drm/drm_agpsupport.h
@@ -271,10 +271,12 @@
 #if LINUX_VERSION_CODE >= 0x02040f /* KERNEL_VERSION(2,4,15) */
 	 	case INTEL_I820:	head->chipset = "Intel i820";	 break;
 #endif
+		case INTEL_I830_M:	head->chipset = "Intel i830M";	 break;
 		case INTEL_I840:	head->chipset = "Intel i840";    break;
 #if LINUX_VERSION_CODE >= 0x02040f /* KERNEL_VERSION(2,4,15) */
 		case INTEL_I845:	head->chipset = "Intel i845";    break;
 #endif
+		case INTEL_I845:	head->chipset = "Intel i845G";	 break;
 		case INTEL_I850:	head->chipset = "Intel i850";	 break;
 		case INTEL_460GX:	head->chipset = "Intel 460GX";	 break;
 
#2 lore raw
Quoted 4 lines · Nicolas ASPERT

IIRC, the 845G is a "new" version of the 830MP chipset (it had been added by Abraham vd Merwe & Graeme Fisher some months ago), but acts basically just as the 830MP. Therefore the entry is correct.... Or maybe if it gets confusing adding a comment would not hurt...

I'll check the chipset docs when I get time, and add a comment if necessary. No-one seems to be complaining that it isn't working, so I'm inclined to believe your diagnosis is correct.

Quoted 11 lines
Quoted 3 lines

Also in drivers/char/drm/drm_agpsupport.h, the switch statement at 262 is missing the
cases for INTEL_I830_M, INTEL_I845_G.

That's true. It is also missing in 2.5.51.
I attach two patches, one for 2.4.21-pre1 and one for 2.5.51 that should
fix this.
diff -ru linux-2.5.51.clean/drivers/char/drm/drm_agpsupport.h linux-2.5.51/drivers/char/drm/drm_agpsupport.h

drivers/char/drm/drm_agpsupport.h +0 -0
@@ -271,10 +271,12 @@
 #if LINUX_VERSION_CODE >= 0x02040f /* KERNEL_VERSION(2,4,15) */

drivers/char/drm/drm_agpsupport.h line 281

Quoted 10 lines
drivers/char/drm/drm_agpsupport.h +2 -0
 	 	case INTEL_I820:	head->chipset = "Intel i820";	 break;
 #endif
+		case INTEL_I830_M:	head->chipset = "Intel i830M";	 break;
 		case INTEL_I840:	head->chipset = "Intel i840";    break;
 #if LINUX_VERSION_CODE >= 0x02040f /* KERNEL_VERSION(2,4,15) */
 		case INTEL_I845:	head->chipset = "Intel i845";    break;
 #endif
+		case INTEL_I845:	head->chipset = "Intel i845G";	 break;
 		case INTEL_I850:	head->chipset = "Intel i850";	 break;
 		case INTEL_460GX:	head->chipset = "Intel 460GX";	 break;

DRI folks, this seems like duplication given that this data is available in agpgart. How about changing this to read whatever agpgart has set in .chipset_name ?

Keeping these two lists in sync seems somewhat pointless.

Dave

Signature · 2 lines
| Dave Jones.        http://www.codemonkey.org.uk
| SuSE Labs
#3 lore raw
Quoted 4 lines · Dave Jones

I'll check the chipset docs when I get time, and add a comment if necessary. No-one seems to be complaining that it isn't working, so I'm inclined to believe your diagnosis is correct.

I found the thread of lkml containing the discussion about that ... here is the link to the original mail :

http://marc.theaimsgroup.com/?l=linux-kernel&m=102122146829865&w=2

Quoted 4 lines

DRI folks, this seems like duplication given that this data is available in agpgart. How about changing this to read whatever agpgart has set in .chipset_name ?

Sounds like a good idea to me ;-)

Best regards
Nicolas.

Signature · 2 lines
Nicolas Aspert      Signal Processing Institute (ITS)
Swiss Federal Institute of Technology (EPFL)
#4 lore raw
In reply to Dave Jones
Quoted 36 lines · Dave Jones
Quoted 4 lines · Nicolas ASPERT

IIRC, the 845G is a "new" version of the 830MP chipset (it had been added by Abraham vd Merwe & Graeme Fisher some months ago), but acts basically just as the 830MP. Therefore the entry is correct.... Or maybe if it gets confusing adding a comment would not hurt...

I'll check the chipset docs when I get time, and add a comment if necessary. No-one seems to be complaining that it isn't working, so I'm inclined to believe your diagnosis is correct.

Quoted 11 lines
Quoted 3 lines

Also in drivers/char/drm/drm_agpsupport.h, the switch statement at 262 is missing the
cases for INTEL_I830_M, INTEL_I845_G.

That's true. It is also missing in 2.5.51.
I attach two patches, one for 2.4.21-pre1 and one for 2.5.51 that should
fix this.
diff -ru linux-2.5.51.clean/drivers/char/drm/drm_agpsupport.h linux-2.5.51/drivers/char/drm/drm_agpsupport.h

drivers/char/drm/drm_agpsupport.h +0 -0
@@ -271,10 +271,12 @@
 #if LINUX_VERSION_CODE >= 0x02040f /* KERNEL_VERSION(2,4,15) */

drivers/char/drm/drm_agpsupport.h line 281

Quoted 10 lines
drivers/char/drm/drm_agpsupport.h +2 -0
 	 	case INTEL_I820:	head->chipset = "Intel i820";	 break;
 #endif
+		case INTEL_I830_M:	head->chipset = "Intel i830M";	 break;
 		case INTEL_I840:	head->chipset = "Intel i840";    break;
 #if LINUX_VERSION_CODE >= 0x02040f /* KERNEL_VERSION(2,4,15) */
 		case INTEL_I845:	head->chipset = "Intel i845";    break;
 #endif
+		case INTEL_I845:	head->chipset = "Intel i845G";	 break;
 		case INTEL_I850:	head->chipset = "Intel i850";	 break;
 		case INTEL_460GX:	head->chipset = "Intel 460GX";	 break;

DRI folks, this seems like duplication given that this data is available in agpgart. How about changing this to read whatever agpgart has set in .chipset_name ?

Quoted 1 line

Keeping these two lists in sync seems somewhat pointless.

Yes, it's not even clear what particular use the string is. It looks like it's just for the print statement at the bottom of the switch. It would be safe to remove the whole thing -- agpgart has already printed out what hardware *it's* dealing with.

Keith

#5 lore raw
In reply to Dave Jones
Quoted 5 lines

DRI folks, this seems like duplication given that this data is available in agpgart. How about changing this to read whatever agpgart has set in .chipset_name ?

And it looks like the mechanism that drm uses for quering agp doesn't return the string in question. (I don't really understand the mechanism these two modules use to talk to each other).

In any case I don't think the string in the informational is very useful -- it's a potentially inaccurate translation of state from *another* module, so I'm just removing the lot.

Keith

#6 lore raw
Quoted 3 lines · Keith Whitwell

In any case I don't think the string in the informational is very useful -- it's a potentially inaccurate translation of state from *another* module, so I'm just removing the lot.

Cool, that gets my vote too 8-)

Dave

Signature · 2 lines
| Dave Jones.        http://www.codemonkey.org.uk
| SuSE Labs
#7 lore raw
Quoted 9 lines · Dave Jones
Quoted 3 lines · Keith Whitwell

In any case I don't think the string in the informational is very useful -- it's a potentially inaccurate translation of state from *another* module, so I'm just removing the lot.

Cool, that gets my vote too 8-)

Dave

Here's the changes I've committed to dri cvs.

Keith

? diff
Index: drmP.h
===================================================================
RCS file: /cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h,v retrieving revision 1.54

drmP.h +0 -1
diff -u -r1.54 drmP.h
@@ -488,7 +488,6 @@
 
 typedef struct drm_agp_head {
 	agp_kern_info      agp_info;
-	const char         *chipset;
 	drm_agp_mem_t      *memory;
 	unsigned long      mode;
 	int                enabled;

Index: drm_agpsupport.h
===================================================================
RCS file: /cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_agpsupport.h,v retrieving revision 1.9

drm_agpsupport.h +6 -61

79 lines not on this page · raw message

#8 lore raw
In reply to Nicolas ASPERT
Quoted 10 lines · Nicolas ASPERT
Quoted 9 lines · Margit Schubert-While

From drivers/char/agp/agpgart_be.c
4554,4559

    { PCI_DEVICE_ID_INTEL_845_G_0,
                 PCI_VENDOR_ID_INTEL,
                 INTEL_I845_G,
                 "Intel",
                 "i845G",
                 intel_830mp_setup },
Quoted 8 lines
Quoted 3 lines

Surely this is wrong or ?
Should be "intel_845_setup", I think.

IIRC, the 845G is a "new" version of the 830MP chipset (it had been added by Abraham vd Merwe & Graeme Fisher some months ago), but acts basically just as the 830MP. Therefore the entry is correct.... Or maybe if it gets confusing adding a comment would not hurt...

No, I think it should be intel_845_setup too, since the 845G docs on Intel's public web site show that the behaviour is like the 845 when the on-board graphics isn't enabled. I made that change in my locally maintained version of the agpgart driver a little while ago, but haven't had the opportunity to test it with an external AGP card in an 845G box yet.

David

Signature · 3 lines
David Dawes
Release Engineer/Architect                      The XFree86 Project
www.XFree86.org/~dawes
#9 lore raw
Quoted 7 lines · David Dawes

No, I think it should be intel_845_setup too, since the 845G docs on Intel's public web site show that the behaviour is like the 845 when the on-board graphics isn't enabled. I made that change in my locally maintained version of the agpgart driver a little while ago, but haven't had the opportunity to test it with an external AGP card in an 845G box yet.

Damn, you're right. Now I got the docs from Intel (at the time were the patch to support 845g was submitted, they were just not available yet), and truly the specs are closer to the 845, so let's switch to 'intel_845_setup' to initialize the 845g. Not that it should change things too much, but it will avoid further confusions....

Best regards.

Nicolas

PS: I hope the IBM annoyances for mails sent to lkml stopped...

Signature · 2 lines
Nicolas Aspert      Signal Processing Institute (ITS)
Swiss Federal Institute of Technology (EPFL)
#10 lore raw
In reply to a message not in the archive

Ooops... the patch I sent for 2.5.51 is wrong, since there I added a INTEL_I845 instead of a INTEL_I845_G (I know vim *does* weird things in my back 8-)

Here is the correct one...

Regards

Nicolas.

Signature · 2 lines
Nicolas Aspert      Signal Processing Institute (ITS)
Swiss Federal Institute of Technology (EPFL)
drivers/char/drm/drm_agpsupport.h +2 -0
diff -ru linux-2.5.51.clean/drivers/char/drm/drm_agpsupport.h linux-2.5.51/drivers/char/drm/drm_agpsupport.h
@@ -271,10 +271,12 @@
 #if LINUX_VERSION_CODE >= 0x02040f /* KERNEL_VERSION(2,4,15) */
 	 	case INTEL_I820:	head->chipset = "Intel i820";	 break;
 #endif
+		case INTEL_I830_M:	head->chipset = "Intel i830M";	 break;
 		case INTEL_I840:	head->chipset = "Intel i840";    break;
 #if LINUX_VERSION_CODE >= 0x02040f /* KERNEL_VERSION(2,4,15) */
 		case INTEL_I845:	head->chipset = "Intel i845";    break;
 #endif
+		case INTEL_I845_G:	head->chipset = "Intel i845G";	 break;
 		case INTEL_I850:	head->chipset = "Intel i850";	 break;
 		case INTEL_460GX:	head->chipset = "Intel 460GX";	 break;