AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] drm/amdgpu: disable gpu-sched load balance for uvd_enc
@ 2020-09-02 10:08 Nirmoy Das
  2020-09-02 10:12 ` Nirmoy
  0 siblings, 1 reply; 5+ messages in thread
From: Nirmoy Das @ 2020-09-02 10:08 UTC (permalink / raw)
  To: amd-gfx
  Cc: Tianci.Yin, pmenzel+amd-gfx, Nirmoy Das, alexander.deucher,
	Leo.Liu, christian.koenig

On hardware with multiple uvd instances, dependent uvd_enc jobs
may get scheduled to different uvd instances. Because uvd_enc
jobs retain hw context, dependent jobs should always run on the
same uvd instance. This patch disables GPU scheduler's load balancer
for a context that binds jobs from same the context to a uvd
instance.

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
index 7cd398d25498..c80d8339f58c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
@@ -114,8 +114,10 @@ static int amdgpu_ctx_init_entity(struct amdgpu_ctx *ctx, u32 hw_ip,
 	scheds = adev->gpu_sched[hw_ip][hw_prio].sched;
 	num_scheds = adev->gpu_sched[hw_ip][hw_prio].num_scheds;

+	/* disable load balance if the hw engine retains context among dependent jobs */
 	if (hw_ip == AMDGPU_HW_IP_VCN_ENC ||
 	    hw_ip == AMDGPU_HW_IP_VCN_DEC ||
+	    hw_ip == AMDGPU_HW_IP_UVD_ENC ||
 	    hw_ip == AMDGPU_HW_IP_UVD) {
 		sched = drm_sched_pick_best(scheds, num_scheds);
 		scheds = &sched;
--
2.28.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] drm/amdgpu: disable gpu-sched load balance for uvd_enc
  2020-09-02 10:08 [PATCH 1/1] drm/amdgpu: disable gpu-sched load balance for uvd_enc Nirmoy Das
@ 2020-09-02 10:12 ` Nirmoy
  0 siblings, 0 replies; 5+ messages in thread
From: Nirmoy @ 2020-09-02 10:12 UTC (permalink / raw)
  To: Nirmoy Das, amd-gfx
  Cc: alexander.deucher, pmenzel+amd-gfx, Tianci.Yin, Leo.Liu,
	christian.koenig

Please ignore this.

On 9/2/20 12:08 PM, Nirmoy Das wrote:
> On hardware with multiple uvd instances, dependent uvd_enc jobs
> may get scheduled to different uvd instances. Because uvd_enc
> jobs retain hw context, dependent jobs should always run on the
> same uvd instance. This patch disables GPU scheduler's load balancer
> for a context that binds jobs from same the context to a uvd
> instance.


from same the context --> from the same context

