Skip to contentSkip to conversation

drm/amdgpu: set the userq xcp_id

PATCH Superseded Prike Liang 1 participant 1 message Jun 9

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: set the userq xcp_id

Initialize the userq xcp_id.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +12 -0
index de6848b4fd67..cd0ae8a77c37 100644
@@ -585,6 +585,17 @@ static int amdgpu_userq_priority_permit(struct drm_file *filp,
 	return -EACCES;
 }
 
+
+static u32 amdgpu_userq_get_xcp_id(struct amdgpu_fpriv *fpriv)
+{
+	/*
+	 * The enforce-isolation userq path uses idx 0 for non-partitioned
+	 * devices, matching the gfx ring isolation handling.
+	 */
+	return fpriv->xcp_id == AMDGPU_XCP_NO_PARTITION ? 0 :
+						       fpriv->xcp_id;
+}
+
 static int
 amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
 {
@@ -629,6 +640,7 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
 	queue->queue_type = args->in.ip_type;
 	queue->vm = &fpriv->vm;
 	queue->priority = priority;
+	queue->xcp_id = amdgpu_userq_get_xcp_id(fpriv);
 	queue->userq_mgr = uq_mgr;
 	INIT_DELAYED_WORK(&queue->hang_detect_work,
 			  amdgpu_userq_hang_detect_work);
Signature · 1 line
2.34.1