Skip to contentSkip to conversation

drm/amdgpu: fix userptr flags check

PATCH Applied Christian König 3 participants 3 messages Nov 26, 2015 – Nov 30, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: fix userptr flags check

From: Christian König <[email protected]>

That got messed up while porting it from Radeon.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +3 -2
index 00c5b58..af53215 100644
@@ -242,8 +242,9 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
 	    AMDGPU_GEM_USERPTR_REGISTER))
 		return -EINVAL;
 
-	if (!(args->flags & AMDGPU_GEM_USERPTR_ANONONLY) ||
-		   !(args->flags & AMDGPU_GEM_USERPTR_REGISTER)) {
+	if (!(args->flags & AMDGPU_GEM_USERPTR_READONLY) && (
+	     !(args->flags & AMDGPU_GEM_USERPTR_ANONONLY) ||
+	     !(args->flags & AMDGPU_GEM_USERPTR_REGISTER))) {
 
 		/* if we want to write to it we must require anonymous
 		   memory and install a MMU notifier */
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Christian König

From: Christian König <[email protected]>

That got messed up while porting it from Radeon.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +0 -0
index 00c5b58..af53215 100644
@@ -242,8 +242,9 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
 	    AMDGPU_GEM_USERPTR_REGISTER))

drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data, · line 250

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +3 -2
 		return -EINVAL;
 
-	if (!(args->flags & AMDGPU_GEM_USERPTR_ANONONLY) ||
-		   !(args->flags & AMDGPU_GEM_USERPTR_REGISTER)) {
+	if (!(args->flags & AMDGPU_GEM_USERPTR_READONLY) && (
+	     !(args->flags & AMDGPU_GEM_USERPTR_ANONONLY) ||
+	     !(args->flags & AMDGPU_GEM_USERPTR_REGISTER))) {
 
 		/* if we want to write to it we must require anonymous
 		   memory and install a MMU notifier */
Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Applied
#2 lore raw
Quoted 25 lines · Michel Dänzer
Quoted 24 lines · Christian König

From: Christian König <[email protected]>

That got messed up while porting it from Radeon.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +3 -2
index 00c5b58..af53215 100644
@@ -242,8 +242,9 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
          AMDGPU_GEM_USERPTR_REGISTER))
              return -EINVAL;
 
-     if (!(args->flags & AMDGPU_GEM_USERPTR_ANONONLY) ||
-                !(args->flags & AMDGPU_GEM_USERPTR_REGISTER)) {
+     if (!(args->flags & AMDGPU_GEM_USERPTR_READONLY) && (
+          !(args->flags & AMDGPU_GEM_USERPTR_ANONONLY) ||
+          !(args->flags & AMDGPU_GEM_USERPTR_REGISTER))) {
 
Quoted 5 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data, · line 250

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +0 -0
              /* if we want to write to it we must require anonymous
                 memory and install a MMU notifier */

Applied. thanks!

Alex

Quoted 5 lines

--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel