mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-20 08:10:11 +01:00
tests/amdgpu: make amdgpu_command_submission_sdma_copy_linear generic
So it can be shared for CP tests. Reviewed-by: Ken Wang <Qingqing.Wang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
0edc442560
commit
35c35ea66d
1 changed files with 17 additions and 10 deletions
|
|
@ -51,6 +51,7 @@ static void amdgpu_semaphore_test(void);
|
|||
|
||||
static void amdgpu_command_submission_write_linear_helper(unsigned ip_type);
|
||||
static void amdgpu_command_submission_const_fill_helper(unsigned ip_type);
|
||||
static void amdgpu_command_submission_copy_linear_helper(unsigned ip_type);
|
||||
|
||||
CU_TestInfo basic_tests[] = {
|
||||
{ "Query Info Test", amdgpu_query_info_test },
|
||||
|
|
@ -949,7 +950,7 @@ static void amdgpu_command_submission_sdma_const_fill(void)
|
|||
amdgpu_command_submission_const_fill_helper(AMDGPU_HW_IP_DMA);
|
||||
}
|
||||
|
||||
static void amdgpu_command_submission_sdma_copy_linear(void)
|
||||
static void amdgpu_command_submission_copy_linear_helper(unsigned ip_type)
|
||||
{
|
||||
const int sdma_write_length = 1024;
|
||||
const int pm4_dw = 256;
|
||||
|
|
@ -1014,6 +1015,7 @@ static void amdgpu_command_submission_sdma_copy_linear(void)
|
|||
|
||||
/* fullfill PM4: test DMA copy linear */
|
||||
i = j = 0;
|
||||
if (ip_type == AMDGPU_HW_IP_DMA) {
|
||||
pm4[i++] = SDMA_PACKET(SDMA_OPCODE_COPY, SDMA_COPY_SUB_OPCODE_LINEAR, 0);
|
||||
pm4[i++] = sdma_write_length;
|
||||
pm4[i++] = 0;
|
||||
|
|
@ -1021,10 +1023,10 @@ static void amdgpu_command_submission_sdma_copy_linear(void)
|
|||
pm4[i++] = (0xffffffff00000000 & bo1_mc) >> 32;
|
||||
pm4[i++] = 0xffffffff & bo2_mc;
|
||||
pm4[i++] = (0xffffffff00000000 & bo2_mc) >> 32;
|
||||
|
||||
}
|
||||
|
||||
amdgpu_test_exec_cs_helper(context_handle,
|
||||
AMDGPU_HW_IP_DMA, 0,
|
||||
ip_type, 0,
|
||||
i, pm4,
|
||||
2, resources,
|
||||
ib_info, ibs_request);
|
||||
|
|
@ -1055,6 +1057,11 @@ static void amdgpu_command_submission_sdma_copy_linear(void)
|
|||
CU_ASSERT_EQUAL(r, 0);
|
||||
}
|
||||
|
||||
static void amdgpu_command_submission_sdma_copy_linear(void)
|
||||
{
|
||||
amdgpu_command_submission_copy_linear_helper(AMDGPU_HW_IP_DMA);
|
||||
}
|
||||
|
||||
static void amdgpu_command_submission_sdma(void)
|
||||
{
|
||||
amdgpu_command_submission_sdma_write_linear();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue