Lines Matching refs:new
98 struct agp_memory *new; in agp_create_user_memory() local
104 new = kzalloc(sizeof(struct agp_memory), GFP_KERNEL); in agp_create_user_memory()
105 if (new == NULL) in agp_create_user_memory()
108 new->key = agp_get_key(); in agp_create_user_memory()
110 if (new->key < 0) { in agp_create_user_memory()
111 kfree(new); in agp_create_user_memory()
115 agp_alloc_page_array(alloc_size, new); in agp_create_user_memory()
117 if (new->pages == NULL) { in agp_create_user_memory()
118 agp_free_key(new->key); in agp_create_user_memory()
119 kfree(new); in agp_create_user_memory()
122 new->num_scratch_pages = 0; in agp_create_user_memory()
123 return new; in agp_create_user_memory()
128 struct agp_memory *new; in agp_create_memory() local
130 new = kzalloc(sizeof(struct agp_memory), GFP_KERNEL); in agp_create_memory()
131 if (new == NULL) in agp_create_memory()
134 new->key = agp_get_key(); in agp_create_memory()
136 if (new->key < 0) { in agp_create_memory()
137 kfree(new); in agp_create_memory()
141 agp_alloc_page_array(PAGE_SIZE * scratch_pages, new); in agp_create_memory()
143 if (new->pages == NULL) { in agp_create_memory()
144 agp_free_key(new->key); in agp_create_memory()
145 kfree(new); in agp_create_memory()
148 new->num_scratch_pages = scratch_pages; in agp_create_memory()
149 new->type = AGP_NORMAL_MEMORY; in agp_create_memory()
150 return new; in agp_create_memory()
222 struct agp_memory *new; in agp_allocate_memory() local
235 new = agp_generic_alloc_user(page_count, type); in agp_allocate_memory()
236 if (new) in agp_allocate_memory()
237 new->bridge = bridge; in agp_allocate_memory()
238 return new; in agp_allocate_memory()
242 new = bridge->driver->alloc_by_type(page_count, type); in agp_allocate_memory()
243 if (new) in agp_allocate_memory()
244 new->bridge = bridge; in agp_allocate_memory()
245 return new; in agp_allocate_memory()
250 new = agp_create_memory(scratch_pages); in agp_allocate_memory()
252 if (new == NULL) in agp_allocate_memory()
256 if (bridge->driver->agp_alloc_pages(bridge, new, page_count)) { in agp_allocate_memory()
257 agp_free_memory(new); in agp_allocate_memory()
260 new->bridge = bridge; in agp_allocate_memory()
261 return new; in agp_allocate_memory()
268 agp_free_memory(new); in agp_allocate_memory()
271 new->pages[i] = page; in agp_allocate_memory()
272 new->page_count++; in agp_allocate_memory()
274 new->bridge = bridge; in agp_allocate_memory()
276 return new; in agp_allocate_memory()
1161 struct agp_memory *new; in agp_generic_alloc_user() local
1166 new = agp_create_user_memory(page_count); in agp_generic_alloc_user()
1167 if (new == NULL) in agp_generic_alloc_user()
1171 new->pages[i] = NULL; in agp_generic_alloc_user()
1172 new->page_count = 0; in agp_generic_alloc_user()
1173 new->type = type; in agp_generic_alloc_user()
1174 new->num_scratch_pages = pages; in agp_generic_alloc_user()
1176 return new; in agp_generic_alloc_user()