Commit c33584a3 authored by Dave Jones's avatar Dave Jones Committed by Dave Jones

[AGPGART] Kill agp_generic_agp_3_0_enable, fold into agp_generic_agp_enable()

parent fc42ba91
...@@ -381,7 +381,6 @@ struct agp_driver { ...@@ -381,7 +381,6 @@ struct agp_driver {
/* Generic routines. */ /* Generic routines. */
void agp_generic_agp_enable(u32 mode); void agp_generic_agp_enable(u32 mode);
void agp_generic_agp_3_0_enable(u32 mode);
int agp_generic_create_gatt_table(void); int agp_generic_create_gatt_table(void);
int agp_generic_free_gatt_table(void); int agp_generic_free_gatt_table(void);
agp_memory *agp_create_memory(int scratch_pages); agp_memory *agp_create_memory(int scratch_pages);
...@@ -399,5 +398,6 @@ int agp_register_driver (struct agp_driver *drv); ...@@ -399,5 +398,6 @@ int agp_register_driver (struct agp_driver *drv);
int agp_unregister_driver(struct agp_driver *drv); int agp_unregister_driver(struct agp_driver *drv);
u32 agp_collect_device_status(u32 mode, u32 command); u32 agp_collect_device_status(u32 mode, u32 command);
void agp_device_command(u32 command, int agp_v3); void agp_device_command(u32 command, int agp_v3);
int agp_3_0_node_enable(u32 mode, u32 minor);
#endif /* _AGP_BACKEND_PRIV_H */ #endif /* _AGP_BACKEND_PRIV_H */
...@@ -319,7 +319,7 @@ static int agp_3_0_nonisochronous_node_enable(struct agp_3_0_dev *dev_list, unsi ...@@ -319,7 +319,7 @@ static int agp_3_0_nonisochronous_node_enable(struct agp_3_0_dev *dev_list, unsi
* Fully configure and enable an AGP 3.0 host bridge and all the devices * Fully configure and enable an AGP 3.0 host bridge and all the devices
* lying behind it. * lying behind it.
*/ */
static int agp_3_0_node_enable(u32 mode, u32 minor) int agp_3_0_node_enable(u32 mode, u32 minor)
{ {
struct pci_dev *td = agp_bridge->dev, *dev; struct pci_dev *td = agp_bridge->dev, *dev;
u8 bus_num, mcapndx; u8 bus_num, mcapndx;
...@@ -518,33 +518,5 @@ static int agp_3_0_node_enable(u32 mode, u32 minor) ...@@ -518,33 +518,5 @@ static int agp_3_0_node_enable(u32 mode, u32 minor)
return ret; return ret;
} }
/* EXPORT_SYMBOL_GPL(agp_3_0_node_enable);
* Entry point to AGP 3.0 host bridge init. Check to see if we
* have an AGP 3.0 device operating in 3.0 mode. Call
* agp_3_0_node_enable or agp_generic_agp_enable if we don't
* (AGP 3.0 devices are required to operate as AGP 2.0 devices
* when not using 3.0 electricals.
*/
void agp_generic_agp_3_0_enable(u32 mode)
{
u32 ncapid, major, minor, agp_3_0;
pci_read_config_dword(agp_bridge->dev, agp_bridge->capndx, &ncapid);
major = (ncapid >> 20) & 0xf;
minor = (ncapid >> 16) & 0xf;
printk(KERN_INFO PFX "Found an AGP %d.%d compliant device.\n",major, minor);
if(major >= 3) {
pci_read_config_dword(agp_bridge->dev, agp_bridge->capndx + 0x4, &agp_3_0);
/*
* Check to see if we are operating in 3.0 mode
*/
if((agp_3_0 >> 3) & 0x1)
agp_3_0_node_enable(mode, minor);
}
}
EXPORT_SYMBOL(agp_generic_agp_3_0_enable);
...@@ -394,20 +394,35 @@ void agp_device_command(u32 command, int agp_v3) ...@@ -394,20 +394,35 @@ void agp_device_command(u32 command, int agp_v3)
void agp_generic_agp_enable(u32 mode) void agp_generic_agp_enable(u32 mode)
{ {
u32 command; u32 command, ncapid, major, minor;
pci_read_config_dword(agp_bridge->dev, agp_bridge->capndx, &ncapid);
major = (ncapid >> 20) & 0xf;
minor = (ncapid >> 16) & 0xf;
printk(KERN_INFO PFX "Found an AGP %d.%d compliant device.\n",major, minor);
if (major < 3) {
pci_read_config_dword(agp_bridge->dev, pci_read_config_dword(agp_bridge->dev,
agp_bridge->capndx + PCI_AGP_STATUS, agp_bridge->capndx + PCI_AGP_STATUS, &command);
&command);
command = agp_collect_device_status(mode, command); command = agp_collect_device_status(mode, command);
command |= 0x100; command |= 0x100;
pci_write_config_dword(agp_bridge->dev, pci_write_config_dword(agp_bridge->dev,
agp_bridge->capndx + PCI_AGP_COMMAND, agp_bridge->capndx + PCI_AGP_COMMAND, command);
command);
agp_device_command(command, 0); agp_device_command(command, 0);
}
#ifdef CONFIG_AGP3
if(major >= 3) {
u32 agp_3_0;
pci_read_config_dword(agp_bridge->dev, agp_bridge->capndx + 0x4, &agp_3_0);
/* Check to see if we are operating in 3.0 mode */
if((agp_3_0 >> 3) & 0x1)
agp_3_0_node_enable(mode, minor);
}
#endif
} }
int agp_generic_create_gatt_table(void) int agp_generic_create_gatt_table(void)
......
...@@ -87,11 +87,6 @@ static aper_size_info_16 intel_7505_sizes[7] = ...@@ -87,11 +87,6 @@ static aper_size_info_16 intel_7505_sizes[7] =
{4, 1024, 0, 0xf3f} {4, 1024, 0, 0xf3f}
}; };
static void i7505_setup (u32 mode)
{
if ((agp_generic_agp_3_0_enable)==FALSE)
agp_generic_agp_enable(mode);
}
static int __init intel_7505_setup (struct pci_dev *pdev) static int __init intel_7505_setup (struct pci_dev *pdev)
{ {
...@@ -106,7 +101,7 @@ static int __init intel_7505_setup (struct pci_dev *pdev) ...@@ -106,7 +101,7 @@ static int __init intel_7505_setup (struct pci_dev *pdev)
agp_bridge->cleanup = intel_7505_cleanup; agp_bridge->cleanup = intel_7505_cleanup;
agp_bridge->tlb_flush = intel_7505_tlbflush; agp_bridge->tlb_flush = intel_7505_tlbflush;
agp_bridge->mask_memory = intel_mask_memory; agp_bridge->mask_memory = intel_mask_memory;
agp_bridge->agp_enable = i7505_enable; agp_bridge->agp_enable = agp_generic_agp_enable;
agp_bridge->cache_flush = global_cache_flush; agp_bridge->cache_flush = global_cache_flush;
agp_bridge->create_gatt_table = agp_generic_create_gatt_table; agp_bridge->create_gatt_table = agp_generic_create_gatt_table;
agp_bridge->free_gatt_table = agp_generic_free_gatt_table; agp_bridge->free_gatt_table = agp_generic_free_gatt_table;
......
...@@ -186,7 +186,7 @@ static int __init via_generic_agp3_setup (struct pci_dev *pdev) ...@@ -186,7 +186,7 @@ static int __init via_generic_agp3_setup (struct pci_dev *pdev)
agp_bridge->num_aperture_sizes = 10; agp_bridge->num_aperture_sizes = 10;
agp_bridge->dev_private_data = NULL; agp_bridge->dev_private_data = NULL;
agp_bridge->needs_scratch_page = FALSE; agp_bridge->needs_scratch_page = FALSE;
agp_bridge->agp_enable = agp_generic_agp_3_0_enable; agp_bridge->agp_enable = agp_generic_agp_enable;
agp_bridge->configure = via_configure_agp3; agp_bridge->configure = via_configure_agp3;
agp_bridge->fetch_size = via_fetch_size_agp3; agp_bridge->fetch_size = via_fetch_size_agp3;
agp_bridge->cleanup = via_cleanup_agp3; agp_bridge->cleanup = via_cleanup_agp3;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment