Skip to contentSkip to conversation

bug in Linux 2.4.19RC1 i815e agpgart module, unable to determineaperture size.

DISCUSSION Nicolas Aspert 1 participant 2 messages Jun 27, 2002 3 messages not in the archive Agpgart driver

lore
Share & tools
lore
#2 lore raw
In reply to a message not in the archive
Quoted 12 lines · Adrian Bunk

Since -rc1 agpgart_be.c uses for the 815 new 815-specific instead of the generic intel functions.

Could you try whether reverting the following part of the patch fixes the problem?

drivers/char/agp/agpgart_be.c line 4011

Quoted 8 lines
drivers/char/agp/agpgart_be.c +1 -1
@@ -3929,7 +4005,7 @@
 		INTEL_I815,
 		"Intel",
 		"i815",
-		intel_generic_setup },
+		intel_815_setup },
 	{ PCI_DEVICE_ID_INTEL_820_0,
 		PCI_VENDOR_ID_INTEL,
 		INTEL_I820,

Hello

I suspect that the problem (from what you sent) comes from the 'intel_8xx_fetch_size' function. The APSIZE register has only one bit with valuable information with intel815 chipset, all other bits are 'reserved'. The problem you saw may come from reading those reserved bits. I attach a patch against 2.4.19-rc1 that aims at fixing this. Could you please test and report whether things get better/worse ?

Best regards

Nicolas.

Signature · 2 lines
Nicolas Aspert      Signal Processing Institute (ITS)
Swiss Federal Institute of Technology (EPFL)
drivers/char/agp/agpgart_be.c +4 -0
diff -Nru linux-2.4.19-rc1.clean/drivers/char/agp/agpgart_be.c linux-2.4.19-rc1/drivers/char/agp/agpgart_be.c
@@ -1402,6 +1402,10 @@
 	aper_size_info_8 *values;
 
 	pci_read_config_byte(agp_bridge.dev, INTEL_APSIZE, &temp);
+
+        if (agp_bridge.type == INTEL_I815) 
+          temp &= (1 << 3);
+        
 	values = A_SIZE_8(agp_bridge.aperture_sizes);
 
 	for (i = 0; i < agp_bridge.num_aperture_sizes; i++) {
#4 lore raw

Re: bug in Linux 2.4.19RC1 i815e agpgart module, unable to determineaperturesize.

In reply to a message not in the archive
Quoted 5 lines · Knut J Bjuland

Your patch fix my problem with the new i815 code. I run it through a quake3 test and it is as fast as the old code,
Agpgart is now able to determine aperture size, I think you nailed this problem. Thank you for your patch, hope it get in Linux 2.4.19.

Ok that sounds like one bug killed ;-), so I guess this should go in for 2.4.19-rc2 ...

Marcelo, please apply (patch is against 2.4.19-rc1). I know that Alan and Dave have also similar parts in their trees and they are likely to suffer the same problem. Thanks Knut for pointing the problem (although it was present in 2.4.19-pre10-ac2 already for sure...)

Best regards
Nicolas.

Signature · 2 lines
Nicolas Aspert      Signal Processing Institute (ITS)
Swiss Federal Institute of Technology (EPFL)
drivers/char/agp/agpgart_be.c +6 -0
diff -Nru linux-2.4.19-rc1.clean/drivers/char/agp/agpgart_be.c linux-2.4.19-rc1/drivers/char/agp/agpgart_be.c
@@ -1402,6 +1402,12 @@
 	aper_size_info_8 *values;
 
 	pci_read_config_byte(agp_bridge.dev, INTEL_APSIZE, &temp);
+
+        /* Intel 815 chipsets have a _weird_ APSIZE register with only
+         * one non-reserved bit, so mask the others out ... */
+        if (agp_bridge.type == INTEL_I815) 
+          temp &= (1 << 3);
+        
 	values = A_SIZE_8(agp_bridge.aperture_sizes);
 
 	for (i = 0; i < agp_bridge.num_aperture_sizes; i++) {