bk://linux-dj.bkbits.net/agpgart
davej@redhat.com|ChangeSet|20040630153047|35688 davej

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/06/30 11:14:29-07:00 akpm@bix.(none) 
#   Merge bk://linux-dj.bkbits.net/agpgart
#   into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/06/30 11:14:25-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/06/30 16:30:47+01:00 davej@redhat.com 
#   [AGPGART] K8T800 Pro support in amd64 driver.
#   
#   Signed-off-by: Kris Kersey <augustus@linuxhardware.org>
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# include/linux/pci_ids.h
#   2004/06/30 16:30:39+01:00 davej@redhat.com +2 -1
#   [AGPGART] K8T800 Pro support in amd64 driver.
#   
#   Signed-off-by: Kris Kersey <augustus@linuxhardware.org>
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# drivers/char/agp/amd64-agp.c
#   2004/06/30 16:30:39+01:00 davej@redhat.com +9 -0
#   [AGPGART] K8T800 Pro support in amd64 driver.
#   
#   Signed-off-by: Kris Kersey <augustus@linuxhardware.org>
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# ChangeSet
#   2004/06/29 23:29:58+01:00 davej@redhat.com 
#   [AGPGART] Fix sparse NULL pointer warnings.
#   
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# drivers/char/agp/intel-mch-agp.c
#   2004/06/29 23:29:51+01:00 davej@redhat.com +1 -1
#   [AGPGART] Fix sparse NULL pointer warnings.
#   
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# drivers/char/agp/intel-agp.c
#   2004/06/29 23:29:51+01:00 davej@redhat.com +1 -1
#   [AGPGART] Fix sparse NULL pointer warnings.
#   
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# drivers/char/agp/generic.c
#   2004/06/29 23:29:51+01:00 davej@redhat.com +1 -1
#   [AGPGART] Fix sparse NULL pointer warnings.
#   
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# ChangeSet
#   2004/06/24 17:55:41-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/06/24 17:55:38-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/06/25 00:45:49+01:00 davej@redhat.com 
#   [AGPGART] Fix silly logic bug in AGPx8 ->x4 fallback code.
#   Spotted by Rainer Klier
#   
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# drivers/char/agp/generic.c
#   2004/06/25 00:36:04+01:00 davej@redhat.com +3 -3
#   [AGPGART] Fix silly logic bug in AGPx8 ->x4 fallback code.
#   Spotted by Rainer Klier
#   
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# ChangeSet
#   2004/06/24 12:34:52-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/06/24 12:34:48-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/06/18 11:39:25-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/06/18 11:39:21-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/06/16 19:15:26+01:00 davej@redhat.com 
#   [AGPGART] Remove typo from comment
#   
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# drivers/char/agp/generic.c
#   2004/06/16 19:15:19+01:00 davej@redhat.com +1 -1
#   [AGPGART] Remove typo from comment
#   
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# ChangeSet
#   2004/06/16 19:13:54+01:00 davej@redhat.com 
#   [AGPGART] Extra debugging info just in case.
#   
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# drivers/char/agp/generic.c
#   2004/06/16 19:13:47+01:00 davej@redhat.com +5 -1
#   [AGPGART] Extra debugging info just in case.
#   
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# ChangeSet
#   2004/06/16 19:10:02+01:00 davej@redhat.com 
#   [AGPGART] Improved AGPx8 handling.
#   
#   If something fails, we should now explain what happened,
#   before we fall back to AGPx4 gracefully.
#   
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# drivers/char/agp/generic.c
#   2004/06/16 19:09:52+01:00 davej@redhat.com +20 -10
#   [AGPGART] Improved AGPx8 handling.
#   
#   If something fails, we should now explain what happened,
#   before we fall back to AGPx4 gracefully.
#   
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# ChangeSet
#   2004/06/16 18:48:42+01:00 davej@redhat.com 
#   [AGPGART] Show the untampered arguments in debug printk
#   
#   agp_v3_parse_one() does some changes to these args by the time we
#   get to the printk. It'll be useful to know what they started at.
#   
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# drivers/char/agp/generic.c
#   2004/06/16 18:48:35+01:00 davej@redhat.com +5 -1
#   [AGPGART] Show the untampered arguments in debug printk
#   
#   agp_v3_parse_one() does some changes to these args by the time we
#   get to the printk. It'll be useful to know what they started at.
#   
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# ChangeSet
#   2004/06/16 18:45:00+01:00 davej@redhat.com 
#   [AGPGART] If we can't do AGP x8 in v3 mode, just drop back to x4.
#   
#   This should stop people seeing crazy stuff like agpgart
#   trying to set itself to x0 mode when it sees a x8 bridge and a x4 card.
#   
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# drivers/char/agp/generic.c
#   2004/06/16 18:44:53+01:00 davej@redhat.com +20 -4
#   [AGPGART] If we can't do AGP x8 in v3 mode, just drop back to x4.
#   
#   This should stop people seeing crazy stuff like agpgart
#   trying to set itself to x0 mode when it sees a x8 bridge and a x4 card.
#   
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# ChangeSet
#   2004/06/16 18:21:23+01:00 davej@redhat.com 
#   [AGPGART] Delete trailing whitespace in generic routines.
#   
#   Bump copyright dates whilst we're there.
#   
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# drivers/char/agp/generic.c
#   2004/06/16 18:21:13+01:00 davej@redhat.com +20 -20
#   [AGPGART] Delete trailing whitespace in generic routines.
#   
#   Bump copyright dates whilst we're there.
#   
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# ChangeSet
#   2004/06/16 17:35:44+01:00 davej@redhat.com 
#   [AGPGART] Re-add VIA VP3 support.
#   
#   The refactoring of the PCI IDs supported by the VIA driver dropped
#   this one.
#   
#   Spotted-by: Carsten Rietzschel
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# drivers/char/agp/via-agp.c
#   2004/06/16 17:35:37+01:00 davej@redhat.com +1 -0
#   [AGPGART] Re-add VIA VP3 support.
#   
#   The refactoring of the PCI IDs supported by the VIA driver dropped
#   this one.
#   
#   Spotted-by: Carsten Rietzschel
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# ChangeSet
#   2004/06/15 21:00:09-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/06/15 21:00:06-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/06/08 17:39:37+01:00 davej@redhat.com 
#   [AGPGART] Don't waffle about unsupported serverworks chipsets if they don't do AGP.
#   From: Matt Domsch
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# drivers/char/agp/sworks-agp.c
#   2004/06/08 17:38:04+01:00 davej@redhat.com +7 -3
#   [AGPGART] Don't waffle about unsupported serverworks chipsets if they don't do AGP.
#   From: Matt Domsch
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# ChangeSet
#   2004/06/06 13:56:07+01:00 davej@redhat.com 
#   [AGPGART] Kconfig Typo fix
#   From: Tuncer M zayamut Ayaz
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# drivers/char/agp/Kconfig
#   2004/06/06 13:55:59+01:00 davej@redhat.com +1 -1
#   [AGPGART] Kconfig Typo fix
#   From: Tuncer M zayamut Ayaz
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# ChangeSet
#   2004/06/03 10:16:23-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/06/03 10:16:20-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/06/02 13:13:23-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/06/02 13:13:19-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/06/01 11:02:53-07:00 akpm@bix.(none) 
#   Merge bk://linux-dj.bkbits.net/agpgart
#   into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/06/01 11:02:49-07:00 akpm@bix.(none) +1 -0
#   Auto merged
# 
# ChangeSet
#   2004/05/28 16:57:21-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/05/28 16:57:18-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/05/28 13:14:32-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/05/28 13:14:29-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/05/24 11:19:17-07:00 akpm@bix.(none) 
#   Merge bk://linux-dj.bkbits.net/agpgart
#   into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/05/24 11:19:14-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
diff -Nru a/drivers/char/agp/Kconfig b/drivers/char/agp/Kconfig
--- a/drivers/char/agp/Kconfig	2004-06-30 11:15:26 -07:00
+++ b/drivers/char/agp/Kconfig	2004-06-30 11:15:26 -07:00
@@ -165,7 +165,7 @@
 	tristate "Transmeta Efficeon support"
 	depends on AGP && X86 && !X86_64
 	help
