drm/amdgpu: fix MES HQD masks
Subsystems (2)
PATCH 1/1 drm/amdgpu: fix MES HQD masks
This patch fixes the existing HQD masks prepared during the MES initialization. These existing masks values were causing problems when we try to enable GFX oversubscription.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 3 --- drivers/gpu/drm/amd/amdgpu/mes_v10_1.c | 15 ++++++++++++++- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 15 ++++++++++++++- 3 files changed, 28 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +0 -3
@@ -148,9 +148,6 @@ int amdgpu_mes_init(struct amdgpu_device *adev) adev->mes.compute_hqd_mask[i] =0xc ; } -for (i =0 ; i <AMDGPU_MES_MAX_GFX_PIPES ; i++) - adev->mes.gfx_hqd_mask[i] = i ?0 :0xfffffffe ; -for (i =0 ; i <AMDGPU_MES_MAX_SDMA_PIPES ; i++) {if (amdgpu_ip_version (adev,SDMA0_HWIP ,0 ) <IP_VERSION (6 ,0 ,0 ))
drivers/gpu/drm/amd/amdgpu/mes_v10_1.c +14 -1
@@ -266,6 +266,19 @@ static int mes_v10_1_query_sched_status(struct amdgpu_mes *mes) offsetof(union MESAPI__QUERY_MES_STATUS, api_status)); } +static inline uint32_t mes_v10_get_gfx_hqd_mask (int pipe_index) +{ +/* Pipe 1 can't be used for MES due to HW limitation */ +if (pipe_index ==1 ) +return 0 ; + +/* +* GFX V10 supports 2 queues, but we want to keep queue 0 +* reserved for kernel, so enable only queue 1 (1<<1) for MES. +*/ +return 0x2 ; +} +static int mes_v10_1_set_hw_resources (struct amdgpu_mes *mes) {int i;
@@ -291,7 +304,7 @@ static int mes_v10_1_set_hw_resources(struct amdgpu_mes *mes) mes->compute_hqd_mask[i];for (i =0 ; i <MAX_GFX_PIPES ; i++) - mes_set_hw_res_pkt.gfx_hqd_mask[i] = mes->gfx_hqd_mask[i]; + mes_set_hw_res_pkt.gfx_hqd_mask[i] =mes_v10_get_gfx_hqd_mask (i);for (i =0 ; i <MAX_SDMA_PIPES ; i++) mes_set_hw_res_pkt.sdma_hqd_mask[i] = mes->sdma_hqd_mask[i];
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +14 -1
@@ -360,6 +360,19 @@ static int mes_v11_0_misc_op(struct amdgpu_mes *mes, offsetof(union MESAPI__MISC, api_status)); } +static inline uint32_t mes_v11_get_gfx_hqd_mask (int pipe_index) +{ +/* Pipe 1 can't be used for MES due to HW limitation */ +if (pipe_index ==1 ) +return 0 ; + +/* +* GFX V10 supports 2 queues, but we want to keep queue 0 +* reserved for kernel, so enable only queue 1 (1<<1) for MES. +*/ +return 0x2 ; +} +static int mes_v11_0_set_hw_resources (struct amdgpu_mes *mes) {int i;
@@ -385,7 +398,7 @@ static int mes_v11_0_set_hw_resources(struct amdgpu_mes *mes) mes->compute_hqd_mask[i];for (i =0 ; i <MAX_GFX_PIPES ; i++) - mes_set_hw_res_pkt.gfx_hqd_mask[i] = mes->gfx_hqd_mask[i]; + mes_set_hw_res_pkt.gfx_hqd_mask[i] =mes_v11_get_gfx_hqd_mask (i);for (i =0 ; i <MAX_SDMA_PIPES ; i++) mes_set_hw_res_pkt.sdma_hqd_mask[i] = mes->sdma_hqd_mask[i];
Signature · 1 line
2.43.2
[AMD Official Use Only - General]
Quoted 87 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Shashank Sharma
Sent: Friday, April 5, 2024 10:36 AM
To: [email protected]
Cc: Sharma, Shashank <[email protected]>; Koenig, Christian <[email protected]>; Deucher, Alexander <[email protected]>; Yadav, Arvind <[email protected]>
Subject: [PATCH] drm/amdgpu: fix MES HQD masksCaution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
This patch fixes the existing HQD masks prepared during the MES initialization. These existing masks values were causing problems when we try to enable GFX oversubscription.
Cc Christian König <[email protected]>Cc Alex Deucher <[email protected]>Signed-off-by Shashank Sharma <[email protected]>Signed-off-by Arvind Yadav <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 3 --- drivers/gpu/drm/amd/amdgpu/mes_v10_1.c | 15 ++++++++++++++- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 15 ++++++++++++++- 3 files changed, 28 insertions(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +0
-3@@ -148,9 +148,6 @@ int amdgpu_mes_init(struct amdgpu_device *adev) adev->mes.compute_hqd_mask[i] =0xc ; } -for (i =0 ; i <AMDGPU_MES_MAX_GFX_PIPES ; i++) - adev->mes.gfx_hqd_mask[i] = i ?0 :0xfffffffe ; -for (i =0 ; i <AMDGPU_MES_MAX_SDMA_PIPES ; i++) {if (amdgpu_ip_version (adev,SDMA0_HWIP ,0 ) < IP_VERSION(6, 0, 0)) diff --git
a/drivers/gpu/drm/amd/amdgpu/mes_v10_1.cb/drivers/gpu/drm/amd/amdgpu/mes_v10_1.c
index1e5ad1e08d2a..9217914f824d100644drivers/gpu/drm/amd/amdgpu/mes_v10_1.c +14
-1@@ -266,6 +266,19 @@ static int mes_v10_1_query_sched_status(struct amdgpu_mes *mes) offsetof(union MESAPI__QUERY_MES_STATUS, api_status)); } +static inline uint32_t mes_v10_get_gfx_hqd_mask (int pipe_index) { +/* Pipe 1 can't be used for MES due to HW limitation */ +if (pipe_index ==1 ) +return 0 ; + +/* +* GFX V10 supports 2 queues, but we want to keep queue 0 +* reserved for kernel, so enable only queue 1 (1<<1) for MES. +*/ +return 0x2 ; +} +static int mes_v10_1_set_hw_resources (struct amdgpu_mes *mes) {int i;@@ -291,7 +304,7 @@ static int mes_v10_1_set_hw_resources(struct amdgpu_mes *mes) mes->compute_hqd_mask[i];for (i =0 ; i <MAX_GFX_PIPES ; i++) - mes_set_hw_res_pkt.gfx_hqd_mask[i] = mes->gfx_hqd_mask[i]; + mes_set_hw_res_pkt.gfx_hqd_mask[i] = +mes_v10_get_gfx_hqd_mask (i);for (i =0 ; i <MAX_SDMA_PIPES ; i++) mes_set_hw_res_pkt.sdma_hqd_mask[i] = mes->sdma_hqd_mask[i];drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +1
-0@@ -360,6 +360,19 @@ static int mes_v11_0_misc_op(struct amdgpu_mes *mes, offsetof(union MESAPI__MISC, api_status)); } +static inline uint32_t mes_v11_get_gfx_hqd_mask (int pipe_index) {
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c static int mes_v11_0_misc_op(struct amdgpu_mes · line 373
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +10
-0+/* Pipe 1 can't be used for MES due to HW limitation */ +if (pipe_index ==1 ) +return 0 ; + +/* +* GFX V10 supports 2 queues, but we want to keep queue 0 +* reserved for kernel, so enable only queue 1 (1<<1) for MES. +*/ +return 0x2 ; +}
There is no difference between this function and the corresponding function written for GFX10. Why not make this a common function instead?
Regards,
Mukul
Quoted 16 lines
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +3
-2+static int mes_v11_0_set_hw_resources (struct amdgpu_mes *mes) {int i;@@ -385,7 +398,7 @@ static int mes_v11_0_set_hw_resources(struct amdgpu_mes *mes) mes->compute_hqd_mask[i];for (i =0 ; i <MAX_GFX_PIPES ; i++) - mes_set_hw_res_pkt.gfx_hqd_mask[i] = mes->gfx_hqd_mask[i]; + mes_set_hw_res_pkt.gfx_hqd_mask[i] = +mes_v11_get_gfx_hqd_mask (i);for (i =0 ; i <MAX_SDMA_PIPES ; i++) mes_set_hw_res_pkt.sdma_hqd_mask[i] = mes->sdma_hqd_mask[i]; --2.43.2
Quoted 88 lines · Mukul
[AMD Official Use Only - General]
Quoted 86 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Shashank Sharma
Sent: Friday, April 5, 2024 10:36 AM
To: [email protected]
Cc: Sharma, Shashank <[email protected]>; Koenig, Christian <[email protected]>; Deucher, Alexander <[email protected]>; Yadav, Arvind <[email protected]>
Subject: [PATCH] drm/amdgpu: fix MES HQD masksCaution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
This patch fixes the existing HQD masks prepared during the MES initialization. These existing masks values were causing problems when we try to enable GFX oversubscription.
Cc Christian König <[email protected]>Cc Alex Deucher <[email protected]>Signed-off-by Shashank Sharma <[email protected]>Signed-off-by Arvind Yadav <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 3 --- drivers/gpu/drm/amd/amdgpu/mes_v10_1.c | 15 ++++++++++++++- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 15 ++++++++++++++- 3 files changed, 28 insertions(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +0
-3@@ -148,9 +148,6 @@ int amdgpu_mes_init(struct amdgpu_device *adev) adev->mes.compute_hqd_mask[i] =0xc ; } -for (i =0 ; i <AMDGPU_MES_MAX_GFX_PIPES ; i++) - adev->mes.gfx_hqd_mask[i] = i ?0 :0xfffffffe ; -for (i =0 ; i <AMDGPU_MES_MAX_SDMA_PIPES ; i++) {if (amdgpu_ip_version (adev,SDMA0_HWIP ,0 ) < IP_VERSION(6, 0, 0)) diff --git
a/drivers/gpu/drm/amd/amdgpu/mes_v10_1.cb/drivers/gpu/drm/amd/amdgpu/mes_v10_1.c
index1e5ad1e08d2a..9217914f824d100644drivers/gpu/drm/amd/amdgpu/mes_v10_1.c +14
-1@@ -266,6 +266,19 @@ static int mes_v10_1_query_sched_status(struct amdgpu_mes *mes) offsetof(union MESAPI__QUERY_MES_STATUS, api_status)); } +static inline uint32_t mes_v10_get_gfx_hqd_mask (int pipe_index) { +/* Pipe 1 can't be used for MES due to HW limitation */ +if (pipe_index ==1 ) +return 0 ; + +/* +* GFX V10 supports 2 queues, but we want to keep queue 0 +* reserved for kernel, so enable only queue 1 (1<<1) for MES. +*/ +return 0x2 ; +} +static int mes_v10_1_set_hw_resources (struct amdgpu_mes *mes) {int i;@@ -291,7 +304,7 @@ static int mes_v10_1_set_hw_resources(struct amdgpu_mes *mes) mes->compute_hqd_mask[i];for (i =0 ; i <MAX_GFX_PIPES ; i++) - mes_set_hw_res_pkt.gfx_hqd_mask[i] = mes->gfx_hqd_mask[i]; + mes_set_hw_res_pkt.gfx_hqd_mask[i] = +mes_v10_get_gfx_hqd_mask (i);for (i =0 ; i <MAX_SDMA_PIPES ; i++) mes_set_hw_res_pkt.sdma_hqd_mask[i] = mes->sdma_hqd_mask[i];drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +0
-0@@ -360,6 +360,19 @@ static int mes_v11_0_misc_op(struct amdgpu_mes *mes, offsetof(union MESAPI__MISC, api_status)); }
Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c static int mes_v11_0_misc_op(struct amdgpu_mes · line 373
Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +11
-0+static inline uint32_t mes_v11_get_gfx_hqd_mask (int pipe_index) { +/* Pipe 1 can't be used for MES due to HW limitation */ +if (pipe_index ==1 ) +return 0 ; + +/* +* GFX V10 supports 2 queues, but we want to keep queue 0 +* reserved for kernel, so enable only queue 1 (1<<1) for MES. +*/ +return 0x2 ; +}There is no difference between this function and the corresponding function written for GFX10. Why not make this a common function instead?
This is deliberate, to indicate that the HQD mask can be different for each GFX IP version, so as the number of pipes and queue per pipe. Also the limitation on pipe 1 will not be there for future versions.
- Shashank
Quoted 19 lines
Regards,
MukulQuoted 16 lines
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +3
-2+static int mes_v11_0_set_hw_resources (struct amdgpu_mes *mes) {int i;@@ -385,7 +398,7 @@ static int mes_v11_0_set_hw_resources(struct amdgpu_mes *mes) mes->compute_hqd_mask[i];for (i =0 ; i <MAX_GFX_PIPES ; i++) - mes_set_hw_res_pkt.gfx_hqd_mask[i] = mes->gfx_hqd_mask[i]; + mes_set_hw_res_pkt.gfx_hqd_mask[i] = +mes_v11_get_gfx_hqd_mask (i);for (i =0 ; i <MAX_SDMA_PIPES ; i++) mes_set_hw_res_pkt.sdma_hqd_mask[i] = mes->sdma_hqd_mask[i]; --2.43.2
[AMD Official Use Only - General]
Quoted 116 lines
-----Original Message-----
From: Sharma, Shashank <[email protected]>
Sent: Friday, April 5, 2024 11:37 AM
To: Joshi, Mukul <[email protected]>; [email protected]
Cc: Koenig, Christian <[email protected]>; Deucher, Alexander <[email protected]>; Yadav, Arvind <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: fix MES HQD masksQuoted 17 lines · Mukul
[AMD Official Use Only - General]
Quoted 15 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Shashank Sharma
Sent: Friday, April 5, 2024 10:36 AM
To: [email protected]
Cc: Sharma, Shashank <[email protected]>; Koenig, Christian <[email protected]>; Deucher, Alexander <[email protected]>; Yadav, Arvind <[email protected]>
Subject: [PATCH] drm/amdgpu: fix MES HQD masksCaution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
This patch fixes the existing HQD masks prepared during the MES
initialization.
Quoted 13 lines
Quoted 13 lines
These existing masks values were causing problems when we try to enable GFX oversubscription.
Cc Christian König <[email protected]>Cc Alex Deucher <[email protected]>Signed-off-by Shashank Sharma <[email protected]>Signed-off-by Arvind Yadav <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 3 --- drivers/gpu/drm/amd/amdgpu/mes_v10_1.c | 15 ++++++++++++++- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 15 ++++++++++++++- 3 files changed, 28 insertions(+), 5 deletions(-)Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c int amdgpu_mes_init(struct amdgpu_device
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +0
-0@@ -148,9 +148,6 @@ int amdgpu_mes_init(struct amdgpu_device*adev)
Quoted 42 lines
Quoted 42 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +0
-3adev->mes.compute_hqd_mask[i] =0xc ; } -for (i =0 ; i <AMDGPU_MES_MAX_GFX_PIPES ; i++) - adev->mes.gfx_hqd_mask[i] = i ?0 :0xfffffffe ; -for (i =0 ; i <AMDGPU_MES_MAX_SDMA_PIPES ; i++) {if (amdgpu_ip_version (adev,SDMA0_HWIP ,0 ) < IP_VERSION(6, 0, 0)) diff --git
a/drivers/gpu/drm/amd/amdgpu/mes_v10_1.cb/drivers/gpu/drm/amd/amdgpu/mes_v10_1.c
index1e5ad1e08d2a..9217914f824d100644drivers/gpu/drm/amd/amdgpu/mes_v10_1.c +14
-1@@ -266,6 +266,19 @@ static int mes_v10_1_query_sched_status(struct amdgpu_mes *mes) offsetof(union MESAPI__QUERY_MES_STATUS , api_status)); } +static inline uint32_t mes_v10_get_gfx_hqd_mask (int pipe_index) { +/* Pipe 1 can't be used for MES due to HW limitation */ +if (pipe_index ==1 ) +return 0 ; + +/* +* GFX V10 supports 2 queues, but we want to keep queue 0 +* reserved for kernel, so enable only queue 1 (1<<1) for MES. +*/ +return 0x2 ; +} +static int mes_v10_1_set_hw_resources (struct amdgpu_mes *mes) {int i;@@ -291,7 +304,7 @@ static int mes_v10_1_set_hw_resources(struct amdgpu_mes *mes) mes->compute_hqd_mask[i];for (i =0 ; i <MAX_GFX_PIPES ; i++) - mes_set_hw_res_pkt.gfx_hqd_mask[i] = mes->gfx_hqd_mask[i]; + mes_set_hw_res_pkt.gfx_hqd_mask[i] = +mes_v10_get_gfx_hqd_mask (i);Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c static int mes_v11_0_misc_op(struct
Quoted 9 lines
for (i = 0; i < MAX_SDMA_PIPES; i++) mes_set_hw_res_pkt.sdma_hqd_mask[i] =mes->sdma_hqd_mask[i]; diff --git
a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.cb/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
index26d71a22395d..b7dcd936afc8100644drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +0
-0@@ -360,6 +360,19 @@ static int mes_v11_0_misc_op(struct
amdgpu_mesQuoted 4 lines
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +0
-0*mes, offsetof(union MESAPI__MISC, api_status)); }Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c static int mes_v11_0_misc_op(struct · line 374
Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +11
-0+static inline uint32_t mes_v11_get_gfx_hqd_mask (int pipe_index) { +/* Pipe 1 can't be used for MES due to HW limitation */ +if (pipe_index ==1 ) +return 0 ; + +/* +* GFX V10 supports 2 queues, but we want to keep queue 0 +* reserved for kernel, so enable only queue 1 (1<<1) for MES. +*/ +return 0x2 ; +}There is no difference between this function and the corresponding function
Quoted 7 lines
written for GFX10.
Quoted 1 line
Why not make this a common function instead?
This is deliberate, to indicate that the HQD mask can be different for each GFX IP version, so as the number of pipes and queue per pipe. Also the limitation on pipe 1 will not be there for future versions.
But for now this is common for both GFX10 and GFX11. When we have a case where this changes in future, we can implement a new function specific for that GFX IP version. For now, this should be a common function.
Regards,
Mukul
Quoted 22 lines
- Shashank
Quoted 20 lines
Regards,
MukulQuoted 17 lines
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +3
-1+static int mes_v11_0_set_hw_resources (struct amdgpu_mes *mes) {int i;@@ -385,7 +398,7 @@ static int mes_v11_0_set_hw_resources(struct amdgpu_mes *mes) mes->compute_hqd_mask[i];for (i =0 ; i <MAX_GFX_PIPES ; i++) - mes_set_hw_res_pkt.gfx_hqd_mask[i] = mes->gfx_hqd_mask[i]; + mes_set_hw_res_pkt.gfx_hqd_mask[i] = +mes_v11_get_gfx_hqd_mask (i);for (i =0 ; i <MAX_SDMA_PIPES ; i++) mes_set_hw_res_pkt.sdma_hqd_mask[i] =mes->sdma_hqd_mask[i];
--
2.43.2
Quoted 124 lines · Mukul
[AMD Official Use Only - General]
Quoted 116 lines
-----Original Message-----
From: Sharma, Shashank <[email protected]>
Sent: Friday, April 5, 2024 11:37 AM
To: Joshi, Mukul <[email protected]>; [email protected]
Cc: Koenig, Christian <[email protected]>; Deucher, Alexander <[email protected]>; Yadav, Arvind <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: fix MES HQD masksQuoted 17 lines · Mukul
[AMD Official Use Only - General]
Quoted 15 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Shashank Sharma
Sent: Friday, April 5, 2024 10:36 AM
To: [email protected]
Cc: Sharma, Shashank <[email protected]>; Koenig, Christian <[email protected]>; Deucher, Alexander <[email protected]>; Yadav, Arvind <[email protected]>
Subject: [PATCH] drm/amdgpu: fix MES HQD masksCaution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
This patch fixes the existing HQD masks prepared during the MES
initialization.
Quoted 13 lines
Quoted 13 lines
These existing masks values were causing problems when we try to enable GFX oversubscription.
Cc Christian König <[email protected]>Cc Alex Deucher <[email protected]>Signed-off-by Shashank Sharma <[email protected]>Signed-off-by Arvind Yadav <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 3 --- drivers/gpu/drm/amd/amdgpu/mes_v10_1.c | 15 ++++++++++++++- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 15 ++++++++++++++- 3 files changed, 28 insertions(+), 5 deletions(-)Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c int amdgpu_mes_init(struct amdgpu_device
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +0
-0@@ -148,9 +148,6 @@ int amdgpu_mes_init(struct amdgpu_device*adev)
Quoted 42 lines
Quoted 42 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +0
-3adev->mes.compute_hqd_mask[i] =0xc ; } -for (i =0 ; i <AMDGPU_MES_MAX_GFX_PIPES ; i++) - adev->mes.gfx_hqd_mask[i] = i ?0 :0xfffffffe ; -for (i =0 ; i <AMDGPU_MES_MAX_SDMA_PIPES ; i++) {if (amdgpu_ip_version (adev,SDMA0_HWIP ,0 ) < IP_VERSION(6, 0, 0)) diff --git
a/drivers/gpu/drm/amd/amdgpu/mes_v10_1.cb/drivers/gpu/drm/amd/amdgpu/mes_v10_1.c
index1e5ad1e08d2a..9217914f824d100644drivers/gpu/drm/amd/amdgpu/mes_v10_1.c +14
-1@@ -266,6 +266,19 @@ static int mes_v10_1_query_sched_status(struct amdgpu_mes *mes) offsetof(union MESAPI__QUERY_MES_STATUS , api_status)); } +static inline uint32_t mes_v10_get_gfx_hqd_mask (int pipe_index) { +/* Pipe 1 can't be used for MES due to HW limitation */ +if (pipe_index ==1 ) +return 0 ; + +/* +* GFX V10 supports 2 queues, but we want to keep queue 0 +* reserved for kernel, so enable only queue 1 (1<<1) for MES. +*/ +return 0x2 ; +} +static int mes_v10_1_set_hw_resources (struct amdgpu_mes *mes) {int i;@@ -291,7 +304,7 @@ static int mes_v10_1_set_hw_resources(struct amdgpu_mes *mes) mes->compute_hqd_mask[i];for (i =0 ; i <MAX_GFX_PIPES ; i++) - mes_set_hw_res_pkt.gfx_hqd_mask[i] = mes->gfx_hqd_mask[i]; + mes_set_hw_res_pkt.gfx_hqd_mask[i] = +mes_v10_get_gfx_hqd_mask (i);Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c static int mes_v11_0_misc_op(struct
Quoted 9 lines
for (i = 0; i < MAX_SDMA_PIPES; i++) mes_set_hw_res_pkt.sdma_hqd_mask[i] =mes->sdma_hqd_mask[i]; diff --git
a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.cb/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
index26d71a22395d..b7dcd936afc8100644drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +0
-0@@ -360,6 +360,19 @@ static int mes_v11_0_misc_op(struct
amdgpu_mesQuoted 4 lines
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +0
-0*mes, offsetof(union MESAPI__MISC, api_status)); }Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c static int mes_v11_0_misc_op(struct · line 374
Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +11
-0+static inline uint32_t mes_v11_get_gfx_hqd_mask (int pipe_index) { +/* Pipe 1 can't be used for MES due to HW limitation */ +if (pipe_index ==1 ) +return 0 ; + +/* +* GFX V10 supports 2 queues, but we want to keep queue 0 +* reserved for kernel, so enable only queue 1 (1<<1) for MES. +*/ +return 0x2 ; +}There is no difference between this function and the corresponding function
Quoted 6 lines
written for GFX10.
Quoted 1 line
Why not make this a common function instead?
This is deliberate, to indicate that the HQD mask can be different for each GFX IP version, so as the number of pipes and queue per pipe. Also the limitation on pipe 1 will not be there for future versions.
Quoted 5 lines
But for now this is common for both GFX10 and GFX11. When we have a case where this changes in future, we can implement a new function specific for that GFX IP version. For now, this should be a common function.
Regards,
Mukul
Mukul,
This was already in a common function and this could have been fixed there, but the reason to write two function is to make the HQD mask setup IP file specific.
There would be some follow up patches for the same for the SDMA IP as well. As you can see, there are multiple common/duplicate functions already existing in IP specific files (gfx/vcn/sdma) but we keep it like that to indicate that these values and setups can be IP specific.
- Shashank
Quoted 23 lines
Quoted 23 lines
- Shashank
Quoted 20 lines
Regards,
MukulQuoted 17 lines
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +3
-1+static int mes_v11_0_set_hw_resources (struct amdgpu_mes *mes) {int i;@@ -385,7 +398,7 @@ static int mes_v11_0_set_hw_resources(struct amdgpu_mes *mes) mes->compute_hqd_mask[i];for (i =0 ; i <MAX_GFX_PIPES ; i++) - mes_set_hw_res_pkt.gfx_hqd_mask[i] = mes->gfx_hqd_mask[i]; + mes_set_hw_res_pkt.gfx_hqd_mask[i] = +mes_v11_get_gfx_hqd_mask (i);for (i =0 ; i <MAX_SDMA_PIPES ; i++) mes_set_hw_res_pkt.sdma_hqd_mask[i] =mes->sdma_hqd_mask[i];
--
2.43.2