Commit 4e827869 authored by Dave Jones's avatar Dave Jones

Merge tetrachloride.(none):/mnt/raid/src/kernel/2.5/bk-linus

into tetrachloride.(none):/mnt/raid/src/kernel/2.5/agpgart
parents 07ca08b1 e8d317e4
...@@ -311,12 +311,15 @@ EXPORT_SYMBOL(agp_copy_info); ...@@ -311,12 +311,15 @@ EXPORT_SYMBOL(agp_copy_info);
* It returns -EINVAL if the pointer == NULL. * It returns -EINVAL if the pointer == NULL.
* It returns -EBUSY if the area of the table requested is already in use. * It returns -EBUSY if the area of the table requested is already in use.
*/ */
int agp_bind_memory(agp_memory * curr, off_t pg_start) int agp_bind_memory(agp_memory *curr, off_t pg_start)
{ {
int ret_val; int ret_val;
if ((agp_bridge->type == NOT_SUPPORTED) || if ((agp_bridge->type == NOT_SUPPORTED) || (curr == NULL))
(curr == NULL) || (curr->is_bound == TRUE)) { return -EINVAL;
if (curr->is_bound == TRUE) {
printk (KERN_INFO PFX "memory %p is already bound!\n", curr);
return -EINVAL; return -EINVAL;
} }
if (curr->is_flushed == FALSE) { if (curr->is_flushed == FALSE) {
...@@ -343,15 +346,17 @@ EXPORT_SYMBOL(agp_bind_memory); ...@@ -343,15 +346,17 @@ EXPORT_SYMBOL(agp_bind_memory);
* It returns -EINVAL if this piece of agp_memory is not currently bound to * 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 * the graphics aperture translation table or if the agp_memory pointer == NULL
*/ */
int agp_unbind_memory(agp_memory * curr) int agp_unbind_memory(agp_memory *curr)
{ {
int ret_val; int ret_val;
if ((agp_bridge->type == NOT_SUPPORTED) || (curr == NULL)) if ((agp_bridge->type == NOT_SUPPORTED) || (curr == NULL))
return -EINVAL; return -EINVAL;
if (curr->is_bound != TRUE) if (curr->is_bound != TRUE) {
printk (KERN_INFO PFX "memory %p was not bound!\n", curr);
return -EINVAL; return -EINVAL;
}
ret_val = agp_bridge->driver->remove_memory(curr, curr->pg_start, curr->type); ret_val = agp_bridge->driver->remove_memory(curr, curr->pg_start, curr->type);
...@@ -374,10 +379,6 @@ static void agp_v2_parse_one(u32 *mode, u32 *cmd, u32 *tmp) ...@@ -374,10 +379,6 @@ static void agp_v2_parse_one(u32 *mode, u32 *cmd, u32 *tmp)
if (!((*cmd & AGPSTAT_SBA) && (*tmp & AGPSTAT_SBA) && (*mode & AGPSTAT_SBA))) if (!((*cmd & AGPSTAT_SBA) && (*tmp & AGPSTAT_SBA) && (*mode & AGPSTAT_SBA)))
*cmd &= ~AGPSTAT_SBA; *cmd &= ~AGPSTAT_SBA;
/* disable FW if it's not supported */
if (!((*cmd & AGPSTAT_FW) && (*tmp & AGPSTAT_FW) && (*mode & AGPSTAT_FW)))
*cmd &= ~AGPSTAT_FW;
/* Set speed */ /* Set speed */
if (!((*cmd & AGPSTAT2_4X) && (*tmp & AGPSTAT2_4X) && (*mode & AGPSTAT2_4X))) if (!((*cmd & AGPSTAT2_4X) && (*tmp & AGPSTAT2_4X) && (*mode & AGPSTAT2_4X)))
*cmd &= ~AGPSTAT2_4X; *cmd &= ~AGPSTAT2_4X;
...@@ -415,10 +416,6 @@ static void agp_v3_parse_one(u32 *mode, u32 *cmd, u32 *tmp) ...@@ -415,10 +416,6 @@ static void agp_v3_parse_one(u32 *mode, u32 *cmd, u32 *tmp)
/* SBA *must* be supported for AGP v3 */ /* SBA *must* be supported for AGP v3 */
*cmd |= AGPSTAT_SBA; *cmd |= AGPSTAT_SBA;
/* disable FW if it's not supported */
if (!((*cmd & AGPSTAT_FW) && (*tmp & AGPSTAT_FW) && (*mode & AGPSTAT_FW)))
*cmd &= ~AGPSTAT_FW;
/* /*
* Set speed. * Set speed.
* Check for invalid speeds. This can happen when applications * Check for invalid speeds. This can happen when applications
...@@ -486,9 +483,12 @@ u32 agp_collect_device_status(u32 mode, u32 cmd) ...@@ -486,9 +483,12 @@ u32 agp_collect_device_status(u32 mode, u32 cmd)
min_t(u32, (mode & AGPSTAT_RQ_DEPTH), min_t(u32, (mode & AGPSTAT_RQ_DEPTH),
min_t(u32, (cmd & AGPSTAT_RQ_DEPTH), (tmp & AGPSTAT_RQ_DEPTH)))); min_t(u32, (cmd & AGPSTAT_RQ_DEPTH), (tmp & AGPSTAT_RQ_DEPTH))));
pci_read_config_dword(device, cap_ptr+AGPSTAT, &agp3); /* disable FW if it's not supported */
if (!((cmd & AGPSTAT_FW) && (tmp & AGPSTAT_FW) && (mode & AGPSTAT_FW)))
cmd &= ~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);
if (agp3 & AGPSTAT_MODE_3_0) { if (agp3 & AGPSTAT_MODE_3_0) {
agp_v3_parse_one(&mode, &cmd, &tmp); agp_v3_parse_one(&mode, &cmd, &tmp);
} else { } else {
......
...@@ -280,8 +280,6 @@ struct agp_bridge_driver uninorth_agp_driver = { ...@@ -280,8 +280,6 @@ struct agp_bridge_driver uninorth_agp_driver = {
.free_by_type = agp_generic_free_by_type, .free_by_type = agp_generic_free_by_type,
.agp_alloc_page = agp_generic_alloc_page, .agp_alloc_page = agp_generic_alloc_page,
.agp_destroy_page = agp_generic_destroy_page, .agp_destroy_page = agp_generic_destroy_page,
.suspend = agp_generic_suspend,
.resume = agp_generic_resume,
.cant_use_aperture = 1, .cant_use_aperture = 1,
}; };
......
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