* [PATCH 02/16] drm/amdgpu/gfx8: align mqd settings with KFD
2026-03-18 14:08 [PATCH 01/16] drm/amdgpu/gfx7: align mqd settings with KFD Alex Deucher
@ 2026-03-18 14:08 ` Alex Deucher
2026-03-18 14:08 ` [PATCH 03/16] drm/amdgpu/gfx9: " Alex Deucher
` (13 subsequent siblings)
14 siblings, 0 replies; 23+ messages in thread
From: Alex Deucher @ 2026-03-18 14:08 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
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_v8_0.c | 6 +++++-
1 file changed, 5 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 a6b4c8f41dc11..130196859ff3f 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -4532,7 +4532,11 @@ static int gfx_v8_0_mqd_init(struct amdgpu_ring *ring)
/* set static priority for a queue/ring */
gfx_v8_0_mqd_set_priority(ring, mqd);
- mqd->cp_hqd_quantum = RREG32(mmCP_HQD_QUANTUM);
+ 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);
+ mqd->cp_hqd_quantum = tmp;
/* map_queues packet doesn't need activate the queue,
* so only kiq need set this field.
--
2.53.0
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 03/16] drm/amdgpu/gfx9: align mqd settings with KFD
2026-03-18 14:08 [PATCH 01/16] drm/amdgpu/gfx7: align mqd settings with KFD Alex Deucher
2026-03-18 14:08 ` [PATCH 02/16] drm/amdgpu/gfx8: " Alex Deucher
@ 2026-03-18 14:08 ` Alex Deucher
2026-03-18 14:08 ` [PATCH 04/16] drm/amdgpu/gfx9.4.3: " Alex Deucher
` (12 subsequent siblings)
14 siblings, 0 replies; 23+ messages in thread
From: Alex Deucher @ 2026-03-18 14:08 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
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 | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 95be105671ece..2eb32f92a77c4 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -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.
--
2.53.0
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 04/16] drm/amdgpu/gfx9.4.3: align mqd settings with KFD
2026-03-18 14:08 [PATCH 01/16] drm/amdgpu/gfx7: align mqd settings with KFD Alex Deucher
2026-03-18 14:08 ` [PATCH 02/16] drm/amdgpu/gfx8: " Alex Deucher
2026-03-18 14:08 ` [PATCH 03/16] drm/amdgpu/gfx9: " Alex Deucher
@ 2026-03-18 14:08 ` Alex Deucher
2026-04-03 14:03 ` Alex Deucher
2026-03-18 14:08 ` [PATCH 05/16] drm/amdgpu/gfx10: " Alex Deucher
` (11 subsequent siblings)
14 siblings, 1 reply; 23+ messages in thread
From: Alex Deucher @ 2026-03-18 14:08 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
Make sure to set the quantum bits in the compute MQD
for better fairness across queues of the same priority.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
index ad4d442e7345e..d0b8fb9317201 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
@@ -1943,7 +1943,11 @@ static int gfx_v9_4_3_xcc_mqd_init(struct amdgpu_ring *ring, int xcc_id)
/* set static priority for a queue/ring */
gfx_v9_4_3_mqd_set_priority(ring, mqd);
- mqd->cp_hqd_quantum = RREG32_SOC15(GC, GET_INST(GC, xcc_id), regCP_HQD_QUANTUM);
+ tmp = RREG32_SOC15(GC, GET_INST(GC, xcc_id), regCP_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.
--
2.53.0
^ permalink raw reply related [flat|nested] 23+ messages in thread* Re: [PATCH 04/16] drm/amdgpu/gfx9.4.3: align mqd settings with KFD
2026-03-18 14:08 ` [PATCH 04/16] drm/amdgpu/gfx9.4.3: " Alex Deucher
@ 2026-04-03 14:03 ` Alex Deucher
2026-04-17 17:54 ` Alex Deucher
0 siblings, 1 reply; 23+ messages in thread
From: Alex Deucher @ 2026-04-03 14:03 UTC (permalink / raw)
To: Alex Deucher; +Cc: amd-gfx
ping?
On Wed, Mar 18, 2026 at 10:34 AM Alex Deucher <alexander.deucher@amd.com> wrote:
>
> Make sure to set the quantum bits in the compute MQD
> for better fairness across queues of the same priority.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> index ad4d442e7345e..d0b8fb9317201 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> @@ -1943,7 +1943,11 @@ static int gfx_v9_4_3_xcc_mqd_init(struct amdgpu_ring *ring, int xcc_id)
>
> /* set static priority for a queue/ring */
> gfx_v9_4_3_mqd_set_priority(ring, mqd);
> - mqd->cp_hqd_quantum = RREG32_SOC15(GC, GET_INST(GC, xcc_id), regCP_HQD_QUANTUM);
> + tmp = RREG32_SOC15(GC, GET_INST(GC, xcc_id), regCP_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.
> --
> 2.53.0
>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 04/16] drm/amdgpu/gfx9.4.3: align mqd settings with KFD
2026-04-03 14:03 ` Alex Deucher
@ 2026-04-17 17:54 ` Alex Deucher
2026-04-17 18:51 ` Russell, Kent
0 siblings, 1 reply; 23+ messages in thread
From: Alex Deucher @ 2026-04-17 17:54 UTC (permalink / raw)
To: Alex Deucher; +Cc: amd-gfx
Ping?
On Fri, Apr 3, 2026 at 10:03 AM Alex Deucher <alexdeucher@gmail.com> wrote:
>
> ping?
>
> On Wed, Mar 18, 2026 at 10:34 AM Alex Deucher <alexander.deucher@amd.com> wrote:
> >
> > Make sure to set the quantum bits in the compute MQD
> > for better fairness across queues of the same priority.
> >
> > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> > ---
> > drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> > index ad4d442e7345e..d0b8fb9317201 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> > @@ -1943,7 +1943,11 @@ static int gfx_v9_4_3_xcc_mqd_init(struct amdgpu_ring *ring, int xcc_id)
> >
> > /* set static priority for a queue/ring */
> > gfx_v9_4_3_mqd_set_priority(ring, mqd);
> > - mqd->cp_hqd_quantum = RREG32_SOC15(GC, GET_INST(GC, xcc_id), regCP_HQD_QUANTUM);
> > + tmp = RREG32_SOC15(GC, GET_INST(GC, xcc_id), regCP_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.
> > --
> > 2.53.0
> >
^ permalink raw reply [flat|nested] 23+ messages in thread
* RE: [PATCH 04/16] drm/amdgpu/gfx9.4.3: align mqd settings with KFD
2026-04-17 17:54 ` Alex Deucher
@ 2026-04-17 18:51 ` Russell, Kent
0 siblings, 0 replies; 23+ messages in thread
From: Russell, Kent @ 2026-04-17 18:51 UTC (permalink / raw)
To: Alex Deucher, Deucher, Alexander; +Cc: amd-gfx@lists.freedesktop.org
[Public]
Reviewed-by: Kent Russell <kent.russell@amd.com>
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Alex
> Deucher
> Sent: Friday, April 17, 2026 1:55 PM
> To: Deucher, Alexander <Alexander.Deucher@amd.com>
> Cc: amd-gfx@lists.freedesktop.org
> Subject: Re: [PATCH 04/16] drm/amdgpu/gfx9.4.3: align mqd settings with KFD
>
> Ping?
>
> On Fri, Apr 3, 2026 at 10:03 AM Alex Deucher <alexdeucher@gmail.com> wrote:
> >
> > ping?
> >
> > On Wed, Mar 18, 2026 at 10:34 AM Alex Deucher <alexander.deucher@amd.com>
> wrote:
> > >
> > > Make sure to set the quantum bits in the compute MQD
> > > for better fairness across queues of the same priority.
> > >
> > > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> > > ---
> > > drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 6 +++++-
> > > 1 file changed, 5 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> > > index ad4d442e7345e..d0b8fb9317201 100644
> > > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> > > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> > > @@ -1943,7 +1943,11 @@ static int gfx_v9_4_3_xcc_mqd_init(struct
> amdgpu_ring *ring, int xcc_id)
> > >
> > > /* set static priority for a queue/ring */
> > > gfx_v9_4_3_mqd_set_priority(ring, mqd);
> > > - mqd->cp_hqd_quantum = RREG32_SOC15(GC, GET_INST(GC, xcc_id),
> regCP_HQD_QUANTUM);
> > > + tmp = RREG32_SOC15(GC, GET_INST(GC, xcc_id),
> regCP_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.
> > > --
> > > 2.53.0
> > >
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 05/16] drm/amdgpu/gfx10: align mqd settings with KFD
2026-03-18 14:08 [PATCH 01/16] drm/amdgpu/gfx7: align mqd settings with KFD Alex Deucher
` (2 preceding siblings ...)
2026-03-18 14:08 ` [PATCH 04/16] drm/amdgpu/gfx9.4.3: " Alex Deucher
@ 2026-03-18 14:08 ` Alex Deucher
2026-03-18 14:08 ` [PATCH 06/16] drm/amdgpu/gfx11: " Alex Deucher
` (10 subsequent siblings)
14 siblings, 0 replies; 23+ messages in thread
From: Alex Deucher @ 2026-03-18 14:08 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
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_v10_0.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index 8b60299b73ef7..58c69dcb527f7 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -7011,6 +7011,11 @@ static int gfx_v10_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
tmp = REG_SET_FIELD(tmp, CP_HQD_IB_CONTROL, MIN_IB_AVAIL_SIZE, 3);
mqd->cp_hqd_ib_control = tmp;
+ 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;
+
/* set static priority for a compute queue/ring */
mqd->cp_hqd_pipe_priority = prop->hqd_pipe_priority;
mqd->cp_hqd_queue_priority = prop->hqd_queue_priority;
--
2.53.0
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 06/16] drm/amdgpu/gfx11: align mqd settings with KFD
2026-03-18 14:08 [PATCH 01/16] drm/amdgpu/gfx7: align mqd settings with KFD Alex Deucher
` (3 preceding siblings ...)
2026-03-18 14:08 ` [PATCH 05/16] drm/amdgpu/gfx10: " Alex Deucher
@ 2026-03-18 14:08 ` Alex Deucher
2026-03-18 14:08 ` [PATCH 07/16] drm/amdgpu/gfx12: " Alex Deucher
` (9 subsequent siblings)
14 siblings, 0 replies; 23+ messages in thread
From: Alex Deucher @ 2026-03-18 14:08 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
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_v11_0.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
index 78d1f3eb522ed..121290f8b4930 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
@@ -4398,6 +4398,11 @@ static int gfx_v11_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
mqd->cp_hqd_pipe_priority = prop->hqd_pipe_priority;
mqd->cp_hqd_queue_priority = prop->hqd_queue_priority;
+ 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;
/* set UQ fenceaddress */
--
2.53.0
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 07/16] drm/amdgpu/gfx12: align mqd settings with KFD
2026-03-18 14:08 [PATCH 01/16] drm/amdgpu/gfx7: align mqd settings with KFD Alex Deucher
` (4 preceding siblings ...)
2026-03-18 14:08 ` [PATCH 06/16] drm/amdgpu/gfx11: " Alex Deucher
@ 2026-03-18 14:08 ` Alex Deucher
2026-03-18 14:08 ` [PATCH 08/16] drm/amdgpu/gfx12.1: " Alex Deucher
` (8 subsequent siblings)
14 siblings, 0 replies; 23+ messages in thread
From: Alex Deucher @ 2026-03-18 14:08 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
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_v12_0.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
index a418ae609c363..cd7b1ab2233f1 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
@@ -3268,6 +3268,11 @@ static int gfx_v12_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
mqd->cp_hqd_pipe_priority = prop->hqd_pipe_priority;
mqd->cp_hqd_queue_priority = prop->hqd_queue_priority;
+ 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;
/* set UQ fenceaddress */
--
2.53.0
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 08/16] drm/amdgpu/gfx12.1: align mqd settings with KFD
2026-03-18 14:08 [PATCH 01/16] drm/amdgpu/gfx7: align mqd settings with KFD Alex Deucher
` (5 preceding siblings ...)
2026-03-18 14:08 ` [PATCH 07/16] drm/amdgpu/gfx12: " Alex Deucher
@ 2026-03-18 14:08 ` Alex Deucher
2026-04-03 14:03 ` Alex Deucher
2026-03-18 14:08 ` [PATCH 09/16] drm/amdgpu/gfx8: rework kernel queue priority handling Alex Deucher
` (7 subsequent siblings)
14 siblings, 1 reply; 23+ messages in thread
From: Alex Deucher @ 2026-03-18 14:08 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
Make sure to set the quantum bits in the compute MQD
for better fairness across queues of the same priority.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
index db49582a211f7..98dc6582b7aa6 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
@@ -2246,6 +2246,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;
--
2.53.0
^ permalink raw reply related [flat|nested] 23+ messages in thread* Re: [PATCH 08/16] drm/amdgpu/gfx12.1: align mqd settings with KFD
2026-03-18 14:08 ` [PATCH 08/16] drm/amdgpu/gfx12.1: " Alex Deucher
@ 2026-04-03 14:03 ` Alex Deucher
2026-04-17 17:54 ` Alex Deucher
0 siblings, 1 reply; 23+ messages in thread
From: Alex Deucher @ 2026-04-03 14:03 UTC (permalink / raw)
To: Alex Deucher; +Cc: amd-gfx
Ping?
On Wed, Mar 18, 2026 at 10:19 AM Alex Deucher <alexander.deucher@amd.com> wrote:
>
> Make sure to set the quantum bits in the compute MQD
> for better fairness across queues of the same priority.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
> index db49582a211f7..98dc6582b7aa6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
> @@ -2246,6 +2246,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;
> --
> 2.53.0
>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 08/16] drm/amdgpu/gfx12.1: align mqd settings with KFD
2026-04-03 14:03 ` Alex Deucher
@ 2026-04-17 17:54 ` Alex Deucher
2026-04-17 18:51 ` Russell, Kent
2026-04-17 21:59 ` Joshi, Mukul
0 siblings, 2 replies; 23+ messages in thread
From: Alex Deucher @ 2026-04-17 17:54 UTC (permalink / raw)
To: Alex Deucher; +Cc: amd-gfx
ping?
On Fri, Apr 3, 2026 at 10:03 AM Alex Deucher <alexdeucher@gmail.com> wrote:
>
> Ping?
>
> On Wed, Mar 18, 2026 at 10:19 AM Alex Deucher <alexander.deucher@amd.com> wrote:
> >
> > Make sure to set the quantum bits in the compute MQD
> > for better fairness across queues of the same priority.
> >
> > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> > ---
> > drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
> > index db49582a211f7..98dc6582b7aa6 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
> > @@ -2246,6 +2246,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;
> > --
> > 2.53.0
> >
^ permalink raw reply [flat|nested] 23+ messages in thread
* RE: [PATCH 08/16] drm/amdgpu/gfx12.1: align mqd settings with KFD
2026-04-17 17:54 ` Alex Deucher
@ 2026-04-17 18:51 ` Russell, Kent
2026-04-17 21:59 ` Joshi, Mukul
1 sibling, 0 replies; 23+ messages in thread
From: Russell, Kent @ 2026-04-17 18:51 UTC (permalink / raw)
To: Alex Deucher, Deucher, Alexander; +Cc: amd-gfx@lists.freedesktop.org
[AMD Official Use Only - AMD Internal Distribution Only]
Reviewed-by: Kent Russell <kent.russell@amd.com>
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Alex
> Deucher
> Sent: Friday, April 17, 2026 1:55 PM
> To: Deucher, Alexander <Alexander.Deucher@amd.com>
> Cc: amd-gfx@lists.freedesktop.org
> Subject: Re: [PATCH 08/16] drm/amdgpu/gfx12.1: align mqd settings with KFD
>
> ping?
>
> On Fri, Apr 3, 2026 at 10:03 AM Alex Deucher <alexdeucher@gmail.com> wrote:
> >
> > Ping?
> >
> > On Wed, Mar 18, 2026 at 10:19 AM Alex Deucher <alexander.deucher@amd.com>
> wrote:
> > >
> > > Make sure to set the quantum bits in the compute MQD
> > > for better fairness across queues of the same priority.
> > >
> > > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> > > ---
> > > drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 5 +++++
> > > 1 file changed, 5 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
> b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
> > > index db49582a211f7..98dc6582b7aa6 100644
> > > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
> > > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
> > > @@ -2246,6 +2246,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;
> > > --
> > > 2.53.0
> > >
^ permalink raw reply [flat|nested] 23+ messages in thread
* RE: [PATCH 08/16] drm/amdgpu/gfx12.1: align mqd settings with KFD
2026-04-17 17:54 ` Alex Deucher
2026-04-17 18:51 ` Russell, Kent
@ 2026-04-17 21:59 ` Joshi, Mukul
1 sibling, 0 replies; 23+ messages in thread
From: Joshi, Mukul @ 2026-04-17 21:59 UTC (permalink / raw)
To: Alex Deucher, Deucher, Alexander; +Cc: amd-gfx@lists.freedesktop.org
[AMD Official Use Only - AMD Internal Distribution Only]
Reviewed-by: Mukul Joshi <mukul.joshi@amd.com>
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Alex
> Deucher
> Sent: Friday, April 17, 2026 1:55 PM
> To: Deucher, Alexander <Alexander.Deucher@amd.com>
> Cc: amd-gfx@lists.freedesktop.org
> Subject: Re: [PATCH 08/16] drm/amdgpu/gfx12.1: align mqd settings with
> KFD
>
> ping?
>
> On Fri, Apr 3, 2026 at 10:03 AM Alex Deucher <alexdeucher@gmail.com>
> wrote:
> >
> > Ping?
> >
> > On Wed, Mar 18, 2026 at 10:19 AM Alex Deucher
> <alexander.deucher@amd.com> wrote:
> > >
> > > Make sure to set the quantum bits in the compute MQD for better
> > > fairness across queues of the same priority.
> > >
> > > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> > > ---
> > > drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 5 +++++
> > > 1 file changed, 5 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
> > > b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
> > > index db49582a211f7..98dc6582b7aa6 100644
> > > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
> > > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
> > > @@ -2246,6 +2246,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;
> > > --
> > > 2.53.0
> > >
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 09/16] drm/amdgpu/gfx8: rework kernel queue priority handling
2026-03-18 14:08 [PATCH 01/16] drm/amdgpu/gfx7: align mqd settings with KFD Alex Deucher
` (6 preceding siblings ...)
2026-03-18 14:08 ` [PATCH 08/16] drm/amdgpu/gfx12.1: " Alex Deucher
@ 2026-03-18 14:08 ` Alex Deucher
2026-03-18 14:08 ` [PATCH 10/16] drm/amdgpu/gfx9: " Alex Deucher
` (6 subsequent siblings)
14 siblings, 0 replies; 23+ messages in thread
From: Alex Deucher @ 2026-03-18 14:08 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
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 <alexander.deucher@amd.com>
---
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
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 10/16] drm/amdgpu/gfx9: rework kernel queue priority handling
2026-03-18 14:08 [PATCH 01/16] drm/amdgpu/gfx7: align mqd settings with KFD Alex Deucher
` (7 preceding siblings ...)
2026-03-18 14:08 ` [PATCH 09/16] drm/amdgpu/gfx8: rework kernel queue priority handling Alex Deucher
@ 2026-03-18 14:08 ` Alex Deucher
2026-03-18 14:08 ` [PATCH 11/16] drm/amdgpu/gfx9.4.3: " Alex Deucher
` (5 subsequent siblings)
14 siblings, 0 replies; 23+ messages in thread
From: Alex Deucher @ 2026-03-18 14:08 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
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 <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 2eb32f92a77c4..aaf75c82b1bf5 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -3670,7 +3670,10 @@ static int gfx_v9_0_mqd_init(struct amdgpu_ring *ring)
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);
+ if (amdgpu_gfx_is_high_priority_compute_queue(adev, ring))
+ tmp = REG_SET_FIELD(tmp, CP_HQD_QUANTUM, QUANTUM_DURATION, 2);
+ else
+ 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,
--
2.53.0
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 11/16] drm/amdgpu/gfx9.4.3: rework kernel queue priority handling
2026-03-18 14:08 [PATCH 01/16] drm/amdgpu/gfx7: align mqd settings with KFD Alex Deucher
` (8 preceding siblings ...)
2026-03-18 14:08 ` [PATCH 10/16] drm/amdgpu/gfx9: " Alex Deucher
@ 2026-03-18 14:08 ` Alex Deucher
2026-03-18 14:08 ` [PATCH 12/16] drm/amdgpu/gfx10: " Alex Deucher
` (4 subsequent siblings)
14 siblings, 0 replies; 23+ messages in thread
From: Alex Deucher @ 2026-03-18 14:08 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
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 <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
index d0b8fb9317201..e843793112638 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
@@ -1946,7 +1946,10 @@ static int gfx_v9_4_3_xcc_mqd_init(struct amdgpu_ring *ring, int xcc_id)
tmp = RREG32_SOC15(GC, GET_INST(GC, xcc_id), regCP_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);
+ if (amdgpu_gfx_is_high_priority_compute_queue(adev, ring))
+ tmp = REG_SET_FIELD(tmp, CP_HQD_QUANTUM, QUANTUM_DURATION, 2);
+ else
+ 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,
--
2.53.0
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 12/16] drm/amdgpu/gfx10: rework kernel queue priority handling
2026-03-18 14:08 [PATCH 01/16] drm/amdgpu/gfx7: align mqd settings with KFD Alex Deucher
` (9 preceding siblings ...)
2026-03-18 14:08 ` [PATCH 11/16] drm/amdgpu/gfx9.4.3: " Alex Deucher
@ 2026-03-18 14:08 ` Alex Deucher
2026-03-18 14:08 ` [PATCH 13/16] drm/amdgpu/gfx11: " Alex Deucher
` (3 subsequent siblings)
14 siblings, 0 replies; 23+ messages in thread
From: Alex Deucher @ 2026-03-18 14:08 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
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 <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index 58c69dcb527f7..3618e68222458 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -6794,6 +6794,12 @@ static int gfx_v10_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
/* set up time quantum */
tmp = RREG32_SOC15(GC, 0, mmCP_GFX_HQD_QUANTUM);
tmp = REG_SET_FIELD(tmp, CP_GFX_HQD_QUANTUM, QUANTUM_EN, 1);
+ /* increase the duration of a high priority kernel queue */
+ if (prop->kernel_queue &&
+ (prop->hqd_pipe_priority == AMDGPU_GFX_PIPE_PRIO_HIGH))
+ tmp = REG_SET_FIELD(tmp, CP_GFX_HQD_QUANTUM, QUANTUM_DURATION, 20);
+ else
+ tmp = REG_SET_FIELD(tmp, CP_GFX_HQD_QUANTUM, QUANTUM_DURATION, 10);
mqd->cp_gfx_hqd_quantum = tmp;
/* set up gfx hqd base. this is similar as CP_RB_BASE */
@@ -7013,7 +7019,12 @@ static int gfx_v10_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
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);
+ /* increase the duration of a high priority kernel queue */
+ if (prop->kernel_queue &&
+ (prop->hqd_pipe_priority == AMDGPU_GFX_PIPE_PRIO_HIGH))
+ tmp = REG_SET_FIELD(tmp, CP_HQD_QUANTUM, QUANTUM_DURATION, 2);
+ else
+ tmp = REG_SET_FIELD(tmp, CP_HQD_QUANTUM, QUANTUM_DURATION, 1);
mqd->cp_hqd_quantum = tmp;
/* set static priority for a compute queue/ring */
--
2.53.0
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 13/16] drm/amdgpu/gfx11: rework kernel queue priority handling
2026-03-18 14:08 [PATCH 01/16] drm/amdgpu/gfx7: align mqd settings with KFD Alex Deucher
` (10 preceding siblings ...)
2026-03-18 14:08 ` [PATCH 12/16] drm/amdgpu/gfx10: " Alex Deucher
@ 2026-03-18 14:08 ` Alex Deucher
2026-03-18 14:08 ` [PATCH 14/16] drm/amdgpu/gfx12: " Alex Deucher
` (2 subsequent siblings)
14 siblings, 0 replies; 23+ messages in thread
From: Alex Deucher @ 2026-03-18 14:08 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
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 <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
index 121290f8b4930..6426270e9eb55 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
@@ -4130,6 +4130,12 @@ static int gfx_v11_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
/* set up time quantum */
tmp = regCP_GFX_HQD_QUANTUM_DEFAULT;
tmp = REG_SET_FIELD(tmp, CP_GFX_HQD_QUANTUM, QUANTUM_EN, 1);
+ /* increase the duration of a high priority kernel queue */
+ if (prop->kernel_queue &&
+ (prop->hqd_pipe_priority == AMDGPU_GFX_PIPE_PRIO_HIGH))
+ tmp = REG_SET_FIELD(tmp, CP_GFX_HQD_QUANTUM, QUANTUM_DURATION, 20);
+ else
+ tmp = REG_SET_FIELD(tmp, CP_GFX_HQD_QUANTUM, QUANTUM_DURATION, 10);
mqd->cp_gfx_hqd_quantum = tmp;
/* set up gfx hqd base. this is similar as CP_RB_BASE */
@@ -4400,7 +4406,12 @@ static int gfx_v11_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
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);
+ /* increase the duration of a high priority kernel queue */
+ if (prop->kernel_queue &&
+ (prop->hqd_pipe_priority == AMDGPU_GFX_PIPE_PRIO_HIGH))
+ tmp = REG_SET_FIELD(tmp, CP_HQD_QUANTUM, QUANTUM_DURATION, 2);
+ else
+ tmp = REG_SET_FIELD(tmp, CP_HQD_QUANTUM, QUANTUM_DURATION, 1);
mqd->cp_hqd_quantum = tmp;
mqd->cp_hqd_active = prop->hqd_active;
--
2.53.0
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 14/16] drm/amdgpu/gfx12: rework kernel queue priority handling
2026-03-18 14:08 [PATCH 01/16] drm/amdgpu/gfx7: align mqd settings with KFD Alex Deucher
` (11 preceding siblings ...)
2026-03-18 14:08 ` [PATCH 13/16] drm/amdgpu/gfx11: " Alex Deucher
@ 2026-03-18 14:08 ` Alex Deucher
2026-03-18 14:08 ` [PATCH 15/16] drm/amdgpu/gfx12.1: " Alex Deucher
2026-03-18 14:08 ` [PATCH 16/16] drm/amdgpu: don't set queue priorities for kernel queues Alex Deucher
14 siblings, 0 replies; 23+ messages in thread
From: Alex Deucher @ 2026-03-18 14:08 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
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 <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
index cd7b1ab2233f1..66d058a40cc32 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
@@ -3003,6 +3003,12 @@ static int gfx_v12_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
/* set up time quantum */
tmp = regCP_GFX_HQD_QUANTUM_DEFAULT;
tmp = REG_SET_FIELD(tmp, CP_GFX_HQD_QUANTUM, QUANTUM_EN, 1);
+ /* increase the duration of a high priority kernel queue */
+ if (prop->kernel_queue &&
+ (prop->hqd_pipe_priority == AMDGPU_GFX_PIPE_PRIO_HIGH))
+ tmp = REG_SET_FIELD(tmp, CP_GFX_HQD_QUANTUM, QUANTUM_DURATION, 20);
+ else
+ tmp = REG_SET_FIELD(tmp, CP_GFX_HQD_QUANTUM, QUANTUM_DURATION, 10);
mqd->cp_gfx_hqd_quantum = tmp;
/* set up gfx hqd base. this is similar as CP_RB_BASE */
@@ -3270,7 +3276,12 @@ static int gfx_v12_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
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);
+ /* increase the duration of a high priority kernel queue */
+ if (prop->kernel_queue &&
+ (prop->hqd_pipe_priority == AMDGPU_GFX_PIPE_PRIO_HIGH))
+ tmp = REG_SET_FIELD(tmp, CP_HQD_QUANTUM, QUANTUM_DURATION, 2);
+ else
+ tmp = REG_SET_FIELD(tmp, CP_HQD_QUANTUM, QUANTUM_DURATION, 1);
mqd->cp_hqd_quantum = tmp;
mqd->cp_hqd_active = prop->hqd_active;
--
2.53.0
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 15/16] drm/amdgpu/gfx12.1: rework kernel queue priority handling
2026-03-18 14:08 [PATCH 01/16] drm/amdgpu/gfx7: align mqd settings with KFD Alex Deucher
` (12 preceding siblings ...)
2026-03-18 14:08 ` [PATCH 14/16] drm/amdgpu/gfx12: " Alex Deucher
@ 2026-03-18 14:08 ` Alex Deucher
2026-03-18 14:08 ` [PATCH 16/16] drm/amdgpu: don't set queue priorities for kernel queues Alex Deucher
14 siblings, 0 replies; 23+ messages in thread
From: Alex Deucher @ 2026-03-18 14:08 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
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 <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
index 98dc6582b7aa6..2fac3f99da644 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
@@ -2248,7 +2248,12 @@ static int gfx_v12_1_compute_mqd_init(struct amdgpu_device *adev, void *m,
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);
+ /* increase the duration of a high priority kernel queue */
+ if (prop->kernel_queue &&
+ (prop->hqd_pipe_priority == AMDGPU_GFX_PIPE_PRIO_HIGH))
+ tmp = REG_SET_FIELD(tmp, CP_HQD_QUANTUM, QUANTUM_DURATION, 2);
+ else
+ tmp = REG_SET_FIELD(tmp, CP_HQD_QUANTUM, QUANTUM_DURATION, 1);
mqd->cp_hqd_quantum = tmp;
mqd->cp_hqd_active = prop->hqd_active;
--
2.53.0
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 16/16] drm/amdgpu: don't set queue priorities for kernel queues
2026-03-18 14:08 [PATCH 01/16] drm/amdgpu/gfx7: align mqd settings with KFD Alex Deucher
` (13 preceding siblings ...)
2026-03-18 14:08 ` [PATCH 15/16] drm/amdgpu/gfx12.1: " Alex Deucher
@ 2026-03-18 14:08 ` Alex Deucher
14 siblings, 0 replies; 23+ messages in thread
From: Alex Deucher @ 2026-03-18 14:08 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
Align with KFD and don't set queue priorities for kernel
queues. This can result in starvation of lower priority
queues.
v2: fix GC 8 and 9
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 4 +---
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 --
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 --
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 2 --
4 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
index 83750ab4e81b5..ccfbb6fc5f440 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
@@ -780,10 +780,8 @@ static void amdgpu_ring_to_mqd_prop(struct amdgpu_ring *ring,
prop->hqd_active = ring->funcs->type == AMDGPU_RING_TYPE_KIQ;
prop->allow_tunneling = is_high_prio_compute;
- if (is_high_prio_compute || is_high_prio_gfx) {
+ if (is_high_prio_compute || is_high_prio_gfx)
prop->hqd_pipe_priority = AMDGPU_GFX_PIPE_PRIO_HIGH;
- prop->hqd_queue_priority = AMDGPU_GFX_QUEUE_PRIORITY_MAXIMUM;
- }
}
int amdgpu_ring_init_mqd(struct amdgpu_ring *ring)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index 49999bdb13499..b29dde9297b20 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -4390,8 +4390,6 @@ static void gfx_v8_0_mqd_set_priority(struct amdgpu_ring *ring, struct vi_mqd *m
if (ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE) {
if (amdgpu_gfx_is_high_priority_compute_queue(adev, ring)) {
mqd->cp_hqd_pipe_priority = AMDGPU_GFX_PIPE_PRIO_HIGH;
- mqd->cp_hqd_queue_priority =
- AMDGPU_GFX_QUEUE_PRIORITY_MAXIMUM;
}
}
}
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index aaf75c82b1bf5..150040625c440 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -3540,8 +3540,6 @@ static void gfx_v9_0_mqd_set_priority(struct amdgpu_ring *ring, struct v9_mqd *m
if (ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE) {
if (amdgpu_gfx_is_high_priority_compute_queue(adev, ring)) {
mqd->cp_hqd_pipe_priority = AMDGPU_GFX_PIPE_PRIO_HIGH;
- mqd->cp_hqd_queue_priority =
- AMDGPU_GFX_QUEUE_PRIORITY_MAXIMUM;
}
}
}
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
index e843793112638..cec64a8f21ebd 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
@@ -1817,8 +1817,6 @@ static void gfx_v9_4_3_mqd_set_priority(struct amdgpu_ring *ring, struct v9_mqd
if (ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE) {
if (amdgpu_gfx_is_high_priority_compute_queue(adev, ring)) {
mqd->cp_hqd_pipe_priority = AMDGPU_GFX_PIPE_PRIO_HIGH;
- mqd->cp_hqd_queue_priority =
- AMDGPU_GFX_QUEUE_PRIORITY_MAXIMUM;
}
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 23+ messages in thread