diff options
author | Dave Airlie <airlied@redhat.com> | 2021-07-23 11:16:58 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2021-07-23 11:17:03 +1000 |
commit | 2e41a6696bf828a7b06f520d147f6911c947a7af (patch) | |
tree | 2d2e67d8db29805deabe248647fbbf815dd88e44 /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | |
parent | 36ebaeb48b7da3a5e30973e7decb9081dc4a0671 (diff) | |
parent | 7bbcb919e32d776ca8ddce08abb391ab92eef6a9 (diff) | |
download | linux-2e41a6696bf828a7b06f520d147f6911c947a7af.tar.gz linux-2e41a6696bf828a7b06f520d147f6911c947a7af.tar.bz2 linux-2e41a6696bf828a7b06f520d147f6911c947a7af.zip |
Merge tag 'drm-misc-fixes-2021-07-22' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
Short summary of fixes pull:
* Return -ENOTTY for non-DRM ioctls
* amdgpu: Fix COW checks
* nouveau: init BO GME fields
* panel: Avoid double free
* ttm: Fix refcounting in ttm_global_init(); NULL checks
* vc4: Fix interrupt handling
Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/YPlbkmH6S4VAHP9j@linux-uq9g.fritz.box
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index d0d9bc445d7b..854fc497844b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c @@ -255,6 +255,15 @@ static int amdgpu_gem_object_mmap(struct drm_gem_object *obj, struct vm_area_str if (bo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS) return -EPERM; + /* Workaround for Thunk bug creating PROT_NONE,MAP_PRIVATE mappings + * for debugger access to invisible VRAM. Should have used MAP_SHARED + * instead. Clearing VM_MAYWRITE prevents the mapping from ever + * becoming writable and makes is_cow_mapping(vm_flags) false. + */ + if (is_cow_mapping(vma->vm_flags) && + !(vma->vm_flags & (VM_READ | VM_WRITE | VM_EXEC))) + vma->vm_flags &= ~VM_MAYWRITE; + return drm_gem_ttm_mmap(obj, vma); } |