summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian König2015-11-26 11:06:20 +0100
committerAlex Deucher2015-11-30 20:38:47 +0100
commit585116c5fafe578e89c146c9839c95ac75acfb9d (patch)
treea7e266a0801cf431719ccb4c1e36a60c13749249
parentMerge branch 'linux-4.4' of git://anongit.freedesktop.org/git/nouveau/linux-2... (diff)
downloadkernel-qcow2-linux-585116c5fafe578e89c146c9839c95ac75acfb9d.tar.gz
kernel-qcow2-linux-585116c5fafe578e89c146c9839c95ac75acfb9d.tar.xz
kernel-qcow2-linux-585116c5fafe578e89c146c9839c95ac75acfb9d.zip
drm/amdgpu: fix userptr flags check
That got messed up while porting it from Radeon. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Christian König <christian.koenig@amd.com> Cc: stable@vger.kernel.org Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index fc32fc01a64b..f6ea4b43a60c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -235,8 +235,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 */