Merge tag 'drm-next-5.4-2019-08-09' of git://people.freedesktop.org/~agd5f/linux...
authorDave Airlie <airlied@redhat.com>
Mon, 12 Aug 2019 04:20:21 +0000 (14:20 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 12 Aug 2019 04:20:21 +0000 (14:20 +1000)
drm-next-5.4-2019-08-09:

Same as drm-next-5.4-2019-08-06, but with the
readq/writeq stuff fixed and 5.3-rc3 backmerged.

amdgpu:
- Add navi14 support
- Add navi12 support
- Add Arcturus support
- Enable mclk DPM for Navi
- Misc DC display fixes
- Add perfmon support for DF
- Add scatter/gather display support for Raven
- Improve SMU handling for GPU reset
- RAS support for GFX
- Drop last of drmP.h
- Add support for wiping memory on buffer release
- Allow cursor async updates for fb swaps
- Misc fixes and cleanups

amdkfd:
- Add navi14 support
- Add navi12 support
- Add Arcturus support
- CWSR trap handlers updates for gfx9, 10
- Drop last of drmP.h
- Update MAINTAINERS

radeon:
- Misc fixes and cleanups
- Make kexec more reliable by tearing down the GPU

ttm:
- Add release_notify callback

uapi:
- Add wipe memory on release flag for buffer creation

Signed-off-by: Dave Airlie <airlied@redhat.com>
[airlied: resolved conflicts with ttm resv moving]
From: Alex Deucher <alexdeucher@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190809184807.3381-1-alexander.deucher@amd.com
15 files changed:
1  2 
MAINTAINERS
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/radeon/radeon_drv.c
drivers/gpu/drm/ttm/ttm_bo.c
include/drm/ttm/ttm_bo_driver.h

diff --cc MAINTAINERS
Simple merge
index 8ae44d383a137adcc9636ffe4418a0e04bedc1bc,0c0a8e83ab8322d2014299313544b0d58eaeeecf..2d07f16f178971f43c13736b64309e3d87a163d8
@@@ -80,14 -80,11 +80,11 @@@ static void amdgpu_bo_destroy(struct tt
        if (bo->pin_count > 0)
                amdgpu_bo_subtract_pin_size(bo);
  
-       if (bo->kfd_bo)
-               amdgpu_amdkfd_unreserve_memory_limit(bo);
        amdgpu_bo_kunmap(bo);
  
 -      if (bo->gem_base.import_attach)
 -              drm_prime_gem_destroy(&bo->gem_base, bo->tbo.sg);
 -      drm_gem_object_release(&bo->gem_base);
 +      if (bo->tbo.base.import_attach)
 +              drm_prime_gem_destroy(&bo->tbo.base, bo->tbo.sg);
 +      drm_gem_object_release(&bo->tbo.base);
        /* in case amdgpu_device_recover_vram got NULL of bo->parent */
        if (!list_empty(&bo->shadow_list)) {
                mutex_lock(&adev->shadow_list_lock);
@@@ -1211,6 -1217,42 +1217,42 @@@ void amdgpu_bo_move_notify(struct ttm_b
        trace_amdgpu_bo_move(abo, new_mem->mem_type, old_mem->mem_type);
  }
  
 -      reservation_object_lock(bo->resv, NULL);
+ /**
+  * amdgpu_bo_move_notify - notification about a BO being released
+  * @bo: pointer to a buffer object
+  *
+  * Wipes VRAM buffers whose contents should not be leaked before the
+  * memory is released.
+  */
+ void amdgpu_bo_release_notify(struct ttm_buffer_object *bo)
+ {
+       struct dma_fence *fence = NULL;
+       struct amdgpu_bo *abo;
+       int r;
+       if (!amdgpu_bo_is_amdgpu_bo(bo))
+               return;
+       abo = ttm_to_amdgpu_bo(bo);
+       if (abo->kfd_bo)
+               amdgpu_amdkfd_unreserve_memory_limit(abo);
+       if (bo->mem.mem_type != TTM_PL_VRAM || !bo->mem.mm_node ||
+           !(abo->flags & AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE))
+               return;
 -      r = amdgpu_fill_buffer(abo, AMDGPU_POISON, bo->resv, &fence);
++      reservation_object_lock(bo->base.resv, NULL);
 -      reservation_object_unlock(bo->resv);
++      r = amdgpu_fill_buffer(abo, AMDGPU_POISON, bo->base.resv, &fence);
+       if (!WARN_ON(r)) {
+               amdgpu_bo_fence(abo, fence, false);
+               dma_fence_put(fence);
+       }
++      reservation_object_unlock(bo->base.resv);
+ }
  /**
   * amdgpu_bo_fault_reserve_notify - notification about a memory fault
   * @bo: pointer to a buffer object
Simple merge
index 10a861a1690c92e9704c61dad8972196aa8ffec5,2070e8a57ed806d1a1f2a05b90728d0ca5e2434c..9157dcc897a239b149613a791c44fdf61f9a4c93
@@@ -672,7 -671,10 +672,10 @@@ static void ttm_bo_release(struct kref 
        struct ttm_bo_device *bdev = bo->bdev;
        struct ttm_mem_type_manager *man = &bdev->man[bo->mem.mem_type];
  
 -      drm_vma_offset_remove(&bdev->vma_manager, &bo->vma_node);
+       if (bo->bdev->driver->release_notify)
+               bo->bdev->driver->release_notify(bo);
 +      drm_vma_offset_remove(&bdev->vma_manager, &bo->base.vma_node);
        ttm_mem_io_lock(man, false);
        ttm_mem_io_free_vm(bo);
        ttm_mem_io_unlock(man);
Simple merge