diff options
Diffstat (limited to 'drivers/char/agp/generic.c')
-rw-r--r-- | drivers/char/agp/generic.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c index 54c91000646f..118dbde25dc7 100644 --- a/drivers/char/agp/generic.c +++ b/drivers/char/agp/generic.c | |||
@@ -429,6 +429,10 @@ int agp_bind_memory(struct agp_memory *curr, off_t pg_start) | |||
429 | 429 | ||
430 | curr->is_bound = true; | 430 | curr->is_bound = true; |
431 | curr->pg_start = pg_start; | 431 | curr->pg_start = pg_start; |
432 | spin_lock(&agp_bridge->mapped_lock); | ||
433 | list_add(&curr->mapped_list, &agp_bridge->mapped_list); | ||
434 | spin_unlock(&agp_bridge->mapped_lock); | ||
435 | |||
432 | return 0; | 436 | return 0; |
433 | } | 437 | } |
434 | EXPORT_SYMBOL(agp_bind_memory); | 438 | EXPORT_SYMBOL(agp_bind_memory); |
@@ -461,10 +465,34 @@ int agp_unbind_memory(struct agp_memory *curr) | |||
461 | 465 | ||
462 | curr->is_bound = false; | 466 | curr->is_bound = false; |
463 | curr->pg_start = 0; | 467 | curr->pg_start = 0; |
468 | spin_lock(&curr->bridge->mapped_lock); | ||
469 | list_del(&curr->mapped_list); | ||
470 | spin_unlock(&curr->bridge->mapped_lock); | ||
464 | return 0; | 471 | return 0; |
465 | } | 472 | } |
466 | EXPORT_SYMBOL(agp_unbind_memory); | 473 | EXPORT_SYMBOL(agp_unbind_memory); |
467 | 474 | ||
475 | /** | ||
476 | * agp_rebind_emmory - Rewrite the entire GATT, useful on resume | ||
477 | */ | ||
478 | int agp_rebind_memory(void) | ||
479 | { | ||
480 | struct agp_memory *curr; | ||
481 | int ret_val = 0; | ||
482 | |||
483 | spin_lock(&agp_bridge->mapped_lock); | ||
484 | list_for_each_entry(curr, &agp_bridge->mapped_list, mapped_list) { | ||
485 | ret_val = curr->bridge->driver->insert_memory(curr, | ||
486 | curr->pg_start, | ||
487 | curr->type); | ||
488 | if (ret_val != 0) | ||
489 | break; | ||
490 | } | ||
491 | spin_unlock(&agp_bridge->mapped_lock); | ||
492 | return ret_val; | ||
493 | } | ||
494 | EXPORT_SYMBOL(agp_rebind_memory); | ||
495 | |||
468 | /* End - Routines for handling swapping of agp_memory into the GATT */ | 496 | /* End - Routines for handling swapping of agp_memory into the GATT */ |
469 | 497 | ||
470 | 498 | ||