-	  This option fives you AGP support for the Transmeta Efficeon
+	  This option gives you AGP support for the Transmeta Efficeon
 	  series processors with integrated northbridges.
 
 	  You should say Y here if you use XFree86 3.3.6 or 4.x and want to
diff -Nru a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
--- a/drivers/char/agp/amd64-agp.c	2004-06-30 11:15:26 -07:00
+++ b/drivers/char/agp/amd64-agp.c	2004-06-30 11:15:26 -07:00
@@ -536,6 +536,15 @@
 	.subvendor	= PCI_ANY_ID,
 	.subdevice	= PCI_ANY_ID,
 	},
+	/* VIA K8T800Pro */
+	{
+	.class		= (PCI_CLASS_BRIDGE_HOST << 8),
+	.class_mask	= ~0,
+	.vendor		= PCI_VENDOR_ID_VIA,
+	.device		= PCI_DEVICE_ID_VIA_K8T800PRO_0,
+	.subvendor	= PCI_ANY_ID,
+	.subdevice	= PCI_ANY_ID,
+	},
 	/* VIA K8T800 */
 	{
 	.class		= (PCI_CLASS_BRIDGE_HOST << 8),
diff -Nru a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
--- a/drivers/char/agp/generic.c	2004-06-30 11:15:26 -07:00
+++ b/drivers/char/agp/generic.c	2004-06-30 11:15:26 -07:00
@@ -1,6 +1,6 @@
 /*
  * AGPGART driver.
- * Copyright (C) 2002-2003 Dave Jones.
+ * Copyright (C) 2002-2004 Dave Jones.
  * Copyright (C) 1999 Jeff Hartmann.
  * Copyright (C) 1999 Precision Insight, Inc.
  * Copyright (C) 1999 Xi Graphics, Inc.
@@ -18,12 +18,12 @@
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, 
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 
+ * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  *
- * TODO: 
+ * TODO:
  * - Allocate more than order 0 pages to avoid too much linear map splitting.
  */
 #include <linux/config.h>
@@ -37,7 +37,7 @@
 #include <linux/vmalloc.h>
 #include "agp.h"
 
-__u32 *agp_gatt_table; 
+__u32 *agp_gatt_table;
 int agp_memory_reserved;
 
 /*
@@ -46,7 +46,7 @@
  */
 EXPORT_SYMBOL_GPL(agp_memory_reserved);
 
-/* 
+/*
  * Generic routines for handling agp_memory structures -
  * They use the basic page allocation routines to do the brunt of the work.
  */
@@ -142,12 +142,12 @@
  *	agp_allocate_memory  -  allocate a group of pages of a certain type.
  *
  *	@page_count:	size_t argument of the number of pages
- *	@type:	u32 argument of the type of memory to be allocated.  
+ *	@type:	u32 argument of the type of memory to be allocated.
  *
  *	Every agp bridge device will allow you to allocate AGP_NORMAL_MEMORY which
  *	maps to physical ram.  Any other type is device dependent.
  *
- *	It returns NULL whenever memory is unavailable. 
+ *	It returns NULL whenever memory is unavailable.
  */
 struct agp_memory *agp_allocate_memory(size_t page_count, u32 type)
 {
@@ -311,7 +311,7 @@
 
 /**
  *	agp_bind_memory  -  Bind an agp_memory structure into the GATT.
- * 
+ *
  *	@curr:		agp_memory pointer
  *	@pg_start:	an offset into the graphics aperture translation table
  *
@@ -347,9 +347,9 @@
 
 /**
  *	agp_unbind_memory  -  Removes an agp_memory structure from the GATT
- * 
+ *
  * @curr:	agp_memory pointer to be removed from the GATT.
- * 
+ *
  * It returns -EINVAL if this piece of agp_memory is not currently bound to
  * the graphics aperture translation table or if the agp_memory pointer == NULL
  */
@@ -404,12 +404,18 @@
 		*cmd &= ~(AGPSTAT2_1X | AGPSTAT2_4X);	/* 2X */
 
 	if (*cmd & AGPSTAT2_1X)
-		*cmd &= ~(AGPSTAT2_2X | AGPSTAT2_4X);	/* 1Xf */
+		*cmd &= ~(AGPSTAT2_2X | AGPSTAT2_4X);	/* 1X */
 }
 
-
+/*
+ * mode = requested mode.
+ * cmd = PCI_AGP_STATUS from agp bridge.
+ * tmp = PCI_AGP_STATUS from graphic card.
+ */
 static void agp_v3_parse_one(u32 *mode, u32 *cmd, u32 *tmp)
 {
+	u32 origcmd=*cmd, origtmp=*tmp;
+
 	/* ARQSZ - Set the value to the maximum one.
 	 * Don't allow the mode register to override values. */
 	*cmd = ((*cmd & ~AGPSTAT_ARQSZ) |
@@ -452,17 +458,43 @@
 		*mode |= AGPSTAT3_4X;
 	}
 
-	if (!((*cmd & AGPSTAT3_8X) && (*tmp & AGPSTAT3_8X) && (*mode & AGPSTAT3_8X)))
-		*cmd &= ~AGPSTAT3_8X;
+	if (*mode & AGPSTAT3_8X) {
+		if (!(*cmd & AGPSTAT3_8X)) {
+			*cmd &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD);
+			*cmd |= AGPSTAT3_4X;
+			printk ("%s requested AGPx8 but bridge not capable.\n", current->comm);
+			return;
+		}
+		if (!(*tmp & AGPSTAT3_8X)) {
+			*cmd &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD);
+			*cmd |= AGPSTAT3_4X;
+			printk ("%s requested AGPx8 but graphic card not capable.\n", current->comm);
+			return;
+		}
+		/* All set, bridge & device can do AGP x8*/
+		*cmd &= ~(AGPSTAT3_4X | AGPSTAT3_RSVD);
+		return;
 
-	if (!((*cmd & AGPSTAT3_4X) && (*tmp & AGPSTAT3_4X) && (*mode & AGPSTAT3_4X)))
-		*cmd &= ~AGPSTAT3_4X;
+	} else {
 
-	/* Clear out unwanted bits. */
-	if (*cmd & AGPSTAT3_8X)
-		*cmd &= ~(AGPSTAT3_4X | AGPSTAT3_RSVD);
-	if (*cmd & AGPSTAT3_4X)
+		/*
+		 * If we didn't specify AGPx8, we can only do x4.
+		 * If the hardware can't do x4, we're up shit creek, and never
+		 *  should have got this far.
+		 */
 		*cmd &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD);
