52 bool discardable,
bool kernel,
53 struct drm_gem_object **obj)
66 max_size =
min(rdev->
mc.visible_vram_size, rdev->
mc.gtt_size);
67 if (size > max_size) {
69 __func__, __LINE__, size >> 20, max_size >> 20);
81 DRM_ERROR(
"Failed to allocate GEM object (%d, %d, %u, %d)\n",
82 size, initial_domain, alignment, r);
127 INIT_LIST_HEAD(&rdev->
gem.objects);
164 radeon_bo_unreserve(rbo);
170 struct drm_file *file_priv)
186 "we fail to reserve bo (%d)\n", r);
195 radeon_bo_unreserve(rbo);
212 struct drm_file *filp)
233 struct drm_file *filp)
236 DRM_ERROR(
"unimplemented %s\n", __func__);
241 struct drm_file *filp)
244 DRM_ERROR(
"unimplemented %s\n", __func__);
249 struct drm_file *filp)
253 struct drm_gem_object *gobj;
265 r = radeon_gem_handle_lockup(rdev, r);
270 drm_gem_object_unreference_unlocked(gobj);
273 r = radeon_gem_handle_lockup(rdev, r);
282 struct drm_file *filp)
288 struct drm_gem_object *gobj;
306 drm_gem_object_unreference_unlocked(gobj);
308 r = radeon_gem_handle_lockup(robj->
rdev, r);
316 struct drm_gem_object *gobj;
324 *offset_p = radeon_bo_mmap_offset(robj);
325 drm_gem_object_unreference_unlocked(gobj);
330 struct drm_file *filp)
338 struct drm_file *filp)
342 struct drm_gem_object *gobj;
353 switch (cur_placement) {
365 drm_gem_object_unreference_unlocked(gobj);
366 r = radeon_gem_handle_lockup(rdev, r);
371 struct drm_file *filp)
375 struct drm_gem_object *gobj;
386 if (rdev->
asic->ioctl_wait_idle)
387 robj->
rdev->asic->ioctl_wait_idle(rdev, robj);
388 drm_gem_object_unreference_unlocked(gobj);
389 r = radeon_gem_handle_lockup(rdev, r);
394 struct drm_file *filp)
397 struct drm_gem_object *gobj;
401 DRM_DEBUG(
"%d \n", args->
handle);
407 drm_gem_object_unreference_unlocked(gobj);
412 struct drm_file *filp)
415 struct drm_gem_object *gobj;
428 radeon_bo_unreserve(rbo);
430 drm_gem_object_unreference_unlocked(gobj);
435 struct drm_file *filp)
438 struct drm_gem_object *gobj;
463 "offset 0x%lX is in reserved area 0x%X\n",
464 (
unsigned long)args->
offset,
475 if ((args->
flags & invalid_flags)) {
476 dev_err(&dev->pdev->dev,
"invalid flags 0x%08X vs 0x%08X\n",
477 args->
flags, invalid_flags);
482 dev_err(&dev->pdev->dev,
"only supported snooped mapping for now\n");
492 dev_err(&dev->pdev->dev,
"unsupported operation %d\n",
507 drm_gem_object_unreference_unlocked(gobj);
513 drm_gem_object_unreference_unlocked(gobj);
537 radeon_bo_unreserve(rbo);
538 drm_gem_object_unreference_unlocked(gobj);
547 struct drm_gem_object *gobj;
564 drm_gem_object_unreference_unlocked(gobj);