From d8960d6b578f24736cf24f98f5222769c310a040 Mon Sep 17 00:00:00 2001 From: Graham Sider Date: Mon, 3 Apr 2023 15:57:00 -0400 Subject: [PATCH] libhsakmt: Mask stepping version for GC 9.4.3 checks GC 9.4.3 to set gfx target version to 9.4.x dependent on revision and capabilities. Due to this, where applicable, mask off the gfx target stepping version and only check major/minor version (9.4). There are no collisions due to this change since GC 9.4.3 is the only ASIC that uses gfx target version 9.4.x. Signed-off-by: Graham Sider Change-Id: I72803e594c421f054d18ccfa7e92c507128fa5be [ROCm/ROCR-Runtime commit: 831d1ad352445088c07e5726a20847224e8a1960] --- projects/rocr-runtime/src/queues.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/projects/rocr-runtime/src/queues.c b/projects/rocr-runtime/src/queues.c index 0f3b71c755..992290c791 100644 --- a/projects/rocr-runtime/src/queues.c +++ b/projects/rocr-runtime/src/queues.c @@ -86,23 +86,16 @@ static struct process_doorbells *doorbells; uint32_t get_vgpr_size_per_cu(uint32_t gfxv) { - uint32_t vgpr_size = 0; + uint32_t vgpr_size = 0x40000; - switch (gfxv) - { - case GFX_VERSION_ARCTURUS: - case GFX_VERSION_ALDEBARAN: - case GFX_VERSION_AQUA_VANJARAM: - vgpr_size = 0x80000; - break; - case GFX_VERSION_PLUM_BONITO: - case GFX_VERSION_WHEAT_NAS: - vgpr_size = 0x60000; - break; - default: - vgpr_size = 0x40000; - break; - } + if ((gfxv & ~(0xff)) == GFX_VERSION_AQUA_VANJARAM || + gfxv == GFX_VERSION_ALDEBARAN || + gfxv == GFX_VERSION_ARCTURUS) + vgpr_size = 0x80000; + + else if (gfxv == GFX_VERSION_PLUM_BONITO || + gfxv == GFX_VERSION_WHEAT_NAS) + vgpr_size = 0x60000; return vgpr_size; } @@ -616,7 +609,7 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtCreateQueue(HSAuint32 NodeId, if (q->gfxv == GFX_VERSION_TONGA) q->eop_buffer_size = TONGA_PAGE_SIZE; - else if (q->gfxv == GFX_VERSION_AQUA_VANJARAM) + else if ((q->gfxv & ~(0xff)) == GFX_VERSION_AQUA_VANJARAM) q->eop_buffer_size = ((Type == HSA_QUEUE_COMPUTE) ? 4096 : 0); else if (q->gfxv >= 0x80000) q->eop_buffer_size = 4096;