drm/amdgpu: allow write access to mapped userptrs
authorChristian König <christian.koenig@amd.com>
Fri, 11 Mar 2016 14:29:27 +0000 (15:29 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 14 Mar 2016 17:35:04 +0000 (13:35 -0400)
With the updated MMU notifier we should also be able to
handle the writeback case correctly.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c

index 7f6b4d9841e54567772d802bdef3c9dcd76092c4..5d280f6ae5bf56aa8ddb3a8fc4c64e5cc9b6fe67 100644 (file)
@@ -258,12 +258,10 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
            AMDGPU_GEM_USERPTR_REGISTER))
                return -EINVAL;
 
-       if (!(args->flags & AMDGPU_GEM_USERPTR_READONLY) && (
-            !(args->flags & AMDGPU_GEM_USERPTR_ANONONLY) ||
-            !(args->flags & AMDGPU_GEM_USERPTR_REGISTER))) {
+       if (!(args->flags & AMDGPU_GEM_USERPTR_READONLY) &&
+            !(args->flags & AMDGPU_GEM_USERPTR_REGISTER)) {
 
-               /* if we want to write to it we must require anonymous
-                  memory and install a MMU notifier */
+               /* if we want to write to it we must install a MMU notifier */
                return -EACCES;
        }