Lines Matching refs:entry
217 * memory via agp_allocate_memory() and creates a drm_agp_mem entry for it.
221 struct drm_agp_mem *entry;
228 entry = kzalloc(sizeof(*entry), GFP_KERNEL);
229 if (!entry)
236 kfree(entry);
242 entry->handle = (unsigned long)memory->am_id + 1;
244 entry->handle = (unsigned long)memory->key + 1;
246 entry->memory = memory;
247 entry->bound = 0;
248 entry->pages = pages;
249 list_add(&entry->head, &dev->agp->memory);
251 request->handle = entry->handle;
276 * Search for the AGP memory entry associated with a handle.
287 struct drm_agp_mem *entry;
289 list_for_each_entry(entry, &dev->agp->memory, head) {
290 if (entry->handle == handle)
291 return entry;
306 * entry and passes it to the unbind_agp() function.
310 struct drm_agp_mem *entry;
315 entry = drm_agp_lookup_entry(dev, request->handle);
316 if (!entry || !entry->bound)
319 ret = drm_unbind_agp(dev->agp->bridge, entry->memory);
321 ret = drm_unbind_agp(entry->memory);
324 entry->bound = 0;
348 * is currently bound into the GATT. Looks-up the AGP memory entry and passes
353 struct drm_agp_mem *entry;
359 entry = drm_agp_lookup_entry(dev, request->handle);
360 if (!entry || entry->bound)
364 if ((retcode = drm_bind_agp(dev->agp->bridge, entry->memory, page)))
367 retcode = drm_bind_agp(entry->memory, page);
371 entry->bound = dev->agp->base + (page << PAGE_SHIFT);
372 DRM_DEBUG("base = 0x%lx entry->bound = 0x%lx\n",
373 dev->agp->base, entry->bound);
397 * AGP memory entry. If the memory is currently bound, unbind it via
398 * unbind_agp(). Frees it via free_agp() as well as the entry itself
403 struct drm_agp_mem *entry;
407 entry = drm_agp_lookup_entry(dev, request->handle);
408 if (!entry)
410 if (entry->bound)
412 drm_unbind_agp(dev->agp->bridge, entry->memory);
414 drm_unbind_agp(entry->memory);
417 list_del(&entry->head);
420 drm_free_agp(dev->agp->bridge, entry->memory, entry->pages);
422 drm_free_agp(entry->memory, entry->pages);
424 kfree(entry);
503 struct drm_agp_mem *entry, *tempe;
510 list_for_each_entry_safe(entry, tempe, &dev->agp->memory, head) {
512 if (entry->bound)
513 drm_unbind_agp(dev->agp->bridge, entry->memory);
514 drm_free_agp(dev->agp->bridge, entry->memory, entry->pages);
516 if (entry->bound)
517 drm_unbind_agp(entry->memory);
518 drm_free_agp(entry->memory, entry->pages);
520 kfree(entry);