Merge tag 'amd-drm-next-5.11-2020-11-05' of git://people.freedesktop.org/~agd5f/linux...
[sfrench/cifs-2.6.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_vm.c
index fdbe7d4e8b8b15956415ebb365cdcbbda4428bb7..0768c868698365785a3ebc36fdcf92c773d2a4f3 100644 (file)
@@ -609,7 +609,7 @@ void amdgpu_vm_del_from_lru_notify(struct ttm_buffer_object *bo)
        if (!amdgpu_bo_is_amdgpu_bo(bo))
                return;
 
-       if (bo->mem.placement & TTM_PL_FLAG_NO_EVICT)
+       if (bo->pin_count)
                return;
 
        abo = ttm_to_amdgpu_bo(bo);
@@ -1747,7 +1747,6 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va,
                resv = vm->root.base.bo->tbo.base.resv;
        } else {
                struct drm_gem_object *obj = &bo->tbo.base;
-               struct ttm_dma_tt *ttm;
 
                resv = bo->tbo.base.resv;
                if (obj->import_attach && bo_va->is_xgmi) {
@@ -1760,10 +1759,8 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va,
                }
                mem = &bo->tbo.mem;
                nodes = mem->mm_node;
-               if (mem->mem_type == TTM_PL_TT) {
-                       ttm = container_of(bo->tbo.ttm, struct ttm_dma_tt, ttm);
-                       pages_addr = ttm->dma_address;
-               }
+               if (mem->mem_type == TTM_PL_TT)
+                       pages_addr = bo->tbo.ttm->dma_address;
        }
 
        if (bo) {
@@ -2782,7 +2779,7 @@ long amdgpu_vm_wait_idle(struct amdgpu_vm *vm, long timeout)
  * 0 for success, error for failure.
  */
 int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,
-                  int vm_context, unsigned int pasid)
+                  int vm_context, u32 pasid)
 {
        struct amdgpu_bo_param bp;
        struct amdgpu_bo *root;
@@ -2953,7 +2950,7 @@ static int amdgpu_vm_check_clean_reserved(struct amdgpu_device *adev,
  * 0 for success, -errno for errors.
  */
 int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm,
-                          unsigned int pasid)
+                          u32 pasid)
 {
        bool pte_support_ats = (adev->asic_type == CHIP_RAVEN);
        int r;
@@ -3251,7 +3248,7 @@ int amdgpu_vm_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
  * @pasid: PASID identifier for VM
  * @task_info: task_info to fill.
  */
-void amdgpu_vm_get_task_info(struct amdgpu_device *adev, unsigned int pasid,
+void amdgpu_vm_get_task_info(struct amdgpu_device *adev, u32 pasid,
                         struct amdgpu_task_info *task_info)
 {
        struct amdgpu_vm *vm;
@@ -3295,7 +3292,7 @@ void amdgpu_vm_set_task_info(struct amdgpu_vm *vm)
  * Try to gracefully handle a VM fault. Return true if the fault was handled and
  * shouldn't be reported any more.
  */
-bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, unsigned int pasid,
+bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, u32 pasid,
                            uint64_t addr)
 {
        struct amdgpu_bo *root;