]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/vma: Add a driver_private member to vma_node.
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Thu, 10 Jun 2021 07:01:51 +0000 (09:01 +0200)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Fri, 11 Jun 2021 08:53:18 +0000 (10:53 +0200)
This allows drivers to distinguish between different types of vma_node's.
The readonly flag was unused and is thus removed.

This is a temporary solution, until i915 is converted completely to
use ttm for bo's.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Acked-by: Daniel Vetter <daniel@ffwll.ch> #irc
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210610070152.572423-4-thomas.hellstrom@linux.intel.com
drivers/gpu/drm/drm_gem.c
include/drm/drm_vma_manager.h

index d62fb1a3c916708799129fdac6977c72313dd424..ba2e64ed8b47c808184a641d7ff5d628718af7cc 100644 (file)
@@ -1148,15 +1148,6 @@ int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
                return -EACCES;
        }
 
-       if (node->readonly) {
-               if (vma->vm_flags & VM_WRITE) {
-                       drm_gem_object_put(obj);
-                       return -EINVAL;
-               }
-
-               vma->vm_flags &= ~VM_MAYWRITE;
-       }
-
        ret = drm_gem_mmap_obj(obj, drm_vma_node_size(node) << PAGE_SHIFT,
                               vma);
 
index 76ac5e97a559a2af7b23399b5e4c06b7ee0bb4fc..4f8c35206f7cd7802539e1bb6490e5516e6103f4 100644 (file)
@@ -53,7 +53,7 @@ struct drm_vma_offset_node {
        rwlock_t vm_lock;
        struct drm_mm_node vm_node;
        struct rb_root vm_files;
-       bool readonly:1;
+       void *driver_private;
 };
 
 struct drm_vma_offset_manager {