aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_gem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/drm_gem.c')
-rw-r--r--drivers/gpu/drm/drm_gem.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index bf92d07510df..6fe2cd298c12 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -528,6 +528,10 @@ void drm_gem_vm_open(struct vm_area_struct *vma)
528 struct drm_gem_object *obj = vma->vm_private_data; 528 struct drm_gem_object *obj = vma->vm_private_data;
529 529
530 drm_gem_object_reference(obj); 530 drm_gem_object_reference(obj);
531
532 mutex_lock(&obj->dev->struct_mutex);
533 drm_vm_open_locked(vma);
534 mutex_unlock(&obj->dev->struct_mutex);
531} 535}
532EXPORT_SYMBOL(drm_gem_vm_open); 536EXPORT_SYMBOL(drm_gem_vm_open);
533 537
@@ -535,7 +539,10 @@ void drm_gem_vm_close(struct vm_area_struct *vma)
535{ 539{
536 struct drm_gem_object *obj = vma->vm_private_data; 540 struct drm_gem_object *obj = vma->vm_private_data;
537 541
538 drm_gem_object_unreference_unlocked(obj); 542 mutex_lock(&obj->dev->struct_mutex);
543 drm_vm_close_locked(vma);
544 drm_gem_object_unreference(obj);
545 mutex_unlock(&obj->dev->struct_mutex);
539} 546}
540EXPORT_SYMBOL(drm_gem_vm_close); 547EXPORT_SYMBOL(drm_gem_vm_close);
541 548