24 #include <linux/module.h>
25 #include <linux/types.h>
43 inode = obj->filp->f_path.dentry->d_inode;
48 pages = drm_malloc_ab(npages,
sizeof(
struct page *));
52 gfpmask |= mapping_gfp_mask(mapping);
54 for (i = 0; i < npages; i++) {
86 drm_free_large(pages);
96 bool dirty,
bool accessed)
102 for (i = 0; i < npages; i++) {
113 drm_free_large(pages);
120 struct drm_gem_mm *mm = dev->mm_private;
121 struct drm_map_list *
list;
122 struct drm_local_map *
map;
126 list = &obj->map_list;
127 list->map = kzalloc(
sizeof(
struct drm_map_list),
GFP_KERNEL);
137 list->file_offset_node = drm_mm_search_free(&mm->offset_manager,
140 if (!list->file_offset_node) {
141 DRM_ERROR(
"failed to allocate offset for bo %d\n", obj->name);
146 list->file_offset_node = drm_mm_get_block(list->file_offset_node,
148 if (!list->file_offset_node) {
153 list->hash.key = list->file_offset_node->start;
156 DRM_ERROR(
"failed to add to map hash\n");