diff options
author | Chunming Zhou <david1.zhou@amd.com> | 2018-04-17 06:34:40 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-05-15 14:43:32 -0400 |
commit | 3f188453faf7ba5b59e8064df4afffbc946e25ec (patch) | |
tree | 64c028c4dee60d1b0c9b37692234ffae98056cf0 /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | |
parent | aa2b2e2822831d78a283edb12cf8b7da21bdd0ed (diff) |
drm/amdgpu: handle domain mask checking v2
if domain is illegal, we should return error.
v2:
remove duplicated domain checking.
Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index ff606ce88837..c62c3dd4dcc6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | |||
@@ -229,12 +229,7 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data, | |||
229 | return -EINVAL; | 229 | return -EINVAL; |
230 | 230 | ||
231 | /* reject invalid gem domains */ | 231 | /* reject invalid gem domains */ |
232 | if (args->in.domains & ~(AMDGPU_GEM_DOMAIN_CPU | | 232 | if (args->in.domains & ~AMDGPU_GEM_DOMAIN_MASK) |
233 | AMDGPU_GEM_DOMAIN_GTT | | ||
234 | AMDGPU_GEM_DOMAIN_VRAM | | ||
235 | AMDGPU_GEM_DOMAIN_GDS | | ||
236 | AMDGPU_GEM_DOMAIN_GWS | | ||
237 | AMDGPU_GEM_DOMAIN_OA)) | ||
238 | return -EINVAL; | 233 | return -EINVAL; |
239 | 234 | ||
240 | /* create a gem object to contain this object in */ | 235 | /* create a gem object to contain this object in */ |