Commit fc133acc authored by Mukul Joshi's avatar Mukul Joshi Committed by Alex Deucher
Browse files

drm/amdkfd: Enable GWS on GFX9.4.3



Enable GWS capable queue creation for forward
progress gaurantee on GFX 9.4.3.

Signed-off-by: default avatarMukul Joshi <mukul.joshi@amd.com>
Reviewed-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 1af3d0a8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -518,6 +518,7 @@ static int kfd_gws_init(struct kfd_node *node)
			&& kfd->mec2_fw_version >= 0x30)   ||
		(KFD_GC_VERSION(node) == IP_VERSION(9, 4, 2)
			&& kfd->mec2_fw_version >= 0x28) ||
		(KFD_GC_VERSION(node) == IP_VERSION(9, 4, 3)) ||
		(KFD_GC_VERSION(node) >= IP_VERSION(10, 3, 0)
			&& KFD_GC_VERSION(node) < IP_VERSION(11, 0, 0)
			&& kfd->mec2_fw_version >= 0x6b))))
+23 −12
Original line number Diff line number Diff line
@@ -123,6 +123,7 @@ int pqm_set_gws(struct process_queue_manager *pqm, unsigned int qid,
	if (!gws && pdd->qpd.num_gws == 0)
		return -EINVAL;

	if (KFD_GC_VERSION(dev) != IP_VERSION(9, 4, 3)) {
		if (gws)
			ret = amdgpu_amdkfd_add_gws_to_process(pdd->process->kgd_process_info,
				gws, &mem);
@@ -131,8 +132,15 @@ int pqm_set_gws(struct process_queue_manager *pqm, unsigned int qid,
				pqn->q->gws);
		if (unlikely(ret))
			return ret;

		pqn->q->gws = mem;
	} else {
		/*
		 * Intentionally set GWS to a non-NULL value
		 * for GFX 9.4.3.
		 */
		pqn->q->gws = gws ? ERR_PTR(-ENOMEM) : NULL;
	}

	pdd->qpd.num_gws = gws ? dev->adev->gds.gws_size : 0;

	return pqn->q->device->dqm->ops.update_queue(pqn->q->device->dqm,
@@ -164,7 +172,8 @@ void pqm_uninit(struct process_queue_manager *pqm)
	struct process_queue_node *pqn, *next;

	list_for_each_entry_safe(pqn, next, &pqm->queues, process_queue_list) {
		if (pqn->q && pqn->q->gws)
		if (pqn->q && pqn->q->gws &&
		    KFD_GC_VERSION(pqn->q->device) != IP_VERSION(9, 4, 3))
			amdgpu_amdkfd_remove_gws_from_process(pqm->process->kgd_process_info,
				pqn->q->gws);
		kfd_procfs_del_queue(pqn->q);
@@ -446,7 +455,9 @@ int pqm_destroy_queue(struct process_queue_manager *pqm, unsigned int qid)
		}

		if (pqn->q->gws) {
			amdgpu_amdkfd_remove_gws_from_process(pqm->process->kgd_process_info,
			if (KFD_GC_VERSION(pqn->q->device) != IP_VERSION(9, 4, 3))
				amdgpu_amdkfd_remove_gws_from_process(
						pqm->process->kgd_process_info,
						pqn->q->gws);
			pdd->qpd.num_gws = 0;
		}