From 197f731fbc2c473f55b87b63be60b9b8fe25aeef Mon Sep 17 00:00:00 2001 From: Gang Ba Date: Wed, 5 Sep 2018 11:40:53 -0400 Subject: [PATCH] drm/amdkfd: Added gfx904 and gfx803 for KFD. Change-Id: I4406dc70c776926feaecca3f2146d65259a80517 Signed-off-by: Gang Ba [ROCm/ROCR-Runtime commit: 52ec7f805e3e13b30d9af99aff619168cfc85c3a] --- projects/rocr-runtime/src/libhsakmt.h | 6 ++++-- projects/rocr-runtime/src/pmc_table.c | 4 +++- projects/rocr-runtime/src/queues.c | 14 ++++++++++++++ projects/rocr-runtime/src/topology.c | 18 ++++++++++++++---- .../tests/kfdtest/scripts/kfdtest.exclude | 9 +++++++++ .../tests/kfdtest/scripts/run_kfdtest.sh | 16 +++++++++++----- 6 files changed, 55 insertions(+), 12 deletions(-) diff --git a/projects/rocr-runtime/src/libhsakmt.h b/projects/rocr-runtime/src/libhsakmt.h index 8609af1df1..0bc971fc0a 100644 --- a/projects/rocr-runtime/src/libhsakmt.h +++ b/projects/rocr-runtime/src/libhsakmt.h @@ -96,9 +96,11 @@ enum asic_family_type { CHIP_FIJI, CHIP_POLARIS10, CHIP_POLARIS11, + CHIP_POLARIS12, CHIP_VEGA10, - CHIP_RAVEN, - CHIP_VEGA20 + CHIP_VEGA12, + CHIP_VEGA20, + CHIP_RAVEN }; #define IS_SOC15(chip) ((chip) >= CHIP_VEGA10) diff --git a/projects/rocr-runtime/src/pmc_table.c b/projects/rocr-runtime/src/pmc_table.c index b0d1a3f00f..046fec91d4 100644 --- a/projects/rocr-runtime/src/pmc_table.c +++ b/projects/rocr-runtime/src/pmc_table.c @@ -437,7 +437,7 @@ static uint32_t gfx8_sq_counter_ids[] = { 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 298 }; -/* Polaris 10/11 have the same SQ cpunter IDs but different from other gfx8's. */ +/* Polaris 10/11/12 have the same SQ cpunter IDs but different from other gfx8's. */ /* Unused counters - 167 and 275 are *_DUMMY_LAST */ static uint32_t gfx8_pl_sq_counter_ids[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, @@ -1742,9 +1742,11 @@ HSAKMT_STATUS get_block_properties(uint32_t node_id, break; case CHIP_POLARIS10: case CHIP_POLARIS11: + case CHIP_POLARIS12: *block = polaris_blocks[block_id]; break; case CHIP_VEGA10: + case CHIP_VEGA12: case CHIP_VEGA20: case CHIP_RAVEN: *block = vega_blocks[block_id]; diff --git a/projects/rocr-runtime/src/queues.c b/projects/rocr-runtime/src/queues.c index 95259bdb30..28281f5731 100644 --- a/projects/rocr-runtime/src/queues.c +++ b/projects/rocr-runtime/src/queues.c @@ -92,12 +92,24 @@ const struct device_info polaris11_device_info = { .doorbell_size = DOORBELL_SIZE_GFX8, }; +const struct device_info polaris12_device_info = { + .asic_family = CHIP_POLARIS12, + .eop_buffer_size = TONGA_PAGE_SIZE, + .doorbell_size = DOORBELL_SIZE_GFX8, +}; + const struct device_info vega10_device_info = { .asic_family = CHIP_VEGA10, .eop_buffer_size = 4096, .doorbell_size = DOORBELL_SIZE_GFX9, }; +const struct device_info vega12_device_info = { + .asic_family = CHIP_VEGA12, + .eop_buffer_size = 4096, + .doorbell_size = DOORBELL_SIZE_GFX9, +}; + const struct device_info raven_device_info = { .asic_family = CHIP_RAVEN, .eop_buffer_size = 4096, @@ -119,7 +131,9 @@ static const struct device_info *dev_lookup_table[] = { [CHIP_FIJI] = &fiji_device_info, [CHIP_POLARIS10] = &polaris10_device_info, [CHIP_POLARIS11] = &polaris11_device_info, + [CHIP_POLARIS12] = &polaris12_device_info, [CHIP_VEGA10] = &vega10_device_info, + [CHIP_VEGA12] = &vega12_device_info, [CHIP_VEGA20] = &vega20_device_info, [CHIP_RAVEN] = &raven_device_info }; diff --git a/projects/rocr-runtime/src/topology.c b/projects/rocr-runtime/src/topology.c index c00f116203..2013e6cac1 100644 --- a/projects/rocr-runtime/src/topology.c +++ b/projects/rocr-runtime/src/topology.c @@ -169,6 +169,15 @@ static struct hsa_gfxip_table { { 0x67EB, 8, 0, 3, 1, "Polaris11", CHIP_POLARIS11 }, { 0x67EF, 8, 0, 3, 1, "Polaris11", CHIP_POLARIS11 }, { 0x67FF, 8, 0, 3, 1, "Polaris11", CHIP_POLARIS11 }, + /* Polaris12 */ + { 0x6980, 8, 0, 3, 1, "Polaris12", CHIP_POLARIS12 }, + { 0x6981, 8, 0, 3, 1, "Polaris12", CHIP_POLARIS12 }, + { 0x6985, 8, 0, 3, 1, "Polaris12", CHIP_POLARIS12 }, + { 0x6986, 8, 0, 3, 1, "Polaris12", CHIP_POLARIS12 }, + { 0x6987, 8, 0, 3, 1, "Polaris12", CHIP_POLARIS12 }, + { 0x6995, 8, 0, 3, 1, "Polaris12", CHIP_POLARIS12 }, + { 0x6997, 8, 0, 3, 1, "Polaris12", CHIP_POLARIS12 }, + { 0x699F, 8, 0, 3, 1, "Polaris12", CHIP_POLARIS12 }, /* Vega10 */ { 0x6860, 9, 0, 0, 1, "Vega10", CHIP_VEGA10 }, { 0x6861, 9, 0, 0, 1, "Vega10", CHIP_VEGA10 }, @@ -180,10 +189,11 @@ static struct hsa_gfxip_table { { 0x686C, 9, 0, 0, 1, "Vega10", CHIP_VEGA10 }, { 0x687F, 9, 0, 0, 1, "Vega10", CHIP_VEGA10 }, /* Vega12 */ - { 0x69A0, 9, 0, 4, 1, "Vega12", CHIP_VEGA10 }, - { 0x69A1, 9, 0, 4, 1, "Vega12", CHIP_VEGA10 }, - { 0x69A3, 9, 0, 4, 1, "Vega12", CHIP_VEGA10 }, - { 0x69Af, 9, 0, 4, 1, "Vega12", CHIP_VEGA10 }, + { 0x69A0, 9, 0, 4, 1, "Vega12", CHIP_VEGA12 }, + { 0x69A1, 9, 0, 4, 1, "Vega12", CHIP_VEGA12 }, + { 0x69A2, 9, 0, 4, 1, "Vega12", CHIP_VEGA12 }, + { 0x69A3, 9, 0, 4, 1, "Vega12", CHIP_VEGA12 }, + { 0x69Af, 9, 0, 4, 1, "Vega12", CHIP_VEGA12 }, /* Raven */ { 0x15DD, 9, 0, 2, 0, "Raven", CHIP_RAVEN }, /* Vega20 */ diff --git a/projects/rocr-runtime/tests/kfdtest/scripts/kfdtest.exclude b/projects/rocr-runtime/tests/kfdtest/scripts/kfdtest.exclude index fcdaeb48fe..4414dbf43b 100644 --- a/projects/rocr-runtime/tests/kfdtest/scripts/kfdtest.exclude +++ b/projects/rocr-runtime/tests/kfdtest/scripts/kfdtest.exclude @@ -112,11 +112,20 @@ BAFFIN_TESTS_BLACKLIST=\ "$BLACKLIST_ALL_ASICS:"\ "$SDMA_BLACKLIST" +LEXA_TESTS_BLACKLIST=\ +"$BLACKLIST_ALL_ASICS:"\ +"$SDMA_BLACKLIST" + # KFDDBG.BasicAddressWatch is not supported on GFXv9 and later. FIXME: it should disable itself VEGA10_TESTS_BLACKLIST=\ "$BLACKLIST_ALL_ASICS:"\ "KFDDBGTest.BasicAddressWatch" +VEGA12_TESTS_BLACKLIST=\ +"$BLACKLIST_ALL_ASICS:"\ +"$SDMA_BLACKLIST:"\ +"KFDDBGTest.BasicAddressWatch" + VEGA20_TESTS_BLACKLIST=\ "$BLACKLIST_ALL_ASICS:"\ "KFDDBGTest.BasicAddressWatch:"\ diff --git a/projects/rocr-runtime/tests/kfdtest/scripts/run_kfdtest.sh b/projects/rocr-runtime/tests/kfdtest/scripts/run_kfdtest.sh index a36ebc957b..5d692b1afa 100755 --- a/projects/rocr-runtime/tests/kfdtest/scripts/run_kfdtest.sh +++ b/projects/rocr-runtime/tests/kfdtest/scripts/run_kfdtest.sh @@ -49,7 +49,7 @@ printUsage() { echo echo "Gtest arguments will be forwarded to the app" echo - echo "Valid platform options: cz, kv, tg, fj, hi, pl/el, plb/bf, vg10, all" + echo "Valid platform options: cz, kv, tg, fj, hi, pl10/el, pl11/bf, pl12/lx, vg10, vg12, vg20, all" echo "'all' option runs all tests" return 0 @@ -66,9 +66,11 @@ getFilter() { kv ) FILTER="--gtest_filter=$KV_TESTS_BLACKLIST" ;; tg ) FILTER="--gtest_filter=$TONGA_TESTS_BLACKLIST" ;; fj ) FILTER="--gtest_filter=$FIJI_TESTS_BLACKLIST" ;; - pl | el ) FILTER="--gtest_filter=$ELLESMERE_TESTS_BLACKLIST" ;; - plb | bf ) FILTER="--gtest_filter=$BAFFIN_TESTS_BLACKLIST" ;; + pl10 | el ) FILTER="--gtest_filter=$ELLESMERE_TESTS_BLACKLIST" ;; + pl11 | bf ) FILTER="--gtest_filter=$BAFFIN_TESTS_BLACKLIST" ;; + pl12 | lx ) FILTER="--gtest_filter=$LEXA_TESTS_BLACKLIST" ;; vg10 ) FILTER="--gtest_filter=$VEGA10_TESTS_BLACKLIST" ;; + vg12 ) FILTER="--gtest_filter=$VEGA12_TESTS_BLACKLIST" ;; vg20 ) FILTER="--gtest_filter=$VEGA20_TESTS_BLACKLIST" ;; rv ) FILTER="--gtest_filter=$RAVEN_TESTS_BLACKLIST" ;; all ) FILTER="" ;; @@ -109,11 +111,15 @@ deviceIdToGpuName() { 7300 | 730f) platformName="fj" ;; 67c0 | 67c1 | 67c2 | 67c4 | 67c7 | 67c8 | 67c9 | 67ca | 67cc | 67cf | 67d0 | 67df ) - platformName="pl" ;; + platformName="pl10" ;; 67e0 | 67e1 | 67e3 | 67e7 | 67e8 | 67e9 | 67eb | 67ef | 67ff ) - platformName="plb" ;; + platformName="pl11" ;; + 6980 | 6981 | 6985 | 6986 | 6987 | 6995 | 6997 | 699f) + platformName="pl12" ;; 6860 | 6861 | 6862 | 6863 | 6864 | 6867 | 6868 | 6869 | 686a | 686b | 686c | 687f) platformName="vg10" ;; + 69a0 | 69a1 | 69a2 | 69a3 | 69af) + platformName="vg12" ;; 66a0 | 66a1 | 66a2 | 66a3 |66a7 | 66af) platformName="vg20" ;; 15dd )