Skip to content

Commit 39b1acf

Browse files
drm/ttm: use GEM references for VM mappings
Instead of a TTM reference grab a GEM reference whenever necessary for a VM mapping. Signed-off-by: Christian König <[email protected]> Reviewed-by: Matthew Brost <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent e13f7e9 commit 39b1acf

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/gpu/drm/ttm/ttm_bo_vm.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ static vm_fault_t ttm_bo_vm_fault_idle(struct ttm_buffer_object *bo,
5858
if (vmf->flags & FAULT_FLAG_RETRY_NOWAIT)
5959
return VM_FAULT_RETRY;
6060

61-
ttm_bo_get(bo);
61+
drm_gem_object_get(&bo->base);
6262
mmap_read_unlock(vmf->vma->vm_mm);
6363
(void)dma_resv_wait_timeout(bo->base.resv,
6464
DMA_RESV_USAGE_KERNEL, true,
6565
MAX_SCHEDULE_TIMEOUT);
6666
dma_resv_unlock(bo->base.resv);
67-
ttm_bo_put(bo);
67+
drm_gem_object_put(&bo->base);
6868
return VM_FAULT_RETRY;
6969
}
7070

@@ -130,12 +130,12 @@ vm_fault_t ttm_bo_vm_reserve(struct ttm_buffer_object *bo,
130130
*/
131131
if (fault_flag_allow_retry_first(vmf->flags)) {
132132
if (!(vmf->flags & FAULT_FLAG_RETRY_NOWAIT)) {
133-
ttm_bo_get(bo);
133+
drm_gem_object_get(&bo->base);
134134
mmap_read_unlock(vmf->vma->vm_mm);
135135
if (!dma_resv_lock_interruptible(bo->base.resv,
136136
NULL))
137137
dma_resv_unlock(bo->base.resv);
138-
ttm_bo_put(bo);
138+
drm_gem_object_put(&bo->base);
139139
}
140140

141141
return VM_FAULT_RETRY;
@@ -353,15 +353,15 @@ void ttm_bo_vm_open(struct vm_area_struct *vma)
353353

354354
WARN_ON(bo->bdev->dev_mapping != vma->vm_file->f_mapping);
355355

356-
ttm_bo_get(bo);
356+
drm_gem_object_get(&bo->base);
357357
}
358358
EXPORT_SYMBOL(ttm_bo_vm_open);
359359

360360
void ttm_bo_vm_close(struct vm_area_struct *vma)
361361
{
362362
struct ttm_buffer_object *bo = vma->vm_private_data;
363363

364-
ttm_bo_put(bo);
364+
drm_gem_object_put(&bo->base);
365365
vma->vm_private_data = NULL;
366366
}
367367
EXPORT_SYMBOL(ttm_bo_vm_close);
@@ -462,7 +462,7 @@ int ttm_bo_mmap_obj(struct vm_area_struct *vma, struct ttm_buffer_object *bo)
462462
if (is_cow_mapping(vma->vm_flags))
463463
return -EINVAL;
464464

465-
ttm_bo_get(bo);
465+
drm_gem_object_get(&bo->base);
466466

467467
/*
468468
* Drivers may want to override the vm_ops field. Otherwise we

0 commit comments

Comments
 (0)