Skip to contentSkip to conversation

drm/amdgpu: Add chain runlists support to GC9.4.2

PATCH In review Amber Lin 2 participants 2 messages Jun 5, 2025 – Jun 6, 2025

Subsystems (2)
lore
Share & tools
lore

Amber Lin

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Add chain runlists support to GC9.4.2

Starting from MEC v97, GC 9.4.2 supports chain runlists of XNACK+/XNACK- processes.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c   |  3 +++
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.c | 12 ++++++++++++
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.h |  1 +
 3 files changed, 16 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3 -0
index d377a7c57d5e..dedfc6c7f2cb 100644
@@ -2629,6 +2629,9 @@ static void gfx_v9_0_init_sq_config(struct amdgpu_device *adev)
 				!READ_ONCE(adev->barrier_has_auto_waitcnt));
 		WREG32_SOC15(GC, 0, mmSQ_CONFIG, tmp);
 		break;
+	case IP_VERSION(9, 4, 2):
+		gfx_v9_4_2_init_sq(adev);
+		break;
 	default:
 		break;
 	}
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.c +12 -0
index c48cd47b531f..6f40f3202f22 100644
@@ -748,6 +748,18 @@ void gfx_v9_4_2_init_golden_registers(struct amdgpu_device *adev,
 	}
 }
 
+void gfx_v9_4_2_init_sq(struct amdgpu_device *adev)
+{
+	uint32_t data;
+
+	if (adev->gfx.mec_fw_version >= 97) {
+		adev->gmc.xnack_flags |= AMDGPU_GMC_XNACK_FLAG_CHAIN;
+		data = RREG32_SOC15(GC, 0, regSQ_CONFIG1);
+		data = REG_SET_FIELD(data, SQ_CONFIG1, DISABLE_XNACK_CHECK_IN_RETRY_DISABLE, 1);
+		WREG32_SOC15(GC, 0, regSQ_CONFIG1, data);
+	}
+}
+
 void gfx_v9_4_2_debug_trap_config_init(struct amdgpu_device *adev,
 				uint32_t first_vmid,
 				uint32_t last_vmid)
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.h +1 -0
index 7584624b641c..a603724c1dfc 100644
@@ -28,6 +28,7 @@ void gfx_v9_4_2_debug_trap_config_init(struct amdgpu_device *adev,
 				uint32_t first_vmid, uint32_t last_vmid);
 void gfx_v9_4_2_init_golden_registers(struct amdgpu_device *adev,
 				      uint32_t die_id);
+void gfx_v9_4_2_init_sq(struct amdgpu_device *adev);
 void gfx_v9_4_2_set_power_brake_sequence(struct amdgpu_device *adev);
 int gfx_v9_4_2_do_edc_gpr_workarounds(struct amdgpu_device *adev);
 
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Amber Lin

Starting from MEC v97, GC 9.4.2 supports chain runlists of XNACK+/XNACK- processes.

Quoted 55 lines
---
  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c   |  3 +++
  drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.c | 12 ++++++++++++
  drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.h |  1 +
  3 files changed, 16 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3 -0
index d377a7c57d5e..dedfc6c7f2cb 100644
@@ -2629,6 +2629,9 @@ static void gfx_v9_0_init_sq_config(struct amdgpu_device *adev)
  				!READ_ONCE(adev->barrier_has_auto_waitcnt));
  		WREG32_SOC15(GC, 0, mmSQ_CONFIG, tmp);
  		break;
+	case IP_VERSION(9, 4, 2):
+		gfx_v9_4_2_init_sq(adev);
+		break;
  	default:
  		break;
  	}
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.c +12 -0
index c48cd47b531f..6f40f3202f22 100644
@@ -748,6 +748,18 @@ void gfx_v9_4_2_init_golden_registers(struct amdgpu_device *adev,
  	}
  }
 
+void gfx_v9_4_2_init_sq(struct amdgpu_device *adev)
+{
+	uint32_t data;
+
+	if (adev->gfx.mec_fw_version >= 97) {
+		adev->gmc.xnack_flags |= AMDGPU_GMC_XNACK_FLAG_CHAIN;
+		data = RREG32_SOC15(GC, 0, regSQ_CONFIG1);
+		data = REG_SET_FIELD(data, SQ_CONFIG1, DISABLE_XNACK_CHECK_IN_RETRY_DISABLE, 1);
+		WREG32_SOC15(GC, 0, regSQ_CONFIG1, data);
+	}
+}
+
  void gfx_v9_4_2_debug_trap_config_init(struct amdgpu_device *adev,
  				uint32_t first_vmid,
  				uint32_t last_vmid)
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.h +1 -0
index 7584624b641c..a603724c1dfc 100644
@@ -28,6 +28,7 @@ void gfx_v9_4_2_debug_trap_config_init(struct amdgpu_device *adev,
  				uint32_t first_vmid, uint32_t last_vmid);
  void gfx_v9_4_2_init_golden_registers(struct amdgpu_device *adev,
  				      uint32_t die_id);
+void gfx_v9_4_2_init_sq(struct amdgpu_device *adev);
  void gfx_v9_4_2_set_power_brake_sequence(struct amdgpu_device *adev);
  int gfx_v9_4_2_do_edc_gpr_workarounds(struct amdgpu_device *adev);