]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu/gfx9: align mqd settings with KFD
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 18 Feb 2026 19:31:03 +0000 (14:31 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 21 Apr 2026 20:51:39 +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: Jesse Zhang <jesse.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

index 95be105671ece88029e55adff4dae95d21fe20e0..2eb32f92a77c4aa998a2aa2cc2851974c9f4a086 100644 (file)
@@ -3667,7 +3667,11 @@ static int gfx_v9_0_mqd_init(struct amdgpu_ring *ring)
 
        /* set static priority for a queue/ring */
        gfx_v9_0_mqd_set_priority(ring, mqd);
-       mqd->cp_hqd_quantum = RREG32_SOC15(GC, 0, mmCP_HQD_QUANTUM);
+       tmp = RREG32_SOC15(GC, 0, mmCP_HQD_QUANTUM);
+       tmp = REG_SET_FIELD(tmp, 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;
 
        /* map_queues packet doesn't need activate the queue,
         * so only kiq need set this field.