+		if ((*cmd & AGPSTAT3_4X) && (*tmp & AGPSTAT3_4X))
+			*cmd |= AGPSTAT3_4X;
+		else {
+			printk (KERN_INFO PFX "Badness. Don't know which AGP mode to set. "
+							"[cmd:%x tmp:%x fell back to:- cmd:%x tmp:%x]\n",
+							origcmd, origtmp, *cmd, *tmp);
+			if (!(*cmd & AGPSTAT3_4X))
+				printk (KERN_INFO PFX "Bridge couldn't do AGP x4.\n");
+			if (!(*tmp & AGPSTAT3_4X))
+				printk (KERN_INFO PFX "Graphic card couldn't do AGP x4.\n");
+		}
+	}
 }
 
 //FIXME: This doesn't smell right.
@@ -479,8 +511,10 @@
 		if (!cap_ptr)
 			continue;
 
+		//FIXME: We should probably skip anything here that
+		// isn't an AGP graphic card.
 		/*
-		 * Ok, here we have a AGP device. Disable impossible 
+		 * Ok, here we have a AGP device. Disable impossible
 		 * settings, and adjust the readqueue to the minimum.
 		 */
 		pci_read_config_dword(device, cap_ptr+PCI_AGP_STATUS, &tmp);
@@ -489,7 +523,7 @@
 		cmd = ((cmd & ~AGPSTAT_RQ_DEPTH) |
 		     min_t(u32, (mode & AGPSTAT_RQ_DEPTH),
 			 min_t(u32, (cmd & AGPSTAT_RQ_DEPTH), (tmp & AGPSTAT_RQ_DEPTH))));
