* [PATCH 1/5] drm/amdgpu: expand sdma copy_buffer interface with tmz parameter
@ 2019-11-18 5:18 ` Aaron Liu
0 siblings, 0 replies; 22+ messages in thread
From: Aaron Liu @ 2019-11-18 5:18 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Alexander.Deucher-5C7GfCeVMHo, Luben.Tuikov-5C7GfCeVMHo,
Ray.Huang-5C7GfCeVMHo, Christian.Koenig-5C7GfCeVMHo, Aaron Liu
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>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h | 5 +++--
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 3 ++-
drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 3 ++-
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 3 ++-
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 3 ++-
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 3 ++-
drivers/gpu/drm/amd/amdgpu/si_dma.c | 3 ++-
8 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
index 761ff8b..b313465 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
@@ -79,7 +79,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;
@@ -97,7 +98,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 *
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 339088d..c08c15e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -2022,7 +2022,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);
@@ -2093,7 +2093,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;
diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
index c45304f..82cdb8f 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
@@ -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;
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
index a101758..89e8c74 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
index 5f4e2c6..011fd12 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
index 45bd538..110449a 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
@@ -2338,7 +2338,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);
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
index f4ad299..b6a71a7 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
@@ -1660,7 +1660,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);
diff --git a/drivers/gpu/drm/amd/amdgpu/si_dma.c b/drivers/gpu/drm/amd/amdgpu/si_dma.c
index bdda8b4..122df07 100644
--- a/drivers/gpu/drm/amd/amdgpu/si_dma.c
+++ b/drivers/gpu/drm/amd/amdgpu/si_dma.c
@@ -775,7 +775,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);
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 1/5] drm/amdgpu: expand sdma copy_buffer interface with tmz parameter
@ 2019-11-18 5:18 ` Aaron Liu
0 siblings, 0 replies; 22+ messages in thread
From: Aaron Liu @ 2019-11-18 5:18 UTC (permalink / raw)
To: amd-gfx
Cc: Alexander.Deucher, Luben.Tuikov, Ray.Huang, Christian.Koenig, Aaron Liu
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>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h | 5 +++--
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 3 ++-
drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 3 ++-
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 3 ++-
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 3 ++-
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 3 ++-
drivers/gpu/drm/amd/amdgpu/si_dma.c | 3 ++-
8 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
index 761ff8b..b313465 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
@@ -79,7 +79,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;
@@ -97,7 +98,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 *
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 339088d..c08c15e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -2022,7 +2022,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);
@@ -2093,7 +2093,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;
diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
index c45304f..82cdb8f 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
@@ -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;
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
index a101758..89e8c74 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
index 5f4e2c6..011fd12 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
index 45bd538..110449a 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
@@ -2338,7 +2338,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);
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
index f4ad299..b6a71a7 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
@@ -1660,7 +1660,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);
diff --git a/drivers/gpu/drm/amd/amdgpu/si_dma.c b/drivers/gpu/drm/amd/amdgpu/si_dma.c
index bdda8b4..122df07 100644
--- a/drivers/gpu/drm/amd/amdgpu/si_dma.c
+++ b/drivers/gpu/drm/amd/amdgpu/si_dma.c
@@ -775,7 +775,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);
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 2/5] drm/amdgpu: expand amdgpu_copy_buffer interface with tmz parameter
@ 2019-11-18 5:18 ` Aaron Liu
0 siblings, 0 replies; 22+ messages in thread
From: Aaron Liu @ 2019-11-18 5:18 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Alexander.Deucher-5C7GfCeVMHo, Luben.Tuikov-5C7GfCeVMHo,
Ray.Huang-5C7GfCeVMHo, Christian.Koenig-5C7GfCeVMHo, Aaron Liu
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>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_test.c | 4 ++--
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 6 +++---
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 2 +-
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
index d1495e1..d9b35df 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index b8e5076..bba3485 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -752,7 +752,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);
}
/**
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_test.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_test.c
index b158230..476f1f8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_test.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_test.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index c08c15e..1a18aac 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -376,7 +376,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;
@@ -2052,7 +2052,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;
@@ -2093,7 +2093,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;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
index 0dddedc..f1ebd42 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
@@ -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,
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 2/5] drm/amdgpu: expand amdgpu_copy_buffer interface with tmz parameter
@ 2019-11-18 5:18 ` Aaron Liu
0 siblings, 0 replies; 22+ messages in thread
From: Aaron Liu @ 2019-11-18 5:18 UTC (permalink / raw)
To: amd-gfx
Cc: Alexander.Deucher, Luben.Tuikov, Ray.Huang, Christian.Koenig, Aaron Liu
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>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_test.c | 4 ++--
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 6 +++---
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 2 +-
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
index d1495e1..d9b35df 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index b8e5076..bba3485 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -752,7 +752,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);
}
/**
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_test.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_test.c
index b158230..476f1f8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_test.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_test.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index c08c15e..1a18aac 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -376,7 +376,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;
@@ -2052,7 +2052,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;
@@ -2093,7 +2093,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;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
index 0dddedc..f1ebd42 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
@@ -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,
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 3/5] drm/amdgpu: enable TMZ bit in sdma copy pkt for sdma v4
@ 2019-11-18 5:18 ` Aaron Liu
0 siblings, 0 replies; 22+ messages in thread
From: Aaron Liu @ 2019-11-18 5:18 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Alexander.Deucher-5C7GfCeVMHo, Luben.Tuikov-5C7GfCeVMHo,
Ray.Huang-5C7GfCeVMHo, Christian.Koenig-5C7GfCeVMHo, Aaron Liu
Enable sdma TMZ mode via setting TMZ bit in sdma copy pkt
for sdma v4
Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
index 110449a..d209cbf 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
@@ -2342,7 +2342,8 @@ static void sdma_v4_0_emit_copy_buffer(struct amdgpu_ib *ib,
bool tmz)
{
ib->ptr[ib->length_dw++] = SDMA_PKT_HEADER_OP(SDMA_OP_COPY) |
- SDMA_PKT_HEADER_SUB_OP(SDMA_SUBOP_COPY_LINEAR);
+ SDMA_PKT_HEADER_SUB_OP(SDMA_SUBOP_COPY_LINEAR) |
+ SDMA_PKT_COPY_LINEAR_HEADER_TMZ(tmz ? 1 : 0);
ib->ptr[ib->length_dw++] = byte_count - 1;
ib->ptr[ib->length_dw++] = 0; /* src/dst endian swap */
ib->ptr[ib->length_dw++] = lower_32_bits(src_offset);
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 3/5] drm/amdgpu: enable TMZ bit in sdma copy pkt for sdma v4
@ 2019-11-18 5:18 ` Aaron Liu
0 siblings, 0 replies; 22+ messages in thread
From: Aaron Liu @ 2019-11-18 5:18 UTC (permalink / raw)
To: amd-gfx
Cc: Alexander.Deucher, Luben.Tuikov, Ray.Huang, Christian.Koenig, Aaron Liu
Enable sdma TMZ mode via setting TMZ bit in sdma copy pkt
for sdma v4
Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
index 110449a..d209cbf 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
@@ -2342,7 +2342,8 @@ static void sdma_v4_0_emit_copy_buffer(struct amdgpu_ib *ib,
bool tmz)
{
ib->ptr[ib->length_dw++] = SDMA_PKT_HEADER_OP(SDMA_OP_COPY) |
- SDMA_PKT_HEADER_SUB_OP(SDMA_SUBOP_COPY_LINEAR);
+ SDMA_PKT_HEADER_SUB_OP(SDMA_SUBOP_COPY_LINEAR) |
+ SDMA_PKT_COPY_LINEAR_HEADER_TMZ(tmz ? 1 : 0);
ib->ptr[ib->length_dw++] = byte_count - 1;
ib->ptr[ib->length_dw++] = 0; /* src/dst endian swap */
ib->ptr[ib->length_dw++] = lower_32_bits(src_offset);
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 4/5] drm/amdgpu: enable TMZ bit in sdma copy pkt for sdma v5
@ 2019-11-18 5:18 ` Aaron Liu
0 siblings, 0 replies; 22+ messages in thread
From: Aaron Liu @ 2019-11-18 5:18 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Alexander.Deucher-5C7GfCeVMHo, Luben.Tuikov-5C7GfCeVMHo,
Ray.Huang-5C7GfCeVMHo, Christian.Koenig-5C7GfCeVMHo, Aaron Liu
Enable sdma TMZ mode via setting TMZ bit in sdma copy pkt
for sdma v5.
Signed-off-by: Aaron Liu <aaron.liu@amd.com>
---
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
index b6a71a7..64c53ee 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
@@ -1664,7 +1664,8 @@ static void sdma_v5_0_emit_copy_buffer(struct amdgpu_ib *ib,
bool tmz)
{
ib->ptr[ib->length_dw++] = SDMA_PKT_HEADER_OP(SDMA_OP_COPY) |
- SDMA_PKT_HEADER_SUB_OP(SDMA_SUBOP_COPY_LINEAR);
+ SDMA_PKT_HEADER_SUB_OP(SDMA_SUBOP_COPY_LINEAR) |
+ SDMA_PKT_COPY_LINEAR_HEADER_TMZ(tmz ? 1 : 0);
ib->ptr[ib->length_dw++] = byte_count - 1;
ib->ptr[ib->length_dw++] = 0; /* src/dst endian swap */
ib->ptr[ib->length_dw++] = lower_32_bits(src_offset);
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 4/5] drm/amdgpu: enable TMZ bit in sdma copy pkt for sdma v5
@ 2019-11-18 5:18 ` Aaron Liu
0 siblings, 0 replies; 22+ messages in thread
From: Aaron Liu @ 2019-11-18 5:18 UTC (permalink / raw)
To: amd-gfx
Cc: Alexander.Deucher, Luben.Tuikov, Ray.Huang, Christian.Koenig, Aaron Liu
Enable sdma TMZ mode via setting TMZ bit in sdma copy pkt
for sdma v5.
Signed-off-by: Aaron Liu <aaron.liu@amd.com>
---
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
index b6a71a7..64c53ee 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
@@ -1664,7 +1664,8 @@ static void sdma_v5_0_emit_copy_buffer(struct amdgpu_ib *ib,
bool tmz)
{
ib->ptr[ib->length_dw++] = SDMA_PKT_HEADER_OP(SDMA_OP_COPY) |
- SDMA_PKT_HEADER_SUB_OP(SDMA_SUBOP_COPY_LINEAR);
+ SDMA_PKT_HEADER_SUB_OP(SDMA_SUBOP_COPY_LINEAR) |
+ SDMA_PKT_COPY_LINEAR_HEADER_TMZ(tmz ? 1 : 0);
ib->ptr[ib->length_dw++] = byte_count - 1;
ib->ptr[ib->length_dw++] = 0; /* src/dst endian swap */
ib->ptr[ib->length_dw++] = lower_32_bits(src_offset);
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 5/5] drm/amdgpu: enable TMZ bit in FRAME_CONTROL for gfx10
@ 2019-11-18 5:18 ` Aaron Liu
0 siblings, 0 replies; 22+ messages in thread
From: Aaron Liu @ 2019-11-18 5:18 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Alexander.Deucher-5C7GfCeVMHo, Luben.Tuikov-5C7GfCeVMHo,
Ray.Huang-5C7GfCeVMHo, Christian.Koenig-5C7GfCeVMHo, Aaron Liu
This patch enables TMZ bit in FRAME_CONTROL for gfx10.
Signed-off-by: Aaron Liu <aaron.liu@amd.com>
---
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index d6e11ee..8dce067 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -4588,7 +4588,7 @@ static void gfx_v10_0_ring_emit_cntxcntl(struct amdgpu_ring *ring,
gfx_v10_0_ring_emit_ce_meta(ring,
flags & AMDGPU_IB_PREEMPTED ? true : false);
- gfx_v10_0_ring_emit_tmz(ring, true, false);
+ gfx_v10_0_ring_emit_tmz(ring, true, trusted);
dw2 |= 0x80000000; /* set load_enable otherwise this package is just NOPs */
if (flags & AMDGPU_HAVE_CTX_SWITCH) {
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 5/5] drm/amdgpu: enable TMZ bit in FRAME_CONTROL for gfx10
@ 2019-11-18 5:18 ` Aaron Liu
0 siblings, 0 replies; 22+ messages in thread
From: Aaron Liu @ 2019-11-18 5:18 UTC (permalink / raw)
To: amd-gfx
Cc: Alexander.Deucher, Luben.Tuikov, Ray.Huang, Christian.Koenig, Aaron Liu
This patch enables TMZ bit in FRAME_CONTROL for gfx10.
Signed-off-by: Aaron Liu <aaron.liu@amd.com>
---
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index d6e11ee..8dce067 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -4588,7 +4588,7 @@ static void gfx_v10_0_ring_emit_cntxcntl(struct amdgpu_ring *ring,
gfx_v10_0_ring_emit_ce_meta(ring,
flags & AMDGPU_IB_PREEMPTED ? true : false);
- gfx_v10_0_ring_emit_tmz(ring, true, false);
+ gfx_v10_0_ring_emit_tmz(ring, true, trusted);
dw2 |= 0x80000000; /* set load_enable otherwise this package is just NOPs */
if (flags & AMDGPU_HAVE_CTX_SWITCH) {
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 1/5] drm/amdgpu: expand sdma copy_buffer interface with tmz parameter
@ 2019-11-18 6:16 ` Huang, Ray
0 siblings, 0 replies; 22+ messages in thread
From: Huang, Ray @ 2019-11-18 6:16 UTC (permalink / raw)
To: Liu, Aaron
Cc: Deucher, Alexander, Tuikov, Luben, Koenig, Christian,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Series are Reviewed-by: Huang Rui <ray.huang@amd.com>
On Mon, Nov 18, 2019 at 01:18:32PM +0800, Liu, Aaron wrote:
> 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>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h | 5 +++--
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
> drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/si_dma.c | 3 ++-
> 8 files changed, 17 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
> index 761ff8b..b313465 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
> @@ -79,7 +79,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;
> @@ -97,7 +98,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 *
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 339088d..c08c15e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -2022,7 +2022,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);
> @@ -2093,7 +2093,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;
> diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> index c45304f..82cdb8f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> +++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> @@ -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;
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> index a101758..89e8c74 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> @@ -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);
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> index 5f4e2c6..011fd12 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> @@ -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);
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> index 45bd538..110449a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> @@ -2338,7 +2338,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);
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> index f4ad299..b6a71a7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> @@ -1660,7 +1660,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);
> diff --git a/drivers/gpu/drm/amd/amdgpu/si_dma.c b/drivers/gpu/drm/amd/amdgpu/si_dma.c
> index bdda8b4..122df07 100644
> --- a/drivers/gpu/drm/amd/amdgpu/si_dma.c
> +++ b/drivers/gpu/drm/amd/amdgpu/si_dma.c
> @@ -775,7 +775,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);
> --
> 2.7.4
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 1/5] drm/amdgpu: expand sdma copy_buffer interface with tmz parameter
@ 2019-11-18 6:16 ` Huang, Ray
0 siblings, 0 replies; 22+ messages in thread
From: Huang, Ray @ 2019-11-18 6:16 UTC (permalink / raw)
To: Liu, Aaron; +Cc: Deucher, Alexander, Tuikov, Luben, Koenig, Christian, amd-gfx
Series are Reviewed-by: Huang Rui <ray.huang@amd.com>
On Mon, Nov 18, 2019 at 01:18:32PM +0800, Liu, Aaron wrote:
> 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>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h | 5 +++--
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
> drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/si_dma.c | 3 ++-
> 8 files changed, 17 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
> index 761ff8b..b313465 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
> @@ -79,7 +79,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;
> @@ -97,7 +98,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 *
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 339088d..c08c15e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -2022,7 +2022,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);
> @@ -2093,7 +2093,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;
> diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> index c45304f..82cdb8f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> +++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> @@ -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;
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> index a101758..89e8c74 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> @@ -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);
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> index 5f4e2c6..011fd12 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> @@ -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);
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> index 45bd538..110449a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> @@ -2338,7 +2338,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);
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> index f4ad299..b6a71a7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> @@ -1660,7 +1660,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);
> diff --git a/drivers/gpu/drm/amd/amdgpu/si_dma.c b/drivers/gpu/drm/amd/amdgpu/si_dma.c
> index bdda8b4..122df07 100644
> --- a/drivers/gpu/drm/amd/amdgpu/si_dma.c
> +++ b/drivers/gpu/drm/amd/amdgpu/si_dma.c
> @@ -775,7 +775,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);
> --
> 2.7.4
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 1/5] drm/amdgpu: expand sdma copy_buffer interface with tmz parameter
@ 2019-11-19 23:11 ` Luben Tuikov
0 siblings, 0 replies; 22+ messages in thread
From: Luben Tuikov @ 2019-11-19 23:11 UTC (permalink / raw)
To: Aaron Liu, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Alexander.Deucher-5C7GfCeVMHo, Ray.Huang-5C7GfCeVMHo,
Christian.Koenig-5C7GfCeVMHo
I wonder if we really do need yet another function argument,
thus increasing the argument list, or if the "tmz" boolean
can/is already a property of the job/command/ib/etc., and
if it can indeed be had from the latter entity...?
Regards,
Luben
On 2019-11-18 12:18 a.m., Aaron Liu wrote:
> 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>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h | 5 +++--
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
> drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/si_dma.c | 3 ++-
> 8 files changed, 17 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
> index 761ff8b..b313465 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
> @@ -79,7 +79,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;
> @@ -97,7 +98,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 *
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 339088d..c08c15e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -2022,7 +2022,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);
> @@ -2093,7 +2093,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;
> diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> index c45304f..82cdb8f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> +++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> @@ -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;
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> index a101758..89e8c74 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> @@ -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);
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> index 5f4e2c6..011fd12 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> @@ -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);
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> index 45bd538..110449a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> @@ -2338,7 +2338,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);
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> index f4ad299..b6a71a7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> @@ -1660,7 +1660,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);
> diff --git a/drivers/gpu/drm/amd/amdgpu/si_dma.c b/drivers/gpu/drm/amd/amdgpu/si_dma.c
> index bdda8b4..122df07 100644
> --- a/drivers/gpu/drm/amd/amdgpu/si_dma.c
> +++ b/drivers/gpu/drm/amd/amdgpu/si_dma.c
> @@ -775,7 +775,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);
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 1/5] drm/amdgpu: expand sdma copy_buffer interface with tmz parameter
@ 2019-11-19 23:11 ` Luben Tuikov
0 siblings, 0 replies; 22+ messages in thread
From: Luben Tuikov @ 2019-11-19 23:11 UTC (permalink / raw)
To: Aaron Liu, amd-gfx; +Cc: Alexander.Deucher, Ray.Huang, Christian.Koenig
I wonder if we really do need yet another function argument,
thus increasing the argument list, or if the "tmz" boolean
can/is already a property of the job/command/ib/etc., and
if it can indeed be had from the latter entity...?
Regards,
Luben
On 2019-11-18 12:18 a.m., Aaron Liu wrote:
> 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>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h | 5 +++--
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
> drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/si_dma.c | 3 ++-
> 8 files changed, 17 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
> index 761ff8b..b313465 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
> @@ -79,7 +79,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;
> @@ -97,7 +98,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 *
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 339088d..c08c15e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -2022,7 +2022,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);
> @@ -2093,7 +2093,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;
> diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> index c45304f..82cdb8f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> +++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> @@ -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;
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> index a101758..89e8c74 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> @@ -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);
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> index 5f4e2c6..011fd12 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> @@ -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);
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> index 45bd538..110449a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> @@ -2338,7 +2338,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);
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> index f4ad299..b6a71a7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> @@ -1660,7 +1660,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);
> diff --git a/drivers/gpu/drm/amd/amdgpu/si_dma.c b/drivers/gpu/drm/amd/amdgpu/si_dma.c
> index bdda8b4..122df07 100644
> --- a/drivers/gpu/drm/amd/amdgpu/si_dma.c
> +++ b/drivers/gpu/drm/amd/amdgpu/si_dma.c
> @@ -775,7 +775,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);
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 5/5] drm/amdgpu: enable TMZ bit in FRAME_CONTROL for gfx10
@ 2019-11-19 23:51 ` Luben Tuikov
0 siblings, 0 replies; 22+ messages in thread
From: Luben Tuikov @ 2019-11-19 23:51 UTC (permalink / raw)
To: Aaron Liu, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Alexander.Deucher-5C7GfCeVMHo, Ray.Huang-5C7GfCeVMHo,
Christian.Koenig-5C7GfCeVMHo
On 2019-11-18 12:18 a.m., Aaron Liu wrote:
> This patch enables TMZ bit in FRAME_CONTROL for gfx10.
>
> Signed-off-by: Aaron Liu <aaron.liu@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> index d6e11ee..8dce067 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> @@ -4588,7 +4588,7 @@ static void gfx_v10_0_ring_emit_cntxcntl(struct amdgpu_ring *ring,
> gfx_v10_0_ring_emit_ce_meta(ring,
> flags & AMDGPU_IB_PREEMPTED ? true : false);
>
> - gfx_v10_0_ring_emit_tmz(ring, true, false);
> + gfx_v10_0_ring_emit_tmz(ring, true, trusted);
>
Do you mean here "true" (the opposite of "false") as opposed to "trusted"?
Regards,
Luben
> dw2 |= 0x80000000; /* set load_enable otherwise this package is just NOPs */
> if (flags & AMDGPU_HAVE_CTX_SWITCH) {
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 5/5] drm/amdgpu: enable TMZ bit in FRAME_CONTROL for gfx10
@ 2019-11-19 23:51 ` Luben Tuikov
0 siblings, 0 replies; 22+ messages in thread
From: Luben Tuikov @ 2019-11-19 23:51 UTC (permalink / raw)
To: Aaron Liu, amd-gfx; +Cc: Alexander.Deucher, Ray.Huang, Christian.Koenig
On 2019-11-18 12:18 a.m., Aaron Liu wrote:
> This patch enables TMZ bit in FRAME_CONTROL for gfx10.
>
> Signed-off-by: Aaron Liu <aaron.liu@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> index d6e11ee..8dce067 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> @@ -4588,7 +4588,7 @@ static void gfx_v10_0_ring_emit_cntxcntl(struct amdgpu_ring *ring,
> gfx_v10_0_ring_emit_ce_meta(ring,
> flags & AMDGPU_IB_PREEMPTED ? true : false);
>
> - gfx_v10_0_ring_emit_tmz(ring, true, false);
> + gfx_v10_0_ring_emit_tmz(ring, true, trusted);
>
Do you mean here "true" (the opposite of "false") as opposed to "trusted"?
Regards,
Luben
> dw2 |= 0x80000000; /* set load_enable otherwise this package is just NOPs */
> if (flags & AMDGPU_HAVE_CTX_SWITCH) {
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: [PATCH 1/5] drm/amdgpu: expand sdma copy_buffer interface with tmz parameter
@ 2019-11-20 3:06 ` Liu, Aaron
0 siblings, 0 replies; 22+ messages in thread
From: Liu, Aaron @ 2019-11-20 3:06 UTC (permalink / raw)
To: Tuikov, Luben, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Deucher, Alexander, Huang, Ray, Koenig, Christian
BR,
Aaron Liu
> -----Original Message-----
> From: Tuikov, Luben <Luben.Tuikov@amd.com>
> Sent: Wednesday, November 20, 2019 7:12 AM
> To: Liu, Aaron <Aaron.Liu@amd.com>; amd-gfx@lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Huang, Ray
> <Ray.Huang@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>
> Subject: Re: [PATCH 1/5] drm/amdgpu: expand sdma copy_buffer interface
> with tmz parameter
>
> I wonder if we really do need yet another function argument, thus increasing
> the argument list, or if the "tmz" boolean can/is already a property of the
> job/command/ib/etc., and if it can indeed be had from the latter entity...?
>
Hi Luben,
In fact, I also thought about it. Compared to add this argument to other entities, perhaps it
is more clearly and simply. Another reason is that TMZ is a relatively independent property.
> Regards,
> Luben
>
> On 2019-11-18 12:18 a.m., Aaron Liu wrote:
> > 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>
> > ---
> > drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h | 5 +++--
> > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
> > drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 3 ++-
> > drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 3 ++-
> > drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 3 ++-
> > drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 3 ++-
> > drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 3 ++-
> > drivers/gpu/drm/amd/amdgpu/si_dma.c | 3 ++-
> > 8 files changed, 17 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
> > index 761ff8b..b313465 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
> > @@ -79,7 +79,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;
> > @@ -97,7 +98,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 *
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > index 339088d..c08c15e 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > @@ -2022,7 +2022,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); @@ -2093,7 +2093,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;
> > diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> > b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> > index c45304f..82cdb8f 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> > @@ -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; diff --git
> > a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> > b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> > index a101758..89e8c74 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> > @@ -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);
> > diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> > b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> > index 5f4e2c6..011fd12 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> > @@ -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);
> > diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> > b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> > index 45bd538..110449a 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> > @@ -2338,7 +2338,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);
> > diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> > b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> > index f4ad299..b6a71a7 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> > @@ -1660,7 +1660,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);
> > diff --git a/drivers/gpu/drm/amd/amdgpu/si_dma.c
> > b/drivers/gpu/drm/amd/amdgpu/si_dma.c
> > index bdda8b4..122df07 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/si_dma.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/si_dma.c
> > @@ -775,7 +775,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);
> >
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: [PATCH 1/5] drm/amdgpu: expand sdma copy_buffer interface with tmz parameter
@ 2019-11-20 3:06 ` Liu, Aaron
0 siblings, 0 replies; 22+ messages in thread
From: Liu, Aaron @ 2019-11-20 3:06 UTC (permalink / raw)
To: Tuikov, Luben, amd-gfx; +Cc: Deucher, Alexander, Huang, Ray, Koenig, Christian
BR,
Aaron Liu
> -----Original Message-----
> From: Tuikov, Luben <Luben.Tuikov@amd.com>
> Sent: Wednesday, November 20, 2019 7:12 AM
> To: Liu, Aaron <Aaron.Liu@amd.com>; amd-gfx@lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Huang, Ray
> <Ray.Huang@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>
> Subject: Re: [PATCH 1/5] drm/amdgpu: expand sdma copy_buffer interface
> with tmz parameter
>
> I wonder if we really do need yet another function argument, thus increasing
> the argument list, or if the "tmz" boolean can/is already a property of the
> job/command/ib/etc., and if it can indeed be had from the latter entity...?
>
Hi Luben,
In fact, I also thought about it. Compared to add this argument to other entities, perhaps it
is more clearly and simply. Another reason is that TMZ is a relatively independent property.
> Regards,
> Luben
>
> On 2019-11-18 12:18 a.m., Aaron Liu wrote:
> > 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>
> > ---
> > drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h | 5 +++--
> > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
> > drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 3 ++-
> > drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 3 ++-
> > drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 3 ++-
> > drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 3 ++-
> > drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 3 ++-
> > drivers/gpu/drm/amd/amdgpu/si_dma.c | 3 ++-
> > 8 files changed, 17 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
> > index 761ff8b..b313465 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
> > @@ -79,7 +79,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;
> > @@ -97,7 +98,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 *
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > index 339088d..c08c15e 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > @@ -2022,7 +2022,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); @@ -2093,7 +2093,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;
> > diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> > b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> > index c45304f..82cdb8f 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> > @@ -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; diff --git
> > a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> > b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> > index a101758..89e8c74 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> > @@ -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);
> > diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> > b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> > index 5f4e2c6..011fd12 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> > @@ -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);
> > diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> > b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> > index 45bd538..110449a 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> > @@ -2338,7 +2338,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);
> > diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> > b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> > index f4ad299..b6a71a7 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> > @@ -1660,7 +1660,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);
> > diff --git a/drivers/gpu/drm/amd/amdgpu/si_dma.c
> > b/drivers/gpu/drm/amd/amdgpu/si_dma.c
> > index bdda8b4..122df07 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/si_dma.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/si_dma.c
> > @@ -775,7 +775,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);
> >
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: [PATCH 5/5] drm/amdgpu: enable TMZ bit in FRAME_CONTROL for gfx10
@ 2019-11-20 3:10 ` Liu, Aaron
0 siblings, 0 replies; 22+ messages in thread
From: Liu, Aaron @ 2019-11-20 3:10 UTC (permalink / raw)
To: Tuikov, Luben, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Deucher, Alexander, Huang, Ray, Koenig, Christian
BR,
Aaron Liu
> -----Original Message-----
> From: Tuikov, Luben <Luben.Tuikov@amd.com>
> Sent: Wednesday, November 20, 2019 7:52 AM
> To: Liu, Aaron <Aaron.Liu@amd.com>; amd-gfx@lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Huang, Ray
> <Ray.Huang@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>
> Subject: Re: [PATCH 5/5] drm/amdgpu: enable TMZ bit in FRAME_CONTROL
> for gfx10
>
> On 2019-11-18 12:18 a.m., Aaron Liu wrote:
> > This patch enables TMZ bit in FRAME_CONTROL for gfx10.
> >
> > Signed-off-by: Aaron Liu <aaron.liu@amd.com>
> > ---
> > drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> > index d6e11ee..8dce067 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> > @@ -4588,7 +4588,7 @@ static void gfx_v10_0_ring_emit_cntxcntl(struct
> amdgpu_ring *ring,
> > gfx_v10_0_ring_emit_ce_meta(ring,
> > flags & AMDGPU_IB_PREEMPTED ? true :
> false);
> >
> > - gfx_v10_0_ring_emit_tmz(ring, true, false);
> > + gfx_v10_0_ring_emit_tmz(ring, true, trusted);
> >
>
> Do you mean here "true" (the opposite of "false") as opposed to "trusted"?
>
Here need to consider both non-TMZ and TMZ. Trusted value is decided by cs.in.flags in
amdgpu_cs_submit* from libdrm.
> Regards,
> Luben
>
> > dw2 |= 0x80000000; /* set load_enable otherwise this package is just
> NOPs */
> > if (flags & AMDGPU_HAVE_CTX_SWITCH) {
> >
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: [PATCH 5/5] drm/amdgpu: enable TMZ bit in FRAME_CONTROL for gfx10
@ 2019-11-20 3:10 ` Liu, Aaron
0 siblings, 0 replies; 22+ messages in thread
From: Liu, Aaron @ 2019-11-20 3:10 UTC (permalink / raw)
To: Tuikov, Luben, amd-gfx; +Cc: Deucher, Alexander, Huang, Ray, Koenig, Christian
BR,
Aaron Liu
> -----Original Message-----
> From: Tuikov, Luben <Luben.Tuikov@amd.com>
> Sent: Wednesday, November 20, 2019 7:52 AM
> To: Liu, Aaron <Aaron.Liu@amd.com>; amd-gfx@lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Huang, Ray
> <Ray.Huang@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>
> Subject: Re: [PATCH 5/5] drm/amdgpu: enable TMZ bit in FRAME_CONTROL
> for gfx10
>
> On 2019-11-18 12:18 a.m., Aaron Liu wrote:
> > This patch enables TMZ bit in FRAME_CONTROL for gfx10.
> >
> > Signed-off-by: Aaron Liu <aaron.liu@amd.com>
> > ---
> > drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> > index d6e11ee..8dce067 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> > @@ -4588,7 +4588,7 @@ static void gfx_v10_0_ring_emit_cntxcntl(struct
> amdgpu_ring *ring,
> > gfx_v10_0_ring_emit_ce_meta(ring,
> > flags & AMDGPU_IB_PREEMPTED ? true :
> false);
> >
> > - gfx_v10_0_ring_emit_tmz(ring, true, false);
> > + gfx_v10_0_ring_emit_tmz(ring, true, trusted);
> >
>
> Do you mean here "true" (the opposite of "false") as opposed to "trusted"?
>
Here need to consider both non-TMZ and TMZ. Trusted value is decided by cs.in.flags in
amdgpu_cs_submit* from libdrm.
> Regards,
> Luben
>
> > dw2 |= 0x80000000; /* set load_enable otherwise this package is just
> NOPs */
> > if (flags & AMDGPU_HAVE_CTX_SWITCH) {
> >
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 1/5] drm/amdgpu: expand sdma copy_buffer interface with tmz parameter
@ 2019-11-20 8:13 ` Christian König
0 siblings, 0 replies; 22+ messages in thread
From: Christian König @ 2019-11-20 8:13 UTC (permalink / raw)
To: Liu, Aaron, Tuikov, Luben, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Deucher, Alexander, Huang, Ray
Am 20.11.19 um 04:06 schrieb Liu, Aaron:
>
> BR,
> Aaron Liu
>
>> -----Original Message-----
>> From: Tuikov, Luben <Luben.Tuikov@amd.com>
>> Sent: Wednesday, November 20, 2019 7:12 AM
>> To: Liu, Aaron <Aaron.Liu@amd.com>; amd-gfx@lists.freedesktop.org
>> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Huang, Ray
>> <Ray.Huang@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>
>> Subject: Re: [PATCH 1/5] drm/amdgpu: expand sdma copy_buffer interface
>> with tmz parameter
>>
>> I wonder if we really do need yet another function argument, thus increasing
>> the argument list, or if the "tmz" boolean can/is already a property of the
>> job/command/ib/etc., and if it can indeed be had from the latter entity...?
>>
> Hi Luben,
> In fact, I also thought about it. Compared to add this argument to other entities, perhaps it
> is more clearly and simply. Another reason is that TMZ is a relatively independent property.
That idea came to my mind as well while reviewing this, but there is one
killer argument why we need this:
For correct eviction of encrypted buffers we will want to do a secure
copy to a staging area and then an unsecure copy to the final destination.
So you need a secure and an unsecure copy in the same IB (or go the
extra hassle to emit two IBs).
Regards,
Christian.
>
>> Regards,
>> Luben
>>
>> On 2019-11-18 12:18 a.m., Aaron Liu wrote:
>>> 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>
>>> ---
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h | 5 +++--
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
>>> drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 3 ++-
>>> drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 3 ++-
>>> drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 3 ++-
>>> drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 3 ++-
>>> drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 3 ++-
>>> drivers/gpu/drm/amd/amdgpu/si_dma.c | 3 ++-
>>> 8 files changed, 17 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
>>> index 761ff8b..b313465 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
>>> @@ -79,7 +79,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;
>>> @@ -97,7 +98,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 *
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>>> index 339088d..c08c15e 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>>> @@ -2022,7 +2022,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); @@ -2093,7 +2093,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;
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
>>> b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
>>> index c45304f..82cdb8f 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
>>> @@ -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; diff --git
>>> a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
>>> b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
>>> index a101758..89e8c74 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
>>> @@ -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);
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
>>> b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
>>> index 5f4e2c6..011fd12 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
>>> @@ -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);
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>>> b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>>> index 45bd538..110449a 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>>> @@ -2338,7 +2338,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);
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
>>> b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
>>> index f4ad299..b6a71a7 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
>>> @@ -1660,7 +1660,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);
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/si_dma.c
>>> b/drivers/gpu/drm/amd/amdgpu/si_dma.c
>>> index bdda8b4..122df07 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/si_dma.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/si_dma.c
>>> @@ -775,7 +775,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);
>>>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 1/5] drm/amdgpu: expand sdma copy_buffer interface with tmz parameter
@ 2019-11-20 8:13 ` Christian König
0 siblings, 0 replies; 22+ messages in thread
From: Christian König @ 2019-11-20 8:13 UTC (permalink / raw)
To: Liu, Aaron, Tuikov, Luben, amd-gfx; +Cc: Deucher, Alexander, Huang, Ray
Am 20.11.19 um 04:06 schrieb Liu, Aaron:
>
> BR,
> Aaron Liu
>
>> -----Original Message-----
>> From: Tuikov, Luben <Luben.Tuikov@amd.com>
>> Sent: Wednesday, November 20, 2019 7:12 AM
>> To: Liu, Aaron <Aaron.Liu@amd.com>; amd-gfx@lists.freedesktop.org
>> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Huang, Ray
>> <Ray.Huang@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>
>> Subject: Re: [PATCH 1/5] drm/amdgpu: expand sdma copy_buffer interface
>> with tmz parameter
>>
>> I wonder if we really do need yet another function argument, thus increasing
>> the argument list, or if the "tmz" boolean can/is already a property of the
>> job/command/ib/etc., and if it can indeed be had from the latter entity...?
>>
> Hi Luben,
> In fact, I also thought about it. Compared to add this argument to other entities, perhaps it
> is more clearly and simply. Another reason is that TMZ is a relatively independent property.
That idea came to my mind as well while reviewing this, but there is one
killer argument why we need this:
For correct eviction of encrypted buffers we will want to do a secure
copy to a staging area and then an unsecure copy to the final destination.
So you need a secure and an unsecure copy in the same IB (or go the
extra hassle to emit two IBs).
Regards,
Christian.
>
>> Regards,
>> Luben
>>
>> On 2019-11-18 12:18 a.m., Aaron Liu wrote:
>>> 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>
>>> ---
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h | 5 +++--
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
>>> drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 3 ++-
>>> drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 3 ++-
>>> drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 3 ++-
>>> drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 3 ++-
>>> drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 3 ++-
>>> drivers/gpu/drm/amd/amdgpu/si_dma.c | 3 ++-
>>> 8 files changed, 17 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
>>> index 761ff8b..b313465 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
>>> @@ -79,7 +79,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;
>>> @@ -97,7 +98,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 *
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>>> index 339088d..c08c15e 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>>> @@ -2022,7 +2022,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); @@ -2093,7 +2093,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;
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
>>> b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
>>> index c45304f..82cdb8f 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
>>> @@ -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; diff --git
>>> a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
>>> b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
>>> index a101758..89e8c74 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
>>> @@ -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);
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
>>> b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
>>> index 5f4e2c6..011fd12 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
>>> @@ -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);
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>>> b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>>> index 45bd538..110449a 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>>> @@ -2338,7 +2338,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);
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
>>> b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
>>> index f4ad299..b6a71a7 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
>>> @@ -1660,7 +1660,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);
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/si_dma.c
>>> b/drivers/gpu/drm/amd/amdgpu/si_dma.c
>>> index bdda8b4..122df07 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/si_dma.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/si_dma.c
>>> @@ -775,7 +775,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);
>>>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2019-11-20 8:14 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-18 5:18 [PATCH 1/5] drm/amdgpu: expand sdma copy_buffer interface with tmz parameter Aaron Liu
2019-11-18 5:18 ` Aaron Liu
[not found] ` <1574054316-2802-1-git-send-email-aaron.liu-5C7GfCeVMHo@public.gmane.org>
2019-11-18 5:18 ` [PATCH 2/5] drm/amdgpu: expand amdgpu_copy_buffer " Aaron Liu
2019-11-18 5:18 ` Aaron Liu
2019-11-18 5:18 ` [PATCH 3/5] drm/amdgpu: enable TMZ bit in sdma copy pkt for sdma v4 Aaron Liu
2019-11-18 5:18 ` Aaron Liu
2019-11-18 5:18 ` [PATCH 4/5] drm/amdgpu: enable TMZ bit in sdma copy pkt for sdma v5 Aaron Liu
2019-11-18 5:18 ` Aaron Liu
2019-11-18 5:18 ` [PATCH 5/5] drm/amdgpu: enable TMZ bit in FRAME_CONTROL for gfx10 Aaron Liu
2019-11-18 5:18 ` Aaron Liu
[not found] ` <1574054316-2802-5-git-send-email-aaron.liu-5C7GfCeVMHo@public.gmane.org>
2019-11-19 23:51 ` Luben Tuikov
2019-11-19 23:51 ` Luben Tuikov
[not found] ` <de8125e7-a483-4701-7d29-2ba33ca3e21d-5C7GfCeVMHo@public.gmane.org>
2019-11-20 3:10 ` Liu, Aaron
2019-11-20 3:10 ` Liu, Aaron
2019-11-18 6:16 ` [PATCH 1/5] drm/amdgpu: expand sdma copy_buffer interface with tmz parameter Huang, Ray
2019-11-18 6:16 ` Huang, Ray
2019-11-19 23:11 ` Luben Tuikov
2019-11-19 23:11 ` Luben Tuikov
[not found] ` <8edd5526-b762-59d2-7b02-cabe5f5658e9-5C7GfCeVMHo@public.gmane.org>
2019-11-20 3:06 ` Liu, Aaron
2019-11-20 3:06 ` Liu, Aaron
[not found] ` <MN2PR12MB3838DC6674DF376565BC805EF04F0-rweVpJHSKTrcE+Ck/nypMAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-11-20 8:13 ` Christian König
2019-11-20 8:13 ` Christian König
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.