Commit 35e1acd8 authored by Dave Jones's avatar Dave Jones

[AGPGART] Check the bridge is in 3.0 mode, not the graphic card.

Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent 4708e0d9
...@@ -255,7 +255,7 @@ void *agp_generic_alloc_page(void); ...@@ -255,7 +255,7 @@ void *agp_generic_alloc_page(void);
void agp_generic_destroy_page(void *addr); void agp_generic_destroy_page(void *addr);
void agp_free_key(int key); void agp_free_key(int key);
int agp_num_entries(void); int agp_num_entries(void);
u32 agp_collect_device_status(u32 mode, u32 command); u32 agp_collect_device_status(struct agp_bridge_data *bridge, 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_5_enable(struct agp_bridge_data *bridge); int agp_3_5_enable(struct agp_bridge_data *bridge);
void global_cache_flush(void); void global_cache_flush(void);
......
...@@ -522,13 +522,14 @@ static void agp_v3_parse_one(u32 *requested_mode, u32 *bridge_agpstat, u32 *vga_ ...@@ -522,13 +522,14 @@ static void agp_v3_parse_one(u32 *requested_mode, u32 *bridge_agpstat, u32 *vga_
/** /**
* agp_collect_device_status - determine correct agp_cmd from various agp_stat's * agp_collect_device_status - determine correct agp_cmd from various agp_stat's
* @bridge: an agp_bridge_data struct allocated for the AGP host bridge.
* @requested_mode: requested agp_stat from userspace (Typically from X) * @requested_mode: requested agp_stat from userspace (Typically from X)
* @bridge_agpstat: current agp_stat from AGP bridge. * @bridge_agpstat: current agp_stat from AGP bridge.
* *
* This function will hunt for an AGP graphics card, and try to match * This function will hunt for an AGP graphics card, and try to match
* the requested mode to the capabilities of both the bridge and the card. * the requested mode to the capabilities of both the bridge and the card.
*/ */
u32 agp_collect_device_status(u32 requested_mode, u32 bridge_agpstat) u32 agp_collect_device_status(struct agp_bridge_data *bridge, u32 requested_mode, u32 bridge_agpstat)
{ {
struct pci_dev *device = NULL; struct pci_dev *device = NULL;
u8 cap_ptr = 0; u8 cap_ptr = 0;
...@@ -566,7 +567,7 @@ u32 agp_collect_device_status(u32 requested_mode, u32 bridge_agpstat) ...@@ -566,7 +567,7 @@ u32 agp_collect_device_status(u32 requested_mode, u32 bridge_agpstat)
bridge_agpstat &= ~AGPSTAT_FW; bridge_agpstat &= ~AGPSTAT_FW;
/* Check to see if we are operating in 3.0 mode */ /* Check to see if we are operating in 3.0 mode */
pci_read_config_dword(device, cap_ptr+AGPSTAT, &agp3); pci_read_config_dword(agp_bridge->dev, cap_ptr+AGPSTAT, &agp3);
if (agp3 & AGPSTAT_MODE_3_0) { if (agp3 & AGPSTAT_MODE_3_0) {
agp_v3_parse_one(&requested_mode, &bridge_agpstat, &vga_agpstat); agp_v3_parse_one(&requested_mode, &bridge_agpstat, &vga_agpstat);
} else { } else {
...@@ -631,7 +632,7 @@ void agp_generic_enable(u32 requested_mode) ...@@ -631,7 +632,7 @@ void agp_generic_enable(u32 requested_mode)
pci_read_config_dword(agp_bridge->dev, pci_read_config_dword(agp_bridge->dev,
agp_bridge->capndx + PCI_AGP_STATUS, &bridge_agpstat); agp_bridge->capndx + PCI_AGP_STATUS, &bridge_agpstat);
bridge_agpstat = agp_collect_device_status(requested_mode, bridge_agpstat); bridge_agpstat = agp_collect_device_status(agp_bridge, requested_mode, bridge_agpstat);
if (bridge_agpstat == 0) if (bridge_agpstat == 0)
/* Something bad happened. FIXME: Return error code? */ /* Something bad happened. FIXME: Return error code? */
return; return;
......
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