drm/amdgpu: track whether a queue is a kernel queue in amdgpu_mqd_prop
Subsystems (2)
Alex Deucher
maintainerPATCH 1/3 drm/amdgpu: track whether a queue is a kernel queue in amdgpu_mqd_prop
Used to to set the MQD appropriately for each queue type. Kernel queues have have additional privileges.
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 2 ++ 2 files changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
@@ -883,6 +883,7 @@ struct amdgpu_mqd_prop {uint64_t csa_addr;uint64_t fence_address;bool tmz_queue; +bool kernel_queue; };struct amdgpu_mqd {
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +2 -0
@@ -719,6 +719,8 @@ static void amdgpu_ring_to_mqd_prop(struct amdgpu_ring *ring, prop->eop_gpu_addr = ring->eop_gpu_addr; prop->use_doorbell = ring->use_doorbell; prop->doorbell_index = ring->doorbell_index; +/* kernel queues are privileged */ + prop->kernel_queue = true;/* map_queues packet doesn't need activate the queue, * so only kiq need set this field.
Signature · 1 line
2.50.1
Alex Deucher
maintainerPATCH 2/3 drm/amdgpu/gfx11: set MQD as appriopriate for queue types
Set the MQD as appropriate for the kernel vs user queues.
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +6 -2
@@ -4129,6 +4129,8 @@ static int gfx_v11_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,#endif if (prop->tmz_queue) tmp =REG_SET_FIELD (tmp,CP_GFX_HQD_CNTL ,TMZ_MATCH ,1 ); +if (!prop->kernel_queue) + tmp =REG_SET_FIELD (tmp,CP_GFX_HQD_CNTL ,RB_NON_PRIV ,1 ); mqd->cp_gfx_hqd_cntl = tmp;/* set up cp_doorbell_control */
@@ -4281,8 +4283,10 @@ static int gfx_v11_0_compute_mqd_init(struct amdgpu_device *adev, void *m, tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,UNORD_DISPATCH ,1 ); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,TUNNEL_DISPATCH , prop->allow_tunneling); - tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,PRIV_STATE ,1 ); - tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,KMD_QUEUE ,1 ); +if (prop->kernel_queue) { + tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,PRIV_STATE ,1 ); + tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,KMD_QUEUE ,1 ); + }if (prop->tmz_queue) tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,TMZ ,1 ); mqd->cp_hqd_pq_control = tmp;
Signature · 1 line
2.50.1
RE: [PATCH 2/3] drm/amdgpu/gfx11: set MQD as appriopriate for queue types
[AMD Official Use Only - AMD Internal Distribution Only]
Hi Alex,
With this mqd configuration we get many cases of illegal register flooding and reset not working. Should we create the privileged user queue ?
Log:
[drm:gfx_v11_0_priv_reg_irq [amdgpu]] *ERROR* Illegal register access in command stream
[ 180.429970] [drm:gfx_v11_0_priv_reg_irq [amdgpu]] *ERROR* Illegal register access in command stream
Thanks
Jesse
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Thursday, July 17, 2025 6:01 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>
Subject: [PATCH 2/3] drm/amdgpu/gfx11: set MQD as appriopriate for queue types
Set the MQD as appropriate for the kernel vs user queues.
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +6 -2
@@ -4129,6 +4129,8 @@ static int gfx_v11_0_gfx_mqd_init(struct amdgpu_device *adev, void *m, #endifif (prop->tmz_queue) tmp =REG_SET_FIELD (tmp,CP_GFX_HQD_CNTL ,TMZ_MATCH ,1 ); +if (!prop->kernel_queue) + tmp =REG_SET_FIELD (tmp,CP_GFX_HQD_CNTL ,RB_NON_PRIV ,1 ); mqd->cp_gfx_hqd_cntl = tmp;/* set up cp_doorbell_control */
@@ -4281,8 +4283,10 @@ static int gfx_v11_0_compute_mqd_init(struct amdgpu_device *adev, void *m, tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,UNORD_DISPATCH ,1 ); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,TUNNEL_DISPATCH , prop->allow_tunneling); - tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,PRIV_STATE ,1 ); - tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,KMD_QUEUE ,1 ); +if (prop->kernel_queue) { + tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,PRIV_STATE ,1 ); + tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,KMD_QUEUE ,1 ); + }if (prop->tmz_queue) tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,TMZ ,1 ); mqd->cp_hqd_pq_control = tmp;
--
2.50.1
RE: [PATCH 2/3] drm/amdgpu/gfx11: set MQD as appriopriate for queue types
[Public]
Maybe this issue is introduced by the userq mapped to a privileged queue, could you try whether the issue can be seen when only enable the userq?
Regards,
Prike
Quoted 79 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Zhang, Jesse(Jie)
Sent: Tuesday, July 22, 2025 10:38 AM
To: Deucher, Alexander <[email protected]>; amd- [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>
Subject: RE: [PATCH 2/3] drm/amdgpu/gfx11: set MQD as appriopriate for queue types[AMD Official Use Only - AMD Internal Distribution Only]
Hi Alex,
With this mqd configuration we get many cases of illegal register flooding and reset not working.
Should we create the privileged user queue ?Log:
[drm:gfx_v11_0_priv_reg_irq [amdgpu]] *ERROR* Illegal register access in command stream [ 180.429970] [drm:gfx_v11_0_priv_reg_irq [amdgpu]] *ERROR* Illegal register access in command streamThanks
Jesse
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Thursday, July 17, 2025 6:01 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>
Subject: [PATCH 2/3] drm/amdgpu/gfx11: set MQD as appriopriate for queue typesSet the MQD as appropriate for the kernel vs user queues.
Acked-by Christian König <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +3
-0@@ -4129,6 +4129,8 @@ static int gfx_v11_0_gfx_mqd_init(struct amdgpu_device *adev, void *m, #endifif (prop->tmz_queue) tmp =REG_SET_FIELD (tmp,CP_GFX_HQD_CNTL ,TMZ_MATCH ,1 ); +if (!prop->kernel_queue) + tmp =REG_SET_FIELD (tmp,CP_GFX_HQD_CNTL ,RB_NON_PRIV , +1 ); mqd->cp_gfx_hqd_cntl = tmp; /* set up cp_doorbell_control */ @@ -4281,8 +4283,10 @@ static intgfx_v11_0_compute_mqd_init(struct
amdgpu_device*adev, void *m,
tmp = REG_SET_FIELD(tmp,CP_HQD_PQ_CONTROL,UNORD_DISPATCH, 1);
tmp = REG_SET_FIELD(tmp,CP_HQD_PQ_CONTROL,TUNNEL_DISPATCH,prop->allow_tunneling);drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +2
-2- tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,PRIV_STATE ,1 ); - tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,KMD_QUEUE ,1 ); +if (prop->kernel_queue) { + tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, PRIV_STATE,1);
+ tmp = REG_SET_FIELD(tmp,CP_HQD_PQ_CONTROL,KMD_QUEUE,
1);
+ }if (prop->tmz_queue) tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, TMZ, 1); mqd->cp_hqd_pq_control = tmp;--
2.50.1
RE: [PATCH 2/3] drm/amdgpu/gfx11: set MQD as appriopriate for queue types
[Public]
Yes, enabled privileged user queues and the flood disappeared, and the reset worked.
Thanks
Jesse
-----Original Message-----
From: Liang, Prike <[email protected]>
Sent: Tuesday, July 22, 2025 11:11 AM
To: Zhang, Jesse(Jie) <[email protected]>; Deucher, Alexander <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>
Subject: RE: [PATCH 2/3] drm/amdgpu/gfx11: set MQD as appriopriate for queue types
[Public]
Maybe this issue is introduced by the userq mapped to a privileged queue, could you try whether the issue can be seen when only enable the userq?
Regards,
Prike
Quoted 82 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Zhang,
Jesse(Jie)
Sent: Tuesday, July 22, 2025 10:38 AM
To: Deucher, Alexander <[email protected]>; amd- [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>
Subject: RE: [PATCH 2/3] drm/amdgpu/gfx11: set MQD as appriopriate for queue types[AMD Official Use Only - AMD Internal Distribution Only]
Hi Alex,
With this mqd configuration we get many cases of illegal register flooding and reset not working.
Should we create the privileged user queue ?Log:
[drm:gfx_v11_0_priv_reg_irq [amdgpu]] *ERROR* Illegal register access in command stream [ 180.429970] [drm:gfx_v11_0_priv_reg_irq [amdgpu]] *ERROR* Illegal register access in command streamThanks
Jesse
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Thursday, July 17, 2025 6:01 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>
Subject: [PATCH 2/3] drm/amdgpu/gfx11: set MQD as appriopriate for queue typesSet the MQD as appropriate for the kernel vs user queues.
Acked-by Christian König <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +0
-0@@ -4129,6 +4129,8 @@ static int gfx_v11_0_gfx_mqd_init(struct
amdgpu_device*adev, void *m, #endif
if (prop->tmz_queue)
tmp = REG_SET_FIELD(tmp,CP_GFX_HQD_CNTL,TMZ_MATCH,
1);drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +3
-0+if (!prop->kernel_queue) + tmp =REG_SET_FIELD (tmp,CP_GFX_HQD_CNTL ,RB_NON_PRIV , +1 ); mqd->cp_gfx_hqd_cntl = tmp; /* set up cp_doorbell_control */ @@ -4281,8 +4283,10 @@ staticint gfx_v11_0_compute_mqd_init(struct
amdgpu_device*adev, void *m,
tmp = REG_SET_FIELD(tmp,CP_HQD_PQ_CONTROL,UNORD_DISPATCH,
1);
tmp = REG_SET_FIELD(tmp,CP_HQD_PQ_CONTROL,TUNNEL_DISPATCH,
prop->allow_tunneling);drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +3
-2- tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,PRIV_STATE ,1 ); - tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,KMD_QUEUE ,1 ); +if (prop->kernel_queue) { + tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, + PRIV_STATE,1);
+ tmp = REG_SET_FIELD(tmp,CP_HQD_PQ_CONTROL,KMD_QUEUE,
1);
+ }if (prop->tmz_queue) tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, TMZ, 1); mqd->cp_hqd_pq_control = tmp;--
2.50.1
Alex Deucher
maintainerPATCH 3/3 drm/amdgpu/gfx12: set MQD as appriopriate for queue types
In reply to Alex DeucherSet the MQD as appropriate for the kernel vs user queues.
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +6 -2
@@ -3020,6 +3020,8 @@ static int gfx_v12_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,#endif if (prop->tmz_queue) tmp =REG_SET_FIELD (tmp,CP_GFX_HQD_CNTL ,TMZ_MATCH ,1 ); +if (!prop->kernel_queue) + tmp =REG_SET_FIELD (tmp,CP_GFX_HQD_CNTL ,RB_NON_PRIV ,1 ); mqd->cp_gfx_hqd_cntl = tmp;/* set up cp_doorbell_control */
@@ -3169,8 +3171,10 @@ static int gfx_v12_0_compute_mqd_init(struct amdgpu_device *adev, void *m, (order_base_2(AMDGPU_GPU_PAGE_SIZE / 4) - 1)); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,UNORD_DISPATCH ,1 ); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,TUNNEL_DISPATCH ,0 ); - tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,PRIV_STATE ,1 ); - tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,KMD_QUEUE ,1 ); +if (prop->kernel_queue) { + tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,PRIV_STATE ,1 ); + tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,KMD_QUEUE ,1 ); + }if (prop->tmz_queue) tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,TMZ ,1 ); mqd->cp_hqd_pq_control = tmp;
Signature · 1 line
2.50.1
Re: [PATCH 3/3] drm/amdgpu/gfx12: set MQD as appriopriate for queue types
Quoted 4 lines · Alex Deucher
Set the MQD as appropriate for the kernel vs user queues.
Acked-by Christian König <[email protected]>Signed-off-by Alex Deucher <[email protected]>
A couple of nit-picks for patch 1.
Series is -
Thanks,
Lijo
Quoted 30 lines
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +6
-2@@ -3020,6 +3020,8 @@ static int gfx_v12_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,#endif if (prop->tmz_queue) tmp =REG_SET_FIELD (tmp,CP_GFX_HQD_CNTL ,TMZ_MATCH ,1 ); +if (!prop->kernel_queue) + tmp =REG_SET_FIELD (tmp,CP_GFX_HQD_CNTL ,RB_NON_PRIV ,1 ); mqd->cp_gfx_hqd_cntl = tmp;/* set up cp_doorbell_control */ @@ -3169,8 +3171,10 @@ static int gfx_v12_0_compute_mqd_init(struct amdgpu_device *adev, void *m, (order_base_2(AMDGPU_GPU_PAGE_SIZE / 4) - 1)); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,UNORD_DISPATCH ,1 ); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,TUNNEL_DISPATCH ,0 ); - tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,PRIV_STATE ,1 ); - tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,KMD_QUEUE ,1 ); +if (prop->kernel_queue) { + tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,PRIV_STATE ,1 ); + tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,KMD_QUEUE ,1 ); + }if (prop->tmz_queue) tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,TMZ ,1 ); mqd->cp_hqd_pq_control = tmp;
RE: [PATCH 3/3] drm/amdgpu/gfx12: set MQD as appriopriate for queue types
[Public]
What if when the kernel queue and user queue are enabled at the same time, then how to handle the case when userq mapped to a queue that has been enabled privileged bit by kernel queue?
Regards,
Prike
Quoted 64 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Lazar, Lijo
Sent: Friday, July 18, 2025 12:13 PM
To: Deucher, Alexander <[email protected]>; amd- [email protected]
Cc: Koenig, Christian <[email protected]>
Subject: Re: [PATCH 3/3] drm/amdgpu/gfx12: set MQD as appriopriate for queue typesQuoted 4 lines · Alex Deucher
Set the MQD as appropriate for the kernel vs user queues.
Acked-by Christian König <[email protected]>Signed-off-by Alex Deucher <[email protected]>A couple of nit-picks for patch 1.
Series is -
Reviewed-by Lijo Lazar <[email protected]>Thanks,
LijoQuoted 10 lines
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +0
-0@@ -3020,6 +3020,8 @@ static int gfx_v12_0_gfx_mqd_init(structQuoted 3 lines
amdgpu_device*adev, void *m, #endif
if (prop->tmz_queue)
tmp = REG_SET_FIELD(tmp,CP_GFX_HQD_CNTL,TMZ_MATCH,1);
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +2
-0+if (!prop->kernel_queue) + tmp = REG_SET_FIELD(tmp, CP_GFX_HQD_CNTL,
RB_NON_PRIV, 1);drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c static int gfx_v12_0_compute_mqd_init(struct
Quoted 4 lines
mqd->cp_gfx_hqd_cntl = tmp; /* set up cp_doorbell_control */drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +0
-0@@ -3169,8 +3171,10 @@ static int gfx_v12_0_compute_mqd_init(struct
amdgpu_device*adev, void *m,drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c static int gfx_v12_0_compute_mqd_init(struct · line 3172
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +0
-0(order_base_2(AMDGPU_GPU_PAGE_SIZE / 4) - 1)); tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL,
UNORD_DISPATCH, 1);drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c static int gfx_v12_0_compute_mqd_init(struct · line 3173
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +0
-0tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL,
TUNNEL_DISPATCH, 0);drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c static int gfx_v12_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +2
-2- tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,PRIV_STATE ,1 ); - tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,KMD_QUEUE ,1 ); +if (prop->kernel_queue) { + tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL,
PRIV_STATE, 1);drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c static int gfx_v12_0_compute_mqd_init(struct · line 3176
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +1
-0+ tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL,
KMD_QUEUE, 1);Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +1
-0+ }if (prop->tmz_queue) tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,TMZ ,1 ); mqd->cp_hqd_pq_control = tmp;
Re: [PATCH 3/3] drm/amdgpu/gfx12: set MQD as appriopriate for queue types
Quoted 6 lines · Prike
[Public]
What if when the kernel queue and user queue are enabled at the same time, then how to handle the case when userq mapped to a queue that has been enabled privileged bit by kernel queue?
These settings are per queue. kernel queues will be privileged and user queues will not be privileged. The MES will program the values from the MQD into the HQD when it maps the queues.
Alex
Quoted 69 lines
Regards,
PrikeQuoted 64 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Lazar, Lijo
Sent: Friday, July 18, 2025 12:13 PM
To: Deucher, Alexander <[email protected]>; amd- [email protected]
Cc: Koenig, Christian <[email protected]>
Subject: Re: [PATCH 3/3] drm/amdgpu/gfx12: set MQD as appriopriate for queue typesQuoted 4 lines · Alex Deucher
Set the MQD as appropriate for the kernel vs user queues.
Acked-by Christian König <[email protected]>Signed-off-by Alex Deucher <[email protected]>A couple of nit-picks for patch 1.
Series is -
Reviewed-by Lijo Lazar <[email protected]>Thanks,
LijoQuoted 10 lines
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +0
-0@@ -3020,6 +3020,8 @@ static int gfx_v12_0_gfx_mqd_init(structQuoted 3 lines
amdgpu_device*adev, void *m, #endif
if (prop->tmz_queue)
tmp = REG_SET_FIELD(tmp,CP_GFX_HQD_CNTL,TMZ_MATCH,1);
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +2
-0+if (!prop->kernel_queue) + tmp = REG_SET_FIELD(tmp, CP_GFX_HQD_CNTL,
RB_NON_PRIV, 1);drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c static int gfx_v12_0_compute_mqd_init(struct
Quoted 4 lines
mqd->cp_gfx_hqd_cntl = tmp; /* set up cp_doorbell_control */drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +0
-0@@ -3169,8 +3171,10 @@ static int gfx_v12_0_compute_mqd_init(struct
amdgpu_device*adev, void *m,drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c static int gfx_v12_0_compute_mqd_init(struct · line 3172
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +0
-0(order_base_2(AMDGPU_GPU_PAGE_SIZE / 4) - 1)); tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL,
UNORD_DISPATCH, 1);drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c static int gfx_v12_0_compute_mqd_init(struct · line 3173
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +0
-0tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL,
TUNNEL_DISPATCH, 0);drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c static int gfx_v12_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +2
-2- tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,PRIV_STATE ,1 ); - tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,KMD_QUEUE ,1 ); +if (prop->kernel_queue) { + tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL,
PRIV_STATE, 1);drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c static int gfx_v12_0_compute_mqd_init(struct · line 3176
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +1
-0+ tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL,
KMD_QUEUE, 1);Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +1
-0+ }if (prop->tmz_queue) tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,TMZ ,1 ); mqd->cp_hqd_pq_control = tmp;
Quoted 3 lines · Alex Deucher
Used to to set the MQD appropriately for each queue type. Kernel queues have have additional privileges.
<nit> Extra 'have'
Quoted 24 lines
Acked-by Christian König <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 2 ++ 2 files changed, 3 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu.h +1
-0@@ -883,6 +883,7 @@ struct amdgpu_mqd_prop {uint64_t csa_addr;uint64_t fence_address;bool tmz_queue; +bool kernel_queue; };struct amdgpu_mqd {drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c static void amdgpu_ring_to_mqd_prop(struct amdgpu_ring *ring, · line 722
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +1
-0@@ -719,6 +719,8 @@ static void amdgpu_ring_to_mqd_prop(struct amdgpu_ring *ring, prop->eop_gpu_addr = ring->eop_gpu_addr; prop->use_doorbell = ring->use_doorbell; prop->doorbell_index = ring->doorbell_index; +/* kernel queues are privileged */
<nit> This comment is no longer needed here.
Thanks,
Lijo
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +1
-0+ prop->kernel_queue = true;/* map_queues packet doesn't need activate the queue, * so only kiq need set this field.