libhsakmt: Extend thunk queue creation with recommended sdma engines
Extend the current Thunk implementation of queue creation to target specific SDMA engine IDs. Also expose the new recommend SDMA engines per IO link from the KFD sysfs. Change-Id: I51f9a0d83c0f1fc4d5dc837f879a7ae332e7d7e9
This commit is contained in:
+22
-1
@@ -601,6 +601,24 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtCreateQueue(HSAuint32 NodeId,
|
||||
HSAuint64 QueueSizeInBytes,
|
||||
HsaEvent *Event,
|
||||
HsaQueueResource *QueueResource)
|
||||
{
|
||||
if (Type >= HSA_QUEUE_SDMA_BY_ENG_ID)
|
||||
return HSAKMT_STATUS_ERROR;
|
||||
|
||||
return hsaKmtCreateQueueExt(NodeId, Type, QueuePercentage, Priority, 0,
|
||||
QueueAddress, QueueSizeInBytes, Event,
|
||||
QueueResource);
|
||||
}
|
||||
|
||||
HSAKMT_STATUS HSAKMTAPI hsaKmtCreateQueueExt(HSAuint32 NodeId,
|
||||
HSA_QUEUE_TYPE Type,
|
||||
HSAuint32 QueuePercentage,
|
||||
HSA_QUEUE_PRIORITY Priority,
|
||||
HSAuint32 SdmaEngineId,
|
||||
void *QueueAddress,
|
||||
HSAuint64 QueueSizeInBytes,
|
||||
HsaEvent *Event,
|
||||
HsaQueueResource *QueueResource)
|
||||
{
|
||||
HSAKMT_STATUS result;
|
||||
uint32_t gpu_id;
|
||||
@@ -664,6 +682,9 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtCreateQueue(HSAuint32 NodeId,
|
||||
case HSA_QUEUE_SDMA_XGMI:
|
||||
args.queue_type = KFD_IOC_QUEUE_TYPE_SDMA_XGMI;
|
||||
break;
|
||||
case HSA_QUEUE_SDMA_BY_ENG_ID:
|
||||
args.queue_type = KFD_IOC_QUEUE_TYPE_SDMA_BY_ENG_ID;
|
||||
break;
|
||||
case HSA_QUEUE_COMPUTE_AQL:
|
||||
args.queue_type = KFD_IOC_QUEUE_TYPE_COMPUTE_AQL;
|
||||
break;
|
||||
@@ -688,6 +709,7 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtCreateQueue(HSAuint32 NodeId,
|
||||
args.ring_size = QueueSizeInBytes;
|
||||
args.queue_percentage = QueuePercentage;
|
||||
args.queue_priority = priority_map[Priority+3];
|
||||
args.sdma_engine_id = SdmaEngineId;
|
||||
|
||||
err = kmtIoctl(kfd_fd, AMDKFD_IOC_CREATE_QUEUE, &args);
|
||||
|
||||
@@ -730,7 +752,6 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtCreateQueue(HSAuint32 NodeId,
|
||||
return HSAKMT_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
HSAKMT_STATUS HSAKMTAPI hsaKmtUpdateQueue(HSA_QUEUEID QueueId,
|
||||
HSAuint32 QueuePercentage,
|
||||
HSA_QUEUE_PRIORITY Priority,
|
||||
|
||||
@@ -1695,6 +1695,8 @@ static HSAKMT_STATUS topology_sysfs_get_iolink_props(uint32_t node_id,
|
||||
props->MaximumBandwidth = (uint32_t)prop_val;
|
||||
else if (strcmp(prop_name, "recommended_transfer_size") == 0)
|
||||
props->RecTransferSize = (uint32_t)prop_val;
|
||||
else if (strcmp(prop_name, "recommended_sdma_engine_id_mask") == 0)
|
||||
props->RecSdmaEngIdMask = (uint32_t)prop_val;
|
||||
else if (strcmp(prop_name, "flags") == 0)
|
||||
props->Flags.LinkProperty = (uint32_t)prop_val;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user