Lines Matching full:entry
46 static void drm_sg_cleanup(struct drm_sg_mem * entry) in drm_sg_cleanup() argument
51 for (i = 0; i < entry->pages; i++) { in drm_sg_cleanup()
52 page = entry->pagelist[i]; in drm_sg_cleanup()
57 vfree(entry->virtual); in drm_sg_cleanup()
59 kfree(entry->busaddr); in drm_sg_cleanup()
60 kfree(entry->pagelist); in drm_sg_cleanup()
61 kfree(entry); in drm_sg_cleanup()
82 struct drm_sg_mem *entry; in drm_legacy_sg_alloc() local
99 entry = kzalloc(sizeof(*entry), GFP_KERNEL); in drm_legacy_sg_alloc()
100 if (!entry) in drm_legacy_sg_alloc()
106 entry->pages = pages; in drm_legacy_sg_alloc()
107 entry->pagelist = kcalloc(pages, sizeof(*entry->pagelist), GFP_KERNEL); in drm_legacy_sg_alloc()
108 if (!entry->pagelist) { in drm_legacy_sg_alloc()
109 kfree(entry); in drm_legacy_sg_alloc()
113 entry->busaddr = kcalloc(pages, sizeof(*entry->busaddr), GFP_KERNEL); in drm_legacy_sg_alloc()
114 if (!entry->busaddr) { in drm_legacy_sg_alloc()
115 kfree(entry->pagelist); in drm_legacy_sg_alloc()
116 kfree(entry); in drm_legacy_sg_alloc()
120 entry->virtual = vmalloc_32(pages << PAGE_SHIFT); in drm_legacy_sg_alloc()
121 if (!entry->virtual) { in drm_legacy_sg_alloc()
122 kfree(entry->busaddr); in drm_legacy_sg_alloc()
123 kfree(entry->pagelist); in drm_legacy_sg_alloc()
124 kfree(entry); in drm_legacy_sg_alloc()
131 memset(entry->virtual, 0, pages << PAGE_SHIFT); in drm_legacy_sg_alloc()
133 entry->handle = ScatterHandle((unsigned long)entry->virtual); in drm_legacy_sg_alloc()
135 DRM_DEBUG("handle = %08lx\n", entry->handle); in drm_legacy_sg_alloc()
136 DRM_DEBUG("virtual = %p\n", entry->virtual); in drm_legacy_sg_alloc()
138 for (i = (unsigned long)entry->virtual, j = 0; j < pages; in drm_legacy_sg_alloc()
140 entry->pagelist[j] = vmalloc_to_page((void *)i); in drm_legacy_sg_alloc()
141 if (!entry->pagelist[j]) in drm_legacy_sg_alloc()
143 SetPageReserved(entry->pagelist[j]); in drm_legacy_sg_alloc()
146 request->handle = entry->handle; in drm_legacy_sg_alloc()
148 dev->sg = entry; in drm_legacy_sg_alloc()
160 tmp = page_address(entry->pagelist[i]); in drm_legacy_sg_alloc()
166 tmp = (unsigned long *)((u8 *) entry->virtual + in drm_legacy_sg_alloc()
178 tmp = page_address(entry->pagelist[i]); in drm_legacy_sg_alloc()
193 drm_sg_cleanup(entry); in drm_legacy_sg_alloc()
201 struct drm_sg_mem *entry; in drm_legacy_sg_free() local
209 entry = dev->sg; in drm_legacy_sg_free()
212 if (!entry || entry->handle != request->handle) in drm_legacy_sg_free()
215 DRM_DEBUG("virtual = %p\n", entry->virtual); in drm_legacy_sg_free()
217 drm_sg_cleanup(entry); in drm_legacy_sg_free()