Lines Matching refs:obj
250 static int i915_gem_object_get_pages_stolen(struct drm_i915_gem_object *obj)
256 static void i915_gem_object_put_pages_stolen(struct drm_i915_gem_object *obj)
272 struct drm_i915_gem_object *obj;
274 obj = i915_gem_object_alloc(dev);
275 if (obj == NULL)
278 if (drm_gem_private_object_init(dev, &obj->base, stolen->size))
281 i915_gem_object_init(obj, &i915_gem_object_stolen_ops);
283 obj->page_list = i915_pages_create_for_stolen(dev,
285 if (obj->pages == NULL)
288 obj->has_dma_mapping = true;
289 i915_gem_object_pin_pages(obj);
290 obj->stolen = stolen;
292 obj->base.write_domain = I915_GEM_DOMAIN_GTT;
293 obj->base.read_domains = I915_GEM_DOMAIN_GTT;
294 obj->cache_level = I915_CACHE_NONE;
296 return obj;
299 i915_gem_object_free(obj);
312 struct drm_i915_gem_object *obj;
328 obj = _i915_gem_object_create_stolen(dev, stolen);
329 if (obj)
330 return obj;
344 struct drm_i915_gem_object *obj;
368 obj = _i915_gem_object_create_stolen(dev, stolen);
369 if (obj == NULL) {
377 return obj;
385 obj->gtt_space = drm_mm_create_block(&dev_priv->mm.gtt_space,
388 if (obj->gtt_space == NULL) {
390 drm_gem_object_unreference(&obj->base);
394 obj->gtt_space = I915_GTT_RESERVED;
396 obj->gtt_offset = gtt_offset;
397 obj->has_global_gtt_mapping = 1;
399 list_add_tail(&obj->global_list, &dev_priv->mm.bound_list, (caddr_t)obj);
400 list_add_tail(&obj->mm_list, &dev_priv->mm.inactive_list, (caddr_t)obj);
402 return obj;
406 i915_gem_object_release_stolen(struct drm_i915_gem_object *obj)
408 if (obj->stolen) {
409 drm_mm_put_block(obj->stolen);
410 obj->stolen = NULL;