summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2016-02-03 18:52:18 -0500
committerAlex Deucher <alexander.deucher@amd.com>2016-02-04 12:24:15 -0500
commit0edc442560c792f9dc1acdc51c0c1a3b586f38d9 (patch)
tree073986012a8ba8e27c82eb51e04f55ee07e31376
parent7c656ba72fb9f004c2bd6b578fe68966d9ef9118 (diff)
downloaddrm-0edc442560c792f9dc1acdc51c0c1a3b586f38d9.tar.gz
tests/amdgpu: add a test for cp dma fill
Use the CP to fill to memory. Reviewed-by: Ken Wang <Qingqing.Wang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--tests/amdgpu/basic_tests.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/amdgpu/basic_tests.c b/tests/amdgpu/basic_tests.c
index 3e547874..a1161541 100644
--- a/tests/amdgpu/basic_tests.c
+++ b/tests/amdgpu/basic_tests.c
@@ -449,10 +449,17 @@ static void amdgpu_command_submission_cp_write_data(void)
amdgpu_command_submission_write_linear_helper(AMDGPU_HW_IP_GFX);
}
+static void amdgpu_command_submission_cp_const_fill(void)
+{
+ amdgpu_command_submission_const_fill_helper(AMDGPU_HW_IP_GFX);
+}
+
static void amdgpu_command_submission_gfx(void)
{
/* write data using the CP */
amdgpu_command_submission_cp_write_data();
+ /* const fill using the CP */
+ amdgpu_command_submission_cp_const_fill();
/* separate IB buffers for multi-IB submission */
amdgpu_command_submission_gfx_separate_ibs();
/* shared IB buffer for multi-IB submission */
@@ -896,6 +903,17 @@ static void amdgpu_command_submission_const_fill_helper(unsigned ip_type)
pm4[i++] = (0xffffffff00000000 & bo_mc) >> 32;
pm4[i++] = 0xdeadbeaf;
pm4[i++] = sdma_write_length;
+ } else if (ip_type == AMDGPU_HW_IP_GFX) {
+ pm4[i++] = PACKET3(PACKET3_DMA_DATA, 5);
+ pm4[i++] = PACKET3_DMA_DATA_ENGINE(0) |
+ PACKET3_DMA_DATA_DST_SEL(0) |
+ PACKET3_DMA_DATA_SRC_SEL(2) |
+ PACKET3_DMA_DATA_CP_SYNC;
+ pm4[i++] = 0xdeadbeaf;
+ pm4[i++] = 0;
+ pm4[i++] = 0xfffffffc & bo_mc;
+ pm4[i++] = (0xffffffff00000000 & bo_mc) >> 32;
+ pm4[i++] = sdma_write_length;
}
amdgpu_test_exec_cs_helper(context_handle,