>
> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> index 7cd398d25498..c80d8339f58c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> @@ -114,8 +114,10 @@ static int amdgpu_ctx_init_entity(struct amdgpu_ctx *ctx, u32 hw_ip,
>   	scheds = adev->gpu_sched[hw_ip][hw_prio].sched;
>   	num_scheds = adev->gpu_sched[hw_ip][hw_prio].num_scheds;
>
> +	/* disable load balance if the hw engine retains context among dependent jobs */
>   	if (hw_ip == AMDGPU_HW_IP_VCN_ENC ||
>   	    hw_ip == AMDGPU_HW_IP_VCN_DEC ||
> +	    hw_ip == AMDGPU_HW_IP_UVD_ENC ||
>   	    hw_ip == AMDGPU_HW_IP_UVD) {
>   		sched = drm_sched_pick_best(scheds, num_scheds);
>   		scheds = &sched;
> --
> 2.28.0
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/1] drm/amdgpu: disable gpu-sched load balance for uvd_enc
@ 2020-09-02 10:15 Nirmoy Das
  2020-09-02 11:07 ` Christian König
  0 siblings, 1 reply; 5+ messages in thread
From: Nirmoy Das @ 2020-09-02 10:15 UTC (permalink / raw)
  To: amd-gfx
  Cc: Tianci.Yin, pmenzel+amd-gfx, Nirmoy Das, alexander.deucher,
	Leo.Liu, christian.koenig

On hardware with multiple uvd instances, dependent uvd_enc jobs
may get scheduled to different uvd instances. Because uvd_enc
jobs retain hw context, dependent jobs should always run on the
same uvd instance. This patch disables GPU scheduler's load balancer
for a context that binds jobs from the same context to a uvd
instance.

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
index 7cd398d25498..c80d8339f58c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
@@ -114,8 +114,10 @@ static int amdgpu_ctx_init_entity(struct amdgpu_ctx *ctx, u32 hw_ip,
 	scheds = adev->gpu_sched[hw_ip][hw_prio].sched;
 	num_scheds = adev->gpu_sched[hw_ip][hw_prio].num_scheds;

+	/* disable load balance if the hw engine retains context among dependent jobs */
 	if (hw_ip == AMDGPU_HW_IP_VCN_ENC ||
 	    hw_ip == AMDGPU_HW_IP_VCN_DEC ||
+	    hw_ip == AMDGPU_HW_IP_UVD_ENC ||
 	    hw_ip == AMDGPU_HW_IP_UVD) {
 		sched = drm_sched_pick_best(scheds, num_scheds);
 		scheds = &sched;
--
2.28.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] drm/amdgpu: disable gpu-sched load balance for uvd_enc
  2020-09-02 10:15 Nirmoy Das
@ 2020-09-02 11:07 ` Christian König
  2020-09-03  8:38   ` Nirmoy
  0 siblings, 1 reply; 5+ messages in thread
From: Christian König @ 2020-09-02 11:07 UTC (permalink / raw)
  To: Nirmoy Das, amd-gfx
  Cc: pmenzel+amd-gfx, alexander.deucher, Tianci.Yin, Leo.Liu,
	christian.koenig

Am 02.09.20 um 12:15 schrieb Nirmoy Das:
> On hardware with multiple uvd instances, dependent uvd_enc jobs
> may get scheduled to different uvd instances. Because uvd_enc
> jobs retain hw context, dependent jobs should always run on the
> same uvd instance. This patch disables GPU scheduler's load balancer
> for a context that binds jobs from the same context to a uvd
> instance.
>
> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> index 7cd398d25498..c80d8339f58c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> @@ -114,8 +114,10 @@ static int amdgpu_ctx_init_entity(struct amdgpu_ctx *ctx, u32 hw_ip,
>   	scheds = adev->gpu_sched[hw_ip][hw_prio].sched;
>   	num_scheds = adev->gpu_sched[hw_ip][hw_prio].num_scheds;
>
> +	/* disable load balance if the hw engine retains context among dependent jobs */
>   	if (hw_ip == AMDGPU_HW_IP_VCN_ENC ||
>   	    hw_ip == AMDGPU_HW_IP_VCN_DEC ||
> +	    hw_ip == AMDGPU_HW_IP_UVD_ENC ||
>   	    hw_ip == AMDGPU_HW_IP_UVD) {
>   		sched = drm_sched_pick_best(scheds, num_scheds);
>   		scheds = &sched;
> --
> 2.28.0
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] drm/amdgpu: disable gpu-sched load balance for uvd_enc
  2020-09-02 11:07 ` Christian König
@ 2020-09-03  8:38   ` Nirmoy
  0 siblings, 0 replies; 5+ messages in thread
From: Nirmoy @ 2020-09-03  8:38 UTC (permalink / raw)
  To: christian.koenig, Nirmoy Das, amd-gfx
  Cc: pmenzel+amd-gfx, alexander.deucher, Tianci.Yin, Leo.Liu

Hi Alex,


If possible, please squash this with:


commit e0300ed8820d19fe108006cf1b69fa26f0b4e3fc

drm/amdgpu: disable gpu-sched load balance for uvd


Regards,

Nirmoy

On 9/2/20 1:07 PM, Christian König wrote:
> Am 02.09.20 um 12:15 schrieb Nirmoy Das:
>> On hardware with multiple uvd instances, dependent uvd_enc jobs
>> may get scheduled to different uvd instances. Because uvd_enc
>> jobs retain hw context, dependent jobs should always run on the
>> same uvd instance. This patch disables GPU scheduler's load balancer
>> for a context that binds jobs from the same context to a uvd
>> instance.
>>
>> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
>> index 7cd398d25498..c80d8339f58c 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
>> @@ -114,8 +114,10 @@ static int amdgpu_ctx_init_entity(struct 
>> amdgpu_ctx *ctx, u32 hw_ip,
>>       scheds = adev->gpu_sched[hw_ip][hw_prio].sched;
>>       num_scheds = adev->gpu_sched[hw_ip][hw_prio].num_scheds;
>>
>> +    /* disable load balance if the hw engine retains context among 
>> dependent jobs */
>>       if (hw_ip == AMDGPU_HW_IP_VCN_ENC ||
>>           hw_ip == AMDGPU_HW_IP_VCN_DEC ||
>> +        hw_ip == AMDGPU_HW_IP_UVD_ENC ||
>>           hw_ip == AMDGPU_HW_IP_UVD) {
>>           sched = drm_sched_pick_best(scheds, num_scheds);
>>           scheds = &sched;
>> -- 
>> 2.28.0
>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cnirmoy.das%40amd.com%7C14abaffe97944d1732a008d84f306f01%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637346416736947845&amp;sdata=1F8al%2F7xTX2sjhoUI88UNE2mjWPJxNpFslmAuBJjevU%3D&amp;reserved=0 
>>
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-03  8:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-02 10:08 [PATCH 1/1] drm/amdgpu: disable gpu-sched load balance for uvd_enc Nirmoy Das
2020-09-02 10:12 ` Nirmoy
  -- strict thread matches above, loose matches on Subject: below --
2020-09-02 10:15 Nirmoy Das
2020-09-02 11:07 ` Christian König
2020-09-03  8:38   ` Nirmoy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox