aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
diff options
context:
space:
mode:
authorChristian König <[email protected]>2015-05-13 12:30:53 +0000
committerAlex Deucher <[email protected]>2015-06-04 01:03:43 +0000
commit271c81256612b162a9ae0f8c0f0a055a7523cea5 (patch)
tree344441e66f38b751741730a6c761f3a102527897 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
parentdrm/amdgpu: fix VM_CONTEXT*_PAGE_TABLE_END_ADDR handling (diff)
downloadkernel-271c81256612b162a9ae0f8c0f0a055a7523cea5.tar.gz
kernel-271c81256612b162a9ae0f8c0f0a055a7523cea5.zip
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 <[email protected]> Reviewed-by: Jammy Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_object.c3
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)
bool is_iomem;
int r;
+ if (bo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS)
+ return -EPERM;
+
if (bo->kptr) {
if (ptr) {
*ptr = bo->kptr;