drm/amdkfd: Delete a useless parameter from create_queue function pointer
Subsystems (3)
PATCH 1/1 drm/amdkfd: Delete a useless parameter from create_queue function pointer
--- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 13 +++---------- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h | 3 +-- drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 6 ++---- 3 files changed, 6 insertions(+), 16 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +3 -10
@@ -149,8 +149,7 @@ static void deallocate_vmid(struct device_queue_manager *dqm,static int create_queue_nocpsch (struct device_queue_manager *dqm,struct queue *q, -struct qcm_process_device *qpd, -int *allocated_vmid) +struct qcm_process_device *qpd) {int retval;
@@ -170,7 +169,6 @@ static int create_queue_nocpsch(struct device_queue_manager *dqm,if (retval) goto out_unlock; } - *allocated_vmid = qpd->vmid; q->properties.vmid = qpd->vmid; q->properties.tba_addr = qpd->tba_addr;
@@ -184,10 +182,8 @@ static int create_queue_nocpsch(struct device_queue_manager *dqm, retval = -EINVAL ;if (retval) { -if (list_empty (&qpd->queues_list)) { +if (list_empty (&qpd->queues_list))deallocate_vmid (dqm, qpd, q); - *allocated_vmid =0 ; - } goto out_unlock; }
@@ -812,16 +808,13 @@ static void destroy_kernel_queue_cpsch(struct device_queue_manager *dqm, }static int create_queue_cpsch (struct device_queue_manager *dqm,struct queue *q, -struct qcm_process_device *qpd,int *allocate_vmid) +struct qcm_process_device *qpd) {int retval;struct mqd_manager *mqd; retval =0 ; -if (allocate_vmid) - *allocate_vmid =0 ; -mutex_lock (&dqm->lock);if (dqm->total_queue_count >= max_num_of_queues_per_device) {
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h +1 -2
@@ -84,8 +84,7 @@ struct device_process_node {struct device_queue_manager_ops {int (*create_queue)(struct device_queue_manager *dqm,struct queue *q, -struct qcm_process_device *qpd, -int *allocate_vmid); +struct qcm_process_device *qpd); int (*destroy_queue)(struct device_queue_manager *dqm, struct qcm_process_device *qpd,
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +2 -4
@@ -201,8 +201,7 @@ int pqm_create_queue(struct process_queue_manager *pqm, goto err_create_queue; pqn->q = q; pqn->kq =NULL ; - retval = dev->dqm->ops.create_queue (dev->dqm, q, &pdd->qpd, - &q->properties.vmid); + retval = dev->dqm->ops.create_queue (dev->dqm, q, &pdd->qpd);pr_debug ("DQM returned %d for create_queue\n" , retval);print_queue (q);break ;
@@ -222,8 +221,7 @@ int pqm_create_queue(struct process_queue_manager *pqm, goto err_create_queue; pqn->q = q; pqn->kq =NULL ; - retval = dev->dqm->ops.create_queue (dev->dqm, q, &pdd->qpd, - &q->properties.vmid); + retval = dev->dqm->ops.create_queue (dev->dqm, q, &pdd->qpd);pr_debug ("DQM returned %d for create_queue\n" , retval);print_queue (q);break ;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1511565054-25530-1-git-send-email-yong.zhao-5C7GfCeVMHo@public.gmane.org
Oded Gabbay
AppliedQuoted 99 lines · Felix Kuehling
From: shaoyunl <[email protected]>
HWS does not support over-subscription and the scheduler can not internally modify the engine. Driver needs to program the correct engine ID.
Fix the queue and engine selection to create queues on alternating SDMA engines. This allows concurrent bi-directional DMA transfers in a process that creates two SDMA queues.
Signed-off-by shaoyun liu <[email protected]>Signed-off-by Felix Kuehling <[email protected]>--- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 29 +++++++++++----------- drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c | 2 +- 2 files changed, 16 insertions(+), 15 deletions(-)drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +15
-14@@ -621,8 +621,8 @@ static int create_sdma_queue_nocpsch(struct device_queue_manager *dqm,if (retval)return retval; - q->properties.sdma_queue_id = q->sdma_id %CIK_SDMA_QUEUES_PER_ENGINE ; - q->properties.sdma_engine_id = q->sdma_id /CIK_SDMA_ENGINE_NUM ; + q->properties.sdma_queue_id = q->sdma_id /CIK_SDMA_QUEUES_PER_ENGINE ; + q->properties.sdma_engine_id = q->sdma_id %CIK_SDMA_QUEUES_PER_ENGINE ;pr_debug ("SDMA id is: %d\n" , q->sdma_id);pr_debug ("SDMA queue id: %d\n" , q->properties.sdma_queue_id);@@ -704,6 +704,7 @@ static int initialize_cpsch(struct device_queue_manager *dqm) dqm->queue_count = dqm->processes_count =0 ; dqm->sdma_queue_count =0 ; dqm->active_runlist = false; + dqm->sdma_bitmap = (1 <<CIK_SDMA_QUEUES ) -1 ; retval = dqm->ops_asic_specific.initialize (dqm);if (retval)mutex_destroy (&dqm->lock);@@ -811,14 +812,6 @@ static void destroy_kernel_queue_cpsch(struct device_queue_manager *dqm,mutex_unlock (&dqm->lock); } -static void select_sdma_engine_id (struct queue *q) -{ -static int sdma_id; - - q->sdma_id = sdma_id; - sdma_id = (sdma_id +1 ) %2 ; -} -static int create_queue_cpsch (struct device_queue_manager *dqm,struct queue *q,struct qcm_process_device *qpd,int *allocate_vmid) {@@ -839,9 +832,15 @@ static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q, goto out; } -if (q->properties.type ==KFD_QUEUE_TYPE_SDMA ) -select_sdma_engine_id (q); - +if (q->properties.type ==KFD_QUEUE_TYPE_SDMA ) { + retval =allocate_sdma_queue (dqm, &q->sdma_id); +if (retval !=0 ) + goto out; + q->properties.sdma_queue_id = + q->sdma_id /CIK_SDMA_QUEUES_PER_ENGINE ; + q->properties.sdma_engine_id = + q->sdma_id %CIK_SDMA_QUEUES_PER_ENGINE ; + } mqd = dqm->ops.get_mqd_manager (dqm,get_mqd_type_from_queue_type (q->properties.type));@@ -1015,8 +1014,10 @@ static int destroy_queue_cpsch(struct device_queue_manager *dqm, goto failed; } -if (q->properties.type ==KFD_QUEUE_TYPE_SDMA ) +if (q->properties.type ==KFD_QUEUE_TYPE_SDMA ) { dqm->sdma_queue_count--; +deallocate_sdma_queue (dqm, q->sdma_id); + }list_del (&q->list); qpd->queue_count--;drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c +1
-2@@ -203,7 +203,7 @@ static int pm_create_map_queue(struct packet_manager *pm, uint32_t *buffer, queue_type__mes_map_queues__debug_interface_queue_vi;break ;case KFD_QUEUE_TYPE_SDMA : - packet->bitfields2.engine_sel = + packet->bitfields2.engine_sel = q->properties.sdma_engine_id + engine_sel__mes_map_queues__sdma0_vi; use_static = false;/* no static queues under SDMA */ break ; --
Quoted 2 lines
2.7.4
Applied to -next
Thanks,
Oded
Quoted 99 lines · Yong Zhao
Signed-off-by Yong Zhao <[email protected]>Reviewed-by Felix Kuehling <[email protected]>--- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 13 +++---------- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h | 3 +-- drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 6 ++---- 3 files changed, 6 insertions(+), 16 deletions(-)drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +3
-10@@ -149,8 +149,7 @@ static void deallocate_vmid(struct device_queue_manager *dqm,static int create_queue_nocpsch (struct device_queue_manager *dqm,struct queue *q, -struct qcm_process_device *qpd, -int *allocated_vmid) +struct qcm_process_device *qpd) {int retval;@@ -170,7 +169,6 @@ static int create_queue_nocpsch(struct device_queue_manager *dqm,if (retval) goto out_unlock; } - *allocated_vmid = qpd->vmid; q->properties.vmid = qpd->vmid; q->properties.tba_addr = qpd->tba_addr;@@ -184,10 +182,8 @@ static int create_queue_nocpsch(struct device_queue_manager *dqm, retval = -EINVAL ;if (retval) { -if (list_empty (&qpd->queues_list)) { +if (list_empty (&qpd->queues_list))deallocate_vmid (dqm, qpd, q); - *allocated_vmid =0 ; - } goto out_unlock; }@@ -812,16 +808,13 @@ static void destroy_kernel_queue_cpsch(struct device_queue_manager *dqm, }static int create_queue_cpsch (struct device_queue_manager *dqm,struct queue *q, -struct qcm_process_device *qpd,int *allocate_vmid) +struct qcm_process_device *qpd) {int retval;struct mqd_manager *mqd; retval =0 ; -if (allocate_vmid) - *allocate_vmid =0 ; -mutex_lock (&dqm->lock);if (dqm->total_queue_count >= max_num_of_queues_per_device) {drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h +1
-2@@ -84,8 +84,7 @@ struct device_process_node {struct device_queue_manager_ops {int (*create_queue)(struct device_queue_manager *dqm,struct queue *q, -struct qcm_process_device *qpd, -int *allocate_vmid); +struct qcm_process_device *qpd); int (*destroy_queue)(struct device_queue_manager *dqm, struct qcm_process_device *qpd,drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +2
-5@@ -201,8 +201,7 @@ int pqm_create_queue(struct process_queue_manager *pqm, goto err_create_queue; pqn->q = q; pqn->kq =NULL ; - retval = dev->dqm->ops.create_queue (dev->dqm, q, &pdd->qpd, - &q->properties.vmid); + retval = dev->dqm->ops.create_queue (dev->dqm, q, &pdd->qpd);pr_debug ("DQM returned %d for create_queue\n" , retval);print_queue (q);break ;@@ -222,8 +221,7 @@ int pqm_create_queue(struct process_queue_manager *pqm, goto err_create_queue; pqn->q = q; pqn->kq =NULL ; - retval = dev->dqm->ops.create_queue (dev->dqm, q, &pdd->qpd, - &q->properties.vmid); + retval = dev->dqm->ops.create_queue (dev->dqm, q, &pdd->qpd);pr_debug ("DQM returned %d for create_queue\n" , retval);print_queue (q);break ; --
Quoted 2 lines
2.7.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx