Rather than setting a higher queue priority which could starve a lower priority queue, enable longer quantums for high priority kernel queues. This will avoid starvation, but provide longer runtime for high priority queues.
Signed-off-by: Alex Deucher <[email protected]> --- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c index 130196859ff3f..49999bdb13499 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c @@ -4535,7 +4535,10 @@ static int gfx_v8_0_mqd_init(struct amdgpu_ring *ring) tmp = RREG32(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, 10); + if (amdgpu_gfx_is_high_priority_compute_queue(adev, ring)) + tmp = REG_SET_FIELD(tmp, CP_HQD_QUANTUM, QUANTUM_DURATION, 20); + else + tmp = REG_SET_FIELD(tmp, CP_HQD_QUANTUM, QUANTUM_DURATION, 10); mqd->cp_hqd_quantum = tmp; /* map_queues packet doesn't need activate the queue, -- 2.53.0
