]> Git Repo - J-linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[J-linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_object.c
index c687f5415b3f1d03610f4904a42748ece428f618..5ac7b55614750c6a469565ab442cad6454d2ac10 100644 (file)
@@ -753,7 +753,7 @@ int amdgpu_bo_restore_shadow(struct amdgpu_bo *shadow, struct dma_fence **fence)
 
        return amdgpu_copy_buffer(ring, shadow_addr, parent_addr,
                                  amdgpu_bo_size(shadow), NULL, fence,
-                                 true, false);
+                                 true, false, false);
 }
 
 /**
@@ -918,7 +918,8 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,
                bo->pin_count++;
 
                if (max_offset != 0) {
-                       u64 domain_start = bo->tbo.bdev->man[mem_type].gpu_offset;
+                       u64 domain_start = amdgpu_ttm_domain_start(adev,
+                                                                  mem_type);
                        WARN_ON_ONCE(max_offset <
                                     (amdgpu_bo_gpu_offset(bo) - domain_start));
                }
@@ -1484,7 +1485,25 @@ u64 amdgpu_bo_gpu_offset(struct amdgpu_bo *bo)
        WARN_ON_ONCE(bo->tbo.mem.mem_type == TTM_PL_VRAM &&
                     !(bo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS));
 
-       return amdgpu_gmc_sign_extend(bo->tbo.offset);
+       return amdgpu_bo_gpu_offset_no_check(bo);
+}
+
+/**
+ * amdgpu_bo_gpu_offset_no_check - return GPU offset of bo
+ * @bo:        amdgpu object for which we query the offset
+ *
+ * Returns:
+ * current GPU offset of the object without raising warnings.
+ */
+u64 amdgpu_bo_gpu_offset_no_check(struct amdgpu_bo *bo)
+{
+       struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
+       uint64_t offset;
+
+       offset = (bo->tbo.mem.start << PAGE_SHIFT) +
+                amdgpu_ttm_domain_start(adev, bo->tbo.mem.mem_type);
+
+       return amdgpu_gmc_sign_extend(offset);
 }
 
 /**
This page took 0.031816 seconds and 4 git commands to generate.