]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amdgpu/gfx12.1: align mqd settings with KFD
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 4 Mar 2026 14:23:31 +0000 (09:23 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 21 Apr 2026 20:51:50 +0000 (16:51 -0400)
Make sure to set the quantum bits in the compute MQD
for better fairness across queues of the same priority.

Reviewed-by: Kent Russell <kent.russell@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c

index 885183eb7e7b2463596801fe7acd4723b5f8d580..948758b51b5cceb1f636ed791e9057f5cfc5139a 100644 (file)
@@ -2252,6 +2252,11 @@ static int gfx_v12_1_compute_mqd_init(struct amdgpu_device *adev, void *m,
        mqd->cp_mqd_stride_size = prop->mqd_stride_size ? prop->mqd_stride_size :
                AMDGPU_MQD_SIZE_ALIGN(adev->mqds[AMDGPU_HW_IP_COMPUTE].mqd_size);
 
+       tmp = REG_SET_FIELD(0, CP_HQD_QUANTUM, QUANTUM_EN, 1);
+       tmp = REG_SET_FIELD(tmp, CP_HQD_QUANTUM, QUANTUM_SCALE, 1);
+       tmp = REG_SET_FIELD(tmp, CP_HQD_QUANTUM, QUANTUM_DURATION, 1);
+       mqd->cp_hqd_quantum = tmp;
+
        mqd->cp_hqd_active = prop->hqd_active;
 
        return 0;