diff options
author | Christian König <christian.koenig@amd.com> | 2015-05-13 08:30:53 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-06-03 21:03:43 -0400 |
commit | 271c81256612b162a9ae0f8c0f0a055a7523cea5 (patch) | |
tree | 344441e66f38b751741730a6c761f3a102527897 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |
parent | 25a595e48261e8d44970b6a5cfafc283f9a9fbc5 (diff) |
drm/amdgpu: enforce AMDGPU_GEM_CREATE_NO_CPU_ACCESS
Deny user and kernel mapping if we said we never want to do so.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 992b7f5843bc..a721f5044557 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |||
@@ -263,6 +263,9 @@ int amdgpu_bo_kmap(struct amdgpu_bo *bo, void **ptr) | |||
263 | bool is_iomem; | 263 | bool is_iomem; |
264 | int r; | 264 | int r; |
265 | 265 | ||
266 | if (bo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS) | ||
267 | return -EPERM; | ||
268 | |||
266 | if (bo->kptr) { | 269 | if (bo->kptr) { |
267 | if (ptr) { | 270 | if (ptr) { |
268 | *ptr = bo->kptr; | 271 | *ptr = bo->kptr; |