Skip to contentSkip to conversation

drm/amdgpu: Enable SDMA utilization for Arcturus

PATCH Superseded Mukul Joshi 2 participants 2 messages Sep 11, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Enable SDMA utilization for Arcturus

SDMA utilization calculations are enabled/disabled by writing to SDMAx_PUB_DUMMY_REG2 register. Currently, enable this only for Arcturus.

---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +10 -0
index 856c50386c86..c764c27ba86d 100644
@@ -1063,6 +1063,16 @@ static void sdma_v4_0_ctx_switch_enable(struct amdgpu_device *adev, bool enable)
 			WREG32_SDMA(i, mmSDMA0_PHASE2_QUANTUM, phase_quantum);
 		}
 		WREG32_SDMA(i, mmSDMA0_CNTL, f32_cntl);
+
+		/*
+		 * Enable SDMA utilization. Its only supported on
+		 * Arcturus for the moment and firmware version 14
+		 * and above.
+		 */
+		if ((adev->asic_type == CHIP_ARCTURUS) &&
+			(adev->sdma.instance[i].fw_version > 13)) {
+			WREG32_SDMA(i, mmSDMA0_PUB_DUMMY_REG2, enable);
+		}
 	}
 
 }
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw

Am 2020-09-11 um 12:27 p.m. schrieb Mukul Joshi:

Quoted 15 lines

SDMA utilization calculations are enabled/disabled by writing to SDMAx_PUB_DUMMY_REG2 register. Currently, enable this only for Arcturus.

---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +0 -0
index 856c50386c86..c764c27ba86d 100644
@@ -1063,6 +1063,16 @@ static void sdma_v4_0_ctx_switch_enable(struct amdgpu_device *adev, bool enable)
 			WREG32_SDMA(i, mmSDMA0_PHASE2_QUANTUM, phase_quantum);

drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c static void sdma_v4_0_ctx_switch_enable(struct amdgpu_device *adev, bool enable) · line 1073

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +8 -0
 		}
 		WREG32_SDMA(i, mmSDMA0_CNTL, f32_cntl);
+
+		/*
+		 * Enable SDMA utilization. Its only supported on
+		 * Arcturus for the moment and firmware version 14
+		 * and above.
+		 */
+		if ((adev->asic_type == CHIP_ARCTURUS) &&
+			(adev->sdma.instance[i].fw_version > 13)) {

There are some redundant parentheses in the condition. The curly braces are not needed for a single statement inside the "if". Also, write >= 14, that correlates better with the statement in the comment:

	if (adev->asic_type == CHIP_ARCTURUS &&
	    adev->sdma.instance[i].fw_version >= 14)
		WREG32_SDMA(i, mmSDMA0_PUB_DUMMY_REG2, enable);

If this feature is only available on Arcturus, we should make the creation of the sysfs entries conditional as well. You can do that in a follow-up change.

Regards,
  Felix

drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c static void sdma_v4_0_ctx_switch_enable(struct amdgpu_device *adev, bool enable) · line 1078

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +2 -0
+			WREG32_SDMA(i, mmSDMA0_PUB_DUMMY_REG2, enable);
+		}
 	}
 
 }

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx