]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amdgpu: expand amdgpu_copy_buffer interface with tmz parameter
authorAaron Liu <aaron.liu@amd.com>
Tue, 15 Oct 2019 07:45:23 +0000 (15:45 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 28 Apr 2020 20:20:29 +0000 (16:20 -0400)
This patch expands amdgpu_copy_buffer interface with tmz parameter.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
drivers/gpu/drm/amd/amdgpu/amdgpu_test.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h

index d1495e1c92894168bc84e3f89decd27f31516cf2..d9b35df33806d178afbea6d44954396121bee021 100644 (file)
@@ -40,7 +40,7 @@ static int amdgpu_benchmark_do_move(struct amdgpu_device *adev, unsigned size,
        for (i = 0; i < n; i++) {
                struct amdgpu_ring *ring = adev->mman.buffer_funcs_ring;
                r = amdgpu_copy_buffer(ring, saddr, daddr, size, NULL, &fence,
-                                      false, false);
+                                      false, false, false);
                if (r)
                        goto exit_do_move;
                r = dma_fence_wait(fence, false);
index c687f5415b3f1d03610f4904a42748ece428f618..3d822eba9a5d708b438e7a9cf90dbf8982422f95 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);
 }
 
 /**
index b158230af8db705cfee5d012fb60738bc0cb69e5..476f1f89aaad1f9e1a0cc4c0e1a0f53b58dd6864 100644 (file)
@@ -124,7 +124,7 @@ static void amdgpu_do_test_moves(struct amdgpu_device *adev)
                amdgpu_bo_kunmap(gtt_obj[i]);
 
                r = amdgpu_copy_buffer(ring, gart_addr, vram_addr,
-                                      size, NULL, &fence, false, false);
+                                      size, NULL, &fence, false, false, false);
 
                if (r) {
                        DRM_ERROR("Failed GTT->VRAM copy %d\n", i);
@@ -170,7 +170,7 @@ static void amdgpu_do_test_moves(struct amdgpu_device *adev)
                amdgpu_bo_kunmap(vram_obj);
 
                r = amdgpu_copy_buffer(ring, vram_addr, gart_addr,
-                                      size, NULL, &fence, false, false);
+                                      size, NULL, &fence, false, false, false);
 
                if (r) {
                        DRM_ERROR("Failed VRAM->GTT copy %d\n", i);
index 298caa50eed61313bbd2ffa2ed4988b7ee1f502b..0116c4afe1da5b5d4bbba746586f316f60593a1a 100644 (file)
@@ -373,7 +373,7 @@ int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
                }
 
                r = amdgpu_copy_buffer(ring, from, to, cur_size,
-                                      resv, &next, false, true);
+                                      resv, &next, false, true, false);
                if (r)
                        goto error;
 
@@ -2084,7 +2084,7 @@ int amdgpu_copy_buffer(struct amdgpu_ring *ring, uint64_t src_offset,
                       uint64_t dst_offset, uint32_t byte_count,
                       struct dma_resv *resv,
                       struct dma_fence **fence, bool direct_submit,
-                      bool vm_needs_flush)
+                      bool vm_needs_flush, bool tmz)
 {
        struct amdgpu_device *adev = ring->adev;
        struct amdgpu_job *job;
@@ -2126,7 +2126,7 @@ int amdgpu_copy_buffer(struct amdgpu_ring *ring, uint64_t src_offset,
                uint32_t cur_size_in_bytes = min(byte_count, max_bytes);
 
                amdgpu_emit_copy_buffer(adev, &job->ibs[0], src_offset,
-                                       dst_offset, cur_size_in_bytes, false);
+                                       dst_offset, cur_size_in_bytes, tmz);
 
                src_offset += cur_size_in_bytes;
                dst_offset += cur_size_in_bytes;
index bd05bbb4878d96a69ebc4b28d93c6d4040fe5d53..dc6502d1060b1596ea0e6b95b09ae161a7986a8b 100644 (file)
@@ -87,7 +87,7 @@ int amdgpu_copy_buffer(struct amdgpu_ring *ring, uint64_t src_offset,
                       uint64_t dst_offset, uint32_t byte_count,
                       struct dma_resv *resv,
                       struct dma_fence **fence, bool direct_submit,
-                      bool vm_needs_flush);
+                      bool vm_needs_flush, bool tmz);
 int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
                               struct amdgpu_copy_mem *src,
                               struct amdgpu_copy_mem *dst,