]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amdgpu: expand sdma copy_buffer interface with tmz parameter
authorAaron Liu <aaron.liu@amd.com>
Tue, 15 Oct 2019 07:37:48 +0000 (15:37 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 28 Apr 2020 20:20:29 +0000 (16:20 -0400)
This patch expands sdma 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_sdma.h
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
drivers/gpu/drm/amd/amdgpu/cik_sdma.c
drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
drivers/gpu/drm/amd/amdgpu/si_dma.c

index 2a152516504a6fc5da91bc5e8c9db8cd66ec5d70..e5b8fb8e75c5250427761a0466e66f65ea138aa6 100644 (file)
@@ -89,7 +89,8 @@ struct amdgpu_buffer_funcs {
                                 /* dst addr in bytes */
                                 uint64_t dst_offset,
                                 /* number of byte to transfer */
-                                uint32_t byte_count);
+                                uint32_t byte_count,
+                                bool tmz);
 
        /* maximum bytes in a single operation */
        uint32_t        fill_max_bytes;
@@ -107,7 +108,7 @@ struct amdgpu_buffer_funcs {
                                 uint32_t byte_count);
 };
 
-#define amdgpu_emit_copy_buffer(adev, ib, s, d, b) (adev)->mman.buffer_funcs->emit_copy_buffer((ib),  (s), (d), (b))
+#define amdgpu_emit_copy_buffer(adev, ib, s, d, b, t) (adev)->mman.buffer_funcs->emit_copy_buffer((ib),  (s), (d), (b), (t))
 #define amdgpu_emit_fill_buffer(adev, ib, s, d, b) (adev)->mman.buffer_funcs->emit_fill_buffer((ib), (s), (d), (b))
 
 struct amdgpu_sdma_instance *
index 1331b4c5bdca06341a2d2709ab4d670b9cccba56..298caa50eed61313bbd2ffa2ed4988b7ee1f502b 100644 (file)
@@ -2054,7 +2054,7 @@ static int amdgpu_map_buffer(struct ttm_buffer_object *bo,
        dst_addr = amdgpu_bo_gpu_offset(adev->gart.bo);
        dst_addr += window * AMDGPU_GTT_MAX_TRANSFER_SIZE * 8;
        amdgpu_emit_copy_buffer(adev, &job->ibs[0], src_addr,
-                               dst_addr, num_bytes);
+                               dst_addr, num_bytes, false);
 
        amdgpu_ring_pad_ib(ring, &job->ibs[0]);
        WARN_ON(job->ibs[0].length_dw > num_dw);
@@ -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);
+                                       dst_offset, cur_size_in_bytes, false);
 
                src_offset += cur_size_in_bytes;
                dst_offset += cur_size_in_bytes;
index 7c2ee84fa4a6d1858669209d678f4bd03b87663c..20f108818b2b966f5893f05e7b72e233d0b3054a 100644 (file)
@@ -1313,7 +1313,8 @@ static void cik_sdma_set_irq_funcs(struct amdgpu_device *adev)
 static void cik_sdma_emit_copy_buffer(struct amdgpu_ib *ib,
                                      uint64_t src_offset,
                                      uint64_t dst_offset,
-                                     uint32_t byte_count)
+                                     uint32_t byte_count,
+                                     bool tmz)
 {
        ib->ptr[ib->length_dw++] = SDMA_PACKET(SDMA_OPCODE_COPY, SDMA_COPY_SUB_OPCODE_LINEAR, 0);
        ib->ptr[ib->length_dw++] = byte_count;
index 9a7f194c730a6e72c250e0f3cbb30623f64e570d..5f304d61999ebf9c3257ebfcbd48e46a4d26b2a5 100644 (file)
@@ -1200,7 +1200,8 @@ static void sdma_v2_4_set_irq_funcs(struct amdgpu_device *adev)
 static void sdma_v2_4_emit_copy_buffer(struct amdgpu_ib *ib,
                                       uint64_t src_offset,
                                       uint64_t dst_offset,
-                                      uint32_t byte_count)
+                                      uint32_t byte_count,
+                                      bool tmz)
 {
        ib->ptr[ib->length_dw++] = SDMA_PKT_HEADER_OP(SDMA_OP_COPY) |
                SDMA_PKT_HEADER_SUB_OP(SDMA_SUBOP_COPY_LINEAR);
index e6b5b4f672a0c114aa1afe393e296f9468da1b76..c59f6f6f4c0917c161e3214ca8428f4440bfd95b 100644 (file)
@@ -1638,7 +1638,8 @@ static void sdma_v3_0_set_irq_funcs(struct amdgpu_device *adev)
 static void sdma_v3_0_emit_copy_buffer(struct amdgpu_ib *ib,
                                       uint64_t src_offset,
                                       uint64_t dst_offset,
-                                      uint32_t byte_count)
+                                      uint32_t byte_count,
+                                      bool tmz)
 {
        ib->ptr[ib->length_dw++] = SDMA_PKT_HEADER_OP(SDMA_OP_COPY) |
                SDMA_PKT_HEADER_SUB_OP(SDMA_SUBOP_COPY_LINEAR);
index f092f12fecfe8ff247b71184eb5582284112efe3..4cabab0976819bf96f39271f651e910fa6168735 100644 (file)
@@ -2458,7 +2458,8 @@ static void sdma_v4_0_set_irq_funcs(struct amdgpu_device *adev)
 static void sdma_v4_0_emit_copy_buffer(struct amdgpu_ib *ib,
                                       uint64_t src_offset,
                                       uint64_t dst_offset,
-                                      uint32_t byte_count)
+                                      uint32_t byte_count,
+                                      bool tmz)
 {
        ib->ptr[ib->length_dw++] = SDMA_PKT_HEADER_OP(SDMA_OP_COPY) |
                SDMA_PKT_HEADER_SUB_OP(SDMA_SUBOP_COPY_LINEAR);
index f9e92e85813a52a01c3233ec787bafa02f5e9203..e08933e82420529a24e01ac16f14735489309409 100644 (file)
@@ -1706,7 +1706,8 @@ static void sdma_v5_0_set_irq_funcs(struct amdgpu_device *adev)
 static void sdma_v5_0_emit_copy_buffer(struct amdgpu_ib *ib,
                                       uint64_t src_offset,
                                       uint64_t dst_offset,
-                                      uint32_t byte_count)
+                                      uint32_t byte_count,
+                                      bool tmz)
 {
        ib->ptr[ib->length_dw++] = SDMA_PKT_HEADER_OP(SDMA_OP_COPY) |
                SDMA_PKT_HEADER_SUB_OP(SDMA_SUBOP_COPY_LINEAR);
index e4b8283ad11d62c1de4d278bd43c7d3a469879fc..7d2bbcbe547b2ad53c5b091c2bf09e055dfdf2e1 100644 (file)
@@ -776,7 +776,8 @@ static void si_dma_set_irq_funcs(struct amdgpu_device *adev)
 static void si_dma_emit_copy_buffer(struct amdgpu_ib *ib,
                                       uint64_t src_offset,
                                       uint64_t dst_offset,
-                                      uint32_t byte_count)
+                                      uint32_t byte_count,
+                                      bool tmz)
 {
        ib->ptr[ib->length_dw++] = DMA_PACKET(DMA_PACKET_COPY,
                                              1, 0, 0, byte_count);