Re: [PATCH v2] tests/amdgpu: add vce mv tests support and sets
On 04/04/2018 03:17 PM, James Zhu wrote: On 2018-04-04 02:44 PM, Leo Liu wrote: On 04/04/2018 12:43 PM, James Zhu wrote: Signed-off-by: James Zhu --- tests/amdgpu/vce_ib.h| 21 - tests/amdgpu/vce_tests.c | 224 ++- 2 files changed, 240 insertions(+), 5 deletions(-) diff --git a/tests/amdgpu/vce_ib.h b/tests/amdgpu/vce_ib.h index 80ab179..cbdcc71 100644 --- a/tests/amdgpu/vce_ib.h +++ b/tests/amdgpu/vce_ib.h @@ -41,7 +41,7 @@ static uint32_t vce_taskinfo[8] = { 0x, }; -static const uint32_t vce_create[] = { +static uint32_t vce_create[] = { 0x0030, 0x0101, 0x, @@ -144,7 +144,7 @@ static const uint32_t vce_rdo[] = { 0x, }; -static const uint32_t vce_pic_ctrl[] = { +static uint32_t vce_pic_ctrl[] = { 0x0074, 0x0402, 0x, @@ -315,4 +315,21 @@ static const uint32_t vce_destroy[] = { 0x0008, 0x0201, }; + Parameters array in header should keep read-only. You should modify IB on the fly with the conditions. James: can make it with adding a flag. +static const uint32_t vce_mv_buffer[] = { + 0x0038, + 0x050d, + 0x, + 0x, + 0x, + 0x, + 0x, + 0x, + 0x, + 0x, + 0x, + 0x, + 0x, + 0x, +}; #endif /*_vce_ib_h*/ diff --git a/tests/amdgpu/vce_tests.c b/tests/amdgpu/vce_tests.c index 25c0b1f..7b5351a 100644 --- a/tests/amdgpu/vce_tests.c +++ b/tests/amdgpu/vce_tests.c @@ -37,6 +37,7 @@ #define IB_SIZE 4096 #define MAX_RESOURCES 16 +#define FW_53_0_03 ((53 << 24) | (0 << 16) | (03 << 8)) struct amdgpu_vce_bo { amdgpu_bo_handle handle; @@ -55,6 +56,9 @@ struct amdgpu_vce_encode { struct amdgpu_vce_bo cpb; unsigned ib_len; bool two_instance; + struct amdgpu_vce_bo mvrefbuf; + struct amdgpu_vce_bo mvb; + unsigned mvbuf_size; }; static amdgpu_device_handle device_handle; @@ -62,6 +66,9 @@ static uint32_t major_version; static uint32_t minor_version; static uint32_t family_id; static uint32_t vce_harvest_config; +static uint32_t chip_rev; +static uint32_t chip_id; +static uint32_t ids_flags; static amdgpu_context_handle context_handle; static amdgpu_bo_handle ib_handle; @@ -75,33 +82,62 @@ static unsigned num_resources; static void amdgpu_cs_vce_create(void); static void amdgpu_cs_vce_encode(void); +static void amdgpu_cs_vce_preset_mv(void); +static void amdgpu_cs_vce_encode_mv(void); static void amdgpu_cs_vce_destroy(void); CU_TestInfo vce_tests[] = { { "VCE create", amdgpu_cs_vce_create }, { "VCE encode", amdgpu_cs_vce_encode }, { "VCE destroy", amdgpu_cs_vce_destroy }, + { "VCE MV preset", amdgpu_cs_vce_preset_mv }, + { "VCE MV create", amdgpu_cs_vce_create }, + { "VCE MV dump", amdgpu_cs_vce_encode_mv }, + { "VCE MV destroy", amdgpu_cs_vce_destroy }, Why to add create/destroy again? my understanding is that all the operations should be executable with one pair of create/destroy. James: They are two different tests, one is encode, and the other is MV dump. create has different setting for normal test and MV dump test. As far as I can see, there is only one difference from create as below, but that might be ignorable as well. vce_create[11] = 0x0100; /* disableTwoInstance */ CU_TEST_INFO_NULL, }; - CU_BOOL suite_vce_tests_enable(void) { + uint32_t version, feature; + CU_BOOL ret_mv = CU_FALSE; + if (amdgpu_device_initialize(drm_amdgpu[0], &major_version, &minor_version, &device_handle)) return CU_FALSE; family_id = device_handle->info.family_id; + chip_rev = device_handle->info.chip_rev; + chip_id = device_handle->info.chip_external_rev; + ids_flags = device_handle->info.ids_flags; + + amdgpu_query_firmware_version(device_handle, AMDGPU_INFO_FW_VCE, 0, + 0, &version, &feature); if (amdgpu_device_deinitialize(device_handle)) return CU_FALSE; - if (family_id >= AMDGPU_FAMILY_RV || family_id == AMDGPU_FAMILY_SI) { printf("\n\nThe ASIC NOT support VCE, suite disabled\n"); return CU_FALSE; } + if (!(chip_id == (chip_rev + 0x3C) || /* FIJI */ + chip_id == (chip_rev + 0x50) || /* Polaris 10*/ + chip_id == (chip_rev + 0x5A) || /* Polaris 11*/ + chip_id == (chip_rev + 0x64) || /* Polaris 12*/ + (family_id > AMDGPU_FAMILY_VI && !ids_flags))) /* dGPU > Polaris */ + printf("\n\nThe ASIC NOT support VCE MV, suite disa
Re: [PATCH v2] tests/amdgpu: add vce mv tests support and sets
On 2018-04-04 02:44 PM, Leo Liu wrote: On 04/04/2018 12:43 PM, James Zhu wrote: Signed-off-by: James Zhu --- tests/amdgpu/vce_ib.h| 21 - tests/amdgpu/vce_tests.c | 224 ++- 2 files changed, 240 insertions(+), 5 deletions(-) diff --git a/tests/amdgpu/vce_ib.h b/tests/amdgpu/vce_ib.h index 80ab179..cbdcc71 100644 --- a/tests/amdgpu/vce_ib.h +++ b/tests/amdgpu/vce_ib.h @@ -41,7 +41,7 @@ static uint32_t vce_taskinfo[8] = { 0x, }; -static const uint32_t vce_create[] = { +static uint32_t vce_create[] = { 0x0030, 0x0101, 0x, @@ -144,7 +144,7 @@ static const uint32_t vce_rdo[] = { 0x, }; -static const uint32_t vce_pic_ctrl[] = { +static uint32_t vce_pic_ctrl[] = { 0x0074, 0x0402, 0x, @@ -315,4 +315,21 @@ static const uint32_t vce_destroy[] = { 0x0008, 0x0201, }; + Parameters array in header should keep read-only. You should modify IB on the fly with the conditions. James: can make it with adding a flag. +static const uint32_t vce_mv_buffer[] = { + 0x0038, + 0x050d, + 0x, + 0x, + 0x, + 0x, + 0x, + 0x, + 0x, + 0x, + 0x, + 0x, + 0x, + 0x, +}; #endif /*_vce_ib_h*/ diff --git a/tests/amdgpu/vce_tests.c b/tests/amdgpu/vce_tests.c index 25c0b1f..7b5351a 100644 --- a/tests/amdgpu/vce_tests.c +++ b/tests/amdgpu/vce_tests.c @@ -37,6 +37,7 @@ #define IB_SIZE 4096 #define MAX_RESOURCES 16 +#define FW_53_0_03 ((53 << 24) | (0 << 16) | (03 << 8)) struct amdgpu_vce_bo { amdgpu_bo_handle handle; @@ -55,6 +56,9 @@ struct amdgpu_vce_encode { struct amdgpu_vce_bo cpb; unsigned ib_len; bool two_instance; + struct amdgpu_vce_bo mvrefbuf; + struct amdgpu_vce_bo mvb; + unsigned mvbuf_size; }; static amdgpu_device_handle device_handle; @@ -62,6 +66,9 @@ static uint32_t major_version; static uint32_t minor_version; static uint32_t family_id; static uint32_t vce_harvest_config; +static uint32_t chip_rev; +static uint32_t chip_id; +static uint32_t ids_flags; static amdgpu_context_handle context_handle; static amdgpu_bo_handle ib_handle; @@ -75,33 +82,62 @@ static unsigned num_resources; static void amdgpu_cs_vce_create(void); static void amdgpu_cs_vce_encode(void); +static void amdgpu_cs_vce_preset_mv(void); +static void amdgpu_cs_vce_encode_mv(void); static void amdgpu_cs_vce_destroy(void); CU_TestInfo vce_tests[] = { { "VCE create", amdgpu_cs_vce_create }, { "VCE encode", amdgpu_cs_vce_encode }, { "VCE destroy", amdgpu_cs_vce_destroy }, + { "VCE MV preset", amdgpu_cs_vce_preset_mv }, + { "VCE MV create", amdgpu_cs_vce_create }, + { "VCE MV dump", amdgpu_cs_vce_encode_mv }, + { "VCE MV destroy", amdgpu_cs_vce_destroy }, Why to add create/destroy again? my understanding is that all the operations should be executable with one pair of create/destroy. James: They are two different tests, one is encode, and the other is MV dump. create has different setting for normal test and MV dump test. CU_TEST_INFO_NULL, }; - CU_BOOL suite_vce_tests_enable(void) { + uint32_t version, feature; + CU_BOOL ret_mv = CU_FALSE; + if (amdgpu_device_initialize(drm_amdgpu[0], &major_version, &minor_version, &device_handle)) return CU_FALSE; family_id = device_handle->info.family_id; + chip_rev = device_handle->info.chip_rev; + chip_id = device_handle->info.chip_external_rev; + ids_flags = device_handle->info.ids_flags; + + amdgpu_query_firmware_version(device_handle, AMDGPU_INFO_FW_VCE, 0, + 0, &version, &feature); if (amdgpu_device_deinitialize(device_handle)) return CU_FALSE; - if (family_id >= AMDGPU_FAMILY_RV || family_id == AMDGPU_FAMILY_SI) { printf("\n\nThe ASIC NOT support VCE, suite disabled\n"); return CU_FALSE; } + if (!(chip_id == (chip_rev + 0x3C) || /* FIJI */ + chip_id == (chip_rev + 0x50) || /* Polaris 10*/ + chip_id == (chip_rev + 0x5A) || /* Polaris 11*/ + chip_id == (chip_rev + 0x64) || /* Polaris 12*/ + (family_id > AMDGPU_FAMILY_VI && !ids_flags))) /* dGPU > Polaris */ + printf("\n\nThe ASIC NOT support VCE MV, suite disabled\n"); + else if (FW_53_0_03 >= version) + printf("\n\nThe ASIC FW version NOT support VCE MV, suite disabled\n"); + else + ret_mv = CU_TRUE; + + amdgpu_set_test_activ
Re: [PATCH v2] tests/amdgpu: add vce mv tests support and sets
On 04/04/2018 12:43 PM, James Zhu wrote: Signed-off-by: James Zhu --- tests/amdgpu/vce_ib.h| 21 - tests/amdgpu/vce_tests.c | 224 ++- 2 files changed, 240 insertions(+), 5 deletions(-) diff --git a/tests/amdgpu/vce_ib.h b/tests/amdgpu/vce_ib.h index 80ab179..cbdcc71 100644 --- a/tests/amdgpu/vce_ib.h +++ b/tests/amdgpu/vce_ib.h @@ -41,7 +41,7 @@ static uint32_t vce_taskinfo[8] = { 0x, }; -static const uint32_t vce_create[] = { +static uint32_t vce_create[] = { 0x0030, 0x0101, 0x, @@ -144,7 +144,7 @@ static const uint32_t vce_rdo[] = { 0x, }; -static const uint32_t vce_pic_ctrl[] = { +static uint32_t vce_pic_ctrl[] = { 0x0074, 0x0402, 0x, @@ -315,4 +315,21 @@ static const uint32_t vce_destroy[] = { 0x0008, 0x0201, }; + Parameters array in header should keep read-only. You should modify IB on the fly with the conditions. +static const uint32_t vce_mv_buffer[] = { + 0x0038, + 0x050d, + 0x, + 0x, + 0x, + 0x, + 0x, + 0x, + 0x, + 0x, + 0x, + 0x, + 0x, + 0x, +}; #endif /*_vce_ib_h*/ diff --git a/tests/amdgpu/vce_tests.c b/tests/amdgpu/vce_tests.c index 25c0b1f..7b5351a 100644 --- a/tests/amdgpu/vce_tests.c +++ b/tests/amdgpu/vce_tests.c @@ -37,6 +37,7 @@ #define IB_SIZE 4096 #define MAX_RESOURCES 16 +#define FW_53_0_03 ((53 << 24) | (0 << 16) | (03 << 8)) struct amdgpu_vce_bo { amdgpu_bo_handle handle; @@ -55,6 +56,9 @@ struct amdgpu_vce_encode { struct amdgpu_vce_bo cpb; unsigned ib_len; bool two_instance; + struct amdgpu_vce_bo mvrefbuf; + struct amdgpu_vce_bo mvb; + unsigned mvbuf_size; }; static amdgpu_device_handle device_handle; @@ -62,6 +66,9 @@ static uint32_t major_version; static uint32_t minor_version; static uint32_t family_id; static uint32_t vce_harvest_config; +static uint32_t chip_rev; +static uint32_t chip_id; +static uint32_t ids_flags; static amdgpu_context_handle context_handle; static amdgpu_bo_handle ib_handle; @@ -75,33 +82,62 @@ static unsigned num_resources; static void amdgpu_cs_vce_create(void); static void amdgpu_cs_vce_encode(void); +static void amdgpu_cs_vce_preset_mv(void); +static void amdgpu_cs_vce_encode_mv(void); static void amdgpu_cs_vce_destroy(void); CU_TestInfo vce_tests[] = { { "VCE create", amdgpu_cs_vce_create }, { "VCE encode", amdgpu_cs_vce_encode }, { "VCE destroy", amdgpu_cs_vce_destroy }, + { "VCE MV preset", amdgpu_cs_vce_preset_mv }, + { "VCE MV create", amdgpu_cs_vce_create }, + { "VCE MV dump", amdgpu_cs_vce_encode_mv }, + { "VCE MV destroy", amdgpu_cs_vce_destroy }, Why to add create/destroy again? my understanding is that all the operations should be executable with one pair of create/destroy. CU_TEST_INFO_NULL, }; - CU_BOOL suite_vce_tests_enable(void) { + uint32_t version, feature; + CU_BOOL ret_mv = CU_FALSE; + if (amdgpu_device_initialize(drm_amdgpu[0], &major_version, &minor_version, &device_handle)) return CU_FALSE; family_id = device_handle->info.family_id; + chip_rev = device_handle->info.chip_rev; + chip_id = device_handle->info.chip_external_rev; + ids_flags = device_handle->info.ids_flags; + + amdgpu_query_firmware_version(device_handle, AMDGPU_INFO_FW_VCE, 0, + 0, &version, &feature); if (amdgpu_device_deinitialize(device_handle)) return CU_FALSE; - if (family_id >= AMDGPU_FAMILY_RV || family_id == AMDGPU_FAMILY_SI) { printf("\n\nThe ASIC NOT support VCE, suite disabled\n"); return CU_FALSE; } + if (!(chip_id == (chip_rev + 0x3C) || /* FIJI */ + chip_id == (chip_rev + 0x50) || /* Polaris 10*/ + chip_id == (chip_rev + 0x5A) || /* Polaris 11*/ + chip_id == (chip_rev + 0x64) || /* Polaris 12*/ + (family_id > AMDGPU_FAMILY_VI && !ids_flags))) /* dGPU > Polaris */ + printf("\n\nThe ASIC NOT support VCE MV, suite disabled\n"); + else if (FW_53_0_03 >= version) + printf("\n\nThe ASIC FW version NOT support VCE MV, suite disabled\n"); + else + ret_mv = CU_TRUE; + + amdgpu_set_test_active("VCE Tests", "VCE MV preset", ret_mv); + amdgpu_set_test_active("VCE Tests", "VCE MV create", ret_mv); + amdgpu_set_test_active("VCE Tests", "VCE MV dump", ret_mv); + amdgpu_set_test_active("VCE Tests", "