tests/amdgpu: add a test for cp dma copy

Use the CP to copy data between buffers

Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
main
Alex Deucher 2016-02-03 18:59:33 -05:00
parent 35c35ea66d
commit 6950af4e84
1 changed files with 18 additions and 0 deletions

View File

@ -455,12 +455,19 @@ static void amdgpu_command_submission_cp_const_fill(void)
amdgpu_command_submission_const_fill_helper(AMDGPU_HW_IP_GFX); amdgpu_command_submission_const_fill_helper(AMDGPU_HW_IP_GFX);
} }
static void amdgpu_command_submission_cp_copy_data(void)
{
amdgpu_command_submission_copy_linear_helper(AMDGPU_HW_IP_GFX);
}
static void amdgpu_command_submission_gfx(void) static void amdgpu_command_submission_gfx(void)
{ {
/* write data using the CP */ /* write data using the CP */
amdgpu_command_submission_cp_write_data(); amdgpu_command_submission_cp_write_data();
/* const fill using the CP */ /* const fill using the CP */
amdgpu_command_submission_cp_const_fill(); amdgpu_command_submission_cp_const_fill();
/* copy data using the CP */
amdgpu_command_submission_cp_copy_data();
/* separate IB buffers for multi-IB submission */ /* separate IB buffers for multi-IB submission */
amdgpu_command_submission_gfx_separate_ibs(); amdgpu_command_submission_gfx_separate_ibs();
/* shared IB buffer for multi-IB submission */ /* shared IB buffer for multi-IB submission */
@ -1023,6 +1030,17 @@ static void amdgpu_command_submission_copy_linear_helper(unsigned ip_type)
pm4[i++] = (0xffffffff00000000 & bo1_mc) >> 32; pm4[i++] = (0xffffffff00000000 & bo1_mc) >> 32;
pm4[i++] = 0xffffffff & bo2_mc; pm4[i++] = 0xffffffff & bo2_mc;
pm4[i++] = (0xffffffff00000000 & bo2_mc) >> 32; pm4[i++] = (0xffffffff00000000 & bo2_mc) >> 32;
} 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(0) |
PACKET3_DMA_DATA_CP_SYNC;
pm4[i++] = 0xfffffffc & bo1_mc;
pm4[i++] = (0xffffffff00000000 & bo1_mc) >> 32;
pm4[i++] = 0xfffffffc & bo2_mc;
pm4[i++] = (0xffffffff00000000 & bo2_mc) >> 32;
pm4[i++] = sdma_write_length;
} }
amdgpu_test_exec_cs_helper(context_handle, amdgpu_test_exec_cs_helper(context_handle,