Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Solve your agp issues with a kernel patch
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
nihues
n00b
n00b


Joined: 20 May 2003
Posts: 47
Location: Balneário Camboriú / SC

PostPosted: Tue Jul 31, 2007 6:10 pm    Post subject: Solve your agp issues with a kernel patch Reply with quote

Hello people, after almost 1 YEAR trying to figure out what the hell was going on with my agp and linux, I finally found a solution!


Well the problem is, nvidia or ati + agpgart + amd64-agp locks x11 or gives blank screen when entering or is slow fps compared to windows.
Problems related: Linux says agp size wrong, mtrr size is wrong, agp not working, status on agp on nvidia is disabled and related problems and others more...

It's not a nvidia or ati problem, it's a kernel bug not recognizing the agp right.

So, there are 2 choices:
Workaround 1: boot to windows and reboot to linux, then agp is working right... (worked here)
But this is not a good choice isn't? =)

Workaround 2: This is a bug on kernel-source still opened, below thers is the thread of the bug, it has many patches, I tried one for my motherboard and worked for me. Use the patch below to your current kernel source, I used lasted of gentoo-source ~x86 and worked perfect.

I tested only with Asus K8V-X SE, but it should work with all KT800* northbridge, asrock chipsets should work too, but there are more patches for others chipsets, see link in the end.

1. go to /usr/src/linux
2. create a empty file and paste the code below: nano agp_issue

Code:
Index: linux/drivers/pci/quirks.c
===================================================================
--- linux.orig/drivers/pci/quirks.c
+++ linux/drivers/pci/quirks.c
@@ -23,6 +23,20 @@
 #include <linux/acpi.h>
 #include "pci.h"
 
+static void quirk_asrock_agp_aperture(struct pci_dev *dev)
+{
+   u32 aper_base;
+
+   pci_read_config_dword(dev, 0x94, &aper_base);
+   printk("QUIRK aper_base = %x\n", aper_base);
+
+   aper_base &= 0x7f;
+
+   printk("QUIRK aper_base changed to %x\n", aper_base);
+   pci_write_config_dword(dev, 0x94, aper_base);
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x1103, quirk_asrock_agp_aperture);
+
 /* The Mellanox Tavor device gives false positive parity errors
  * Mark this device with a broken_parity_status, to allow
  * PCI scanning code to "skip" this now blacklisted device.


then patch the kernel: patch -p1 < agp_issue

then recompile and install your kernel, make sure agpgart and support for amd64 agp is module or enabled.

in xorg.conf my nvagp is set to 2 now, it was set to 1 (use nvagp) or 0 (disable agp) before, but with 2 (use kernel agp) always got locks or reboots.

What you gain with this? Well, you gain AGP working and performance gain, here is what I got now:

Before:
Quote:
mybox nihues # cat /proc/driver/nvidia/agp/status
Status: Disabled


After:
Quote:
mybox nihues # cat /proc/driver/nvidia/agp/status
Status: Enabled
Driver: AGPGART
AGP Rate: 8x
Fast Writes: Enabled
SBA: Enabled


Quake3 Before: ~82 fps
Quake3 After: ~112fps

It's a ~30% increase in 3d performance! It takes only 10min of your time too :)

There are more patches for other motherboars, but i can only test mine, if u have an agp graphic card and your agp is not working, you shoul look here http://bugzilla.kernel.org/show_bug.cgi?id=6350
Maybe this should be used in gentoo-sources patches? if people could test all the patches on that thread, at least some agp issues could be erased...
Back to top
View user's profile Send private message
nihues
n00b
n00b


Joined: 20 May 2003
Posts: 47
Location: Balneário Camboriú / SC

PostPosted: Fri Aug 31, 2007 4:09 pm    Post subject: Reply with quote

well, almost 1000 views, anyone tried? :P
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Sun Sep 02, 2007 4:36 am    Post subject: Reply with quote

It looks really handy and I've bookmarked it nihues but I don't have an amd64 atm. Nice one though, I'll recommend it to people on IRC.
Back to top
View user's profile Send private message
coldfinger
n00b
n00b


Joined: 15 Jan 2004
Posts: 44

PostPosted: Wed Sep 05, 2007 10:15 am    Post subject: Reply with quote

will test and report back...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum