Lines Matching defs:curr
157 * @curr: agp_memory pointer to be freed.
162 void agp_free_memory(struct agp_memory *curr)
166 if (curr == NULL)
169 if (curr->is_bound)
170 agp_unbind_memory(curr);
172 if (curr->type >= AGP_USER_TYPES) {
173 agp_generic_free_by_type(curr);
177 if (curr->type != 0) {
178 curr->bridge->driver->free_by_type(curr);
181 if (curr->page_count != 0) {
182 if (curr->bridge->driver->agp_destroy_pages) {
183 curr->bridge->driver->agp_destroy_pages(curr);
186 for (i = 0; i < curr->page_count; i++) {
187 curr->bridge->driver->agp_destroy_page(
188 curr->pages[i],
191 for (i = 0; i < curr->page_count; i++) {
192 curr->bridge->driver->agp_destroy_page(
193 curr->pages[i],
198 agp_free_key(curr->key);
199 agp_free_page_array(curr);
200 kfree(curr);
402 * @curr: agp_memory pointer
408 int agp_bind_memory(struct agp_memory *curr, off_t pg_start)
412 if (curr == NULL)
415 if (curr->is_bound) {
416 printk(KERN_INFO PFX "memory %p is already bound!\n", curr);
419 if (!curr->is_flushed) {
420 curr->bridge->driver->cache_flush();
421 curr->is_flushed = true;
424 ret_val = curr->bridge->driver->insert_memory(curr, pg_start, curr->type);
429 curr->is_bound = true;
430 curr->pg_start = pg_start;
432 list_add(&curr->mapped_list, &agp_bridge->mapped_list);
443 * @curr: agp_memory pointer to be removed from the GATT.
448 int agp_unbind_memory(struct agp_memory *curr)
452 if (curr == NULL)
455 if (!curr->is_bound) {
456 printk(KERN_INFO PFX "memory %p was not bound!\n", curr);
460 ret_val = curr->bridge->driver->remove_memory(curr, curr->pg_start, curr->type);
465 curr->is_bound = false;
466 curr->pg_start = 0;
467 spin_lock(&curr->bridge->mapped_lock);
468 list_del(&curr->mapped_list);
469 spin_unlock(&curr->bridge->mapped_lock);
1151 void agp_generic_free_by_type(struct agp_memory *curr)
1153 agp_free_page_array(curr);
1154 agp_free_key(curr->key);
1155 kfree(curr);