-		
+
 		/* disable FW if it's not supported */
 		if (!((cmd & AGPSTAT_FW) && (tmp & AGPSTAT_FW) && (mode & AGPSTAT_FW)))
 			cmd &= ~AGPSTAT_FW;
@@ -663,7 +697,7 @@
 					    agp_bridge->current_size;
 					break;
 				}
-				temp = agp_bridge->current_size;	
+				temp = agp_bridge->current_size;
 			} else {
 				agp_bridge->aperture_size_idx = i;
 			}
@@ -684,7 +718,7 @@
 		SetPageReserved(page);
 
 	agp_bridge->gatt_table_real = (u32 *) table;
-	agp_gatt_table = (void *)table; 
+	agp_gatt_table = (void *)table;
 
 	agp_bridge->driver->cache_flush();
 	agp_bridge->gatt_table = ioremap_nocache(virt_to_phys(table),
@@ -870,9 +904,9 @@
 EXPORT_SYMBOL(agp_generic_free_by_type);
 
 
-/* 
+/*
  * Basic Page Allocation Routines -
- * These routines handle page allocation and by default they reserve the allocated 
+ * These routines handle page allocation and by default they reserve the allocated
  * memory.  They also handle incrementing the current_memory_agp value, Which is checked
  * against a maximum value.
  */
@@ -883,7 +917,7 @@
 
 	page = alloc_page(GFP_KERNEL);
 	if (page == NULL)
-		return 0;
+		return NULL;
 
 	map_page_into_agp(page);
 
@@ -914,9 +948,9 @@
 /* End Basic Page Allocation Routines */
 
 
-/** 
+/**
  * agp_enable  -  initialise the agp point-to-point connection.
- * 
+ *
  * @mode:	agp mode register value to configure with.
  */
 void agp_enable(u32 mode)
diff -Nru a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
--- a/drivers/char/agp/intel-agp.c	2004-06-30 11:15:26 -07:00
+++ b/drivers/char/agp/intel-agp.c	2004-06-30 11:15:26 -07:00
@@ -369,7 +369,7 @@
 	size = agp_bridge->current_size;
 	page_order = size->page_order;
 	num_entries = size->num_entries;
-	agp_bridge->gatt_table_real = 0;
+	agp_bridge->gatt_table_real = NULL;
 
 	pci_read_config_dword(intel_i830_private.i830_dev,I810_MMADDR,&temp);
 	temp &= 0xfff80000;
diff -Nru a/drivers/char/agp/intel-mch-agp.c b/drivers/char/agp/intel-mch-agp.c
--- a/drivers/char/agp/intel-mch-agp.c	2004-06-30 11:15:26 -07:00
+++ b/drivers/char/agp/intel-mch-agp.c	2004-06-30 11:15:26 -07:00
@@ -167,7 +167,7 @@
 	size = agp_bridge->current_size;
 	page_order = size->page_order;
 	num_entries = size->num_entries;
-	agp_bridge->gatt_table_real = 0;
+	agp_bridge->gatt_table_real = NULL;
 
 	pci_read_config_dword(intel_i830_private.i830_dev,I810_MMADDR,&temp);
 	temp &= 0xfff80000;
diff -Nru a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c
--- a/drivers/char/agp/sworks-agp.c	2004-06-30 11:15:26 -07:00
+++ b/drivers/char/agp/sworks-agp.c	2004-06-30 11:15:26 -07:00
@@ -447,6 +447,7 @@
 	struct agp_bridge_data *bridge;
 	struct pci_dev *bridge_dev;
 	u32 temp, temp2;
+	u8 cap_ptr = 0;
 
 	/* Everything is on func 1 here so we are hardcoding function one */
 	bridge_dev = pci_find_slot((unsigned int)pdev->bus->number,
@@ -457,6 +458,8 @@
 		return -ENODEV;
 	}
 
+	cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP);
+
 	switch (pdev->device) {
 	case 0x0006:
 		/* ServerWorks CNB20HE
@@ -470,14 +473,15 @@
 		break;
 
 	default:
-		printk(KERN_ERR PFX "Unsupported Serverworks chipset "
-				"(device id: %04x)\n", pdev->device);
+		if (cap_ptr)
+			printk(KERN_ERR PFX "Unsupported Serverworks chipset "
+					"(device id: %04x)\n", pdev->device);
 		return -ENODEV;
 	}
 
 	serverworks_private.svrwrks_dev = bridge_dev;
 	serverworks_private.gart_addr_ofs = 0x10;
-	
+
 	pci_read_config_dword(pdev, SVWRKS_APSIZE, &temp);
 	if (temp & PCI_BASE_ADDRESS_MEM_TYPE_64) {
 		pci_read_config_dword(pdev, SVWRKS_APSIZE + 4, &temp2);
diff -Nru a/drivers/char/agp/via-agp.c b/drivers/char/agp/via-agp.c
--- a/drivers/char/agp/via-agp.c	2004-06-30 11:15:26 -07:00
+++ b/drivers/char/agp/via-agp.c	2004-06-30 11:15:26 -07:00
@@ -434,6 +434,7 @@
 	.subvendor	= PCI_ANY_ID,			\
 	.subdevice	= PCI_ANY_ID,			\
 	}
+	ID(PCI_DEVICE_ID_VIA_82C597_0),
 	ID(PCI_DEVICE_ID_VIA_82C598_0),
 	ID(PCI_DEVICE_ID_VIA_8501_0),
 	ID(PCI_DEVICE_ID_VIA_8601_0),
diff -Nru a/include/linux/pci_ids.h b/include/linux/pci_ids.h
--- a/include/linux/pci_ids.h	2004-06-30 11:15:26 -07:00
+++ b/include/linux/pci_ids.h	2004-06-30 11:15:26 -07:00
@@ -1176,7 +1176,8 @@
 #define PCI_DEVICE_ID_VIA_8763_0	0x0198
 #define PCI_DEVICE_ID_VIA_8380_0	0x0204
 #define PCI_DEVICE_ID_VIA_PX8X0_0	0x0259
-#define PCI_DEVICE_ID_VIA_8363_0	0x0305 
+#define PCI_DEVICE_ID_VIA_K8T800PRO_0	0x0282
+#define PCI_DEVICE_ID_VIA_8363_0	0x0305
 #define PCI_DEVICE_ID_VIA_8371_0	0x0391
 #define PCI_DEVICE_ID_VIA_8501_0	0x0501
 #define PCI_DEVICE_ID_VIA_82C505	0x0505
@@ -2036,6 +2037,7 @@
 #define PCI_DEVICE_ID_INTEL_82092AA_0	0x1221
 #define PCI_DEVICE_ID_INTEL_82092AA_1	0x1222
 #define PCI_DEVICE_ID_INTEL_7116	0x1223
+#define PCI_DEVICE_ID_INTEL_7501_0	0x254c
 #define PCI_DEVICE_ID_INTEL_7505_0	0x2550  
 #define PCI_DEVICE_ID_INTEL_7505_1	0x2552  
 #define PCI_DEVICE_ID_INTEL_7205_0	0x255d