[Public]

> From: amd-gfx <[email protected]> On Behalf Of Lazar,
> Lijo
> Sent: Thursday, March 20, 2025 7:14 PM
> To: Deucher, Alexander <[email protected]>; amd-
> [email protected]
> Cc: Liu, Shaoyun <[email protected]>
> Subject: Re: [PATCH 1/4] drm/amdgpu/mes: optimize compute loop handling
>
>
>
> On 3/20/2025 12:38 AM, Alex Deucher wrote:
> > Break when we get to the end of the supported pipes rather than
> > continuing the loop.
> >
> > Reviewed-by: Shaoyun.liu <[email protected]>
> > Signed-off-by: Alex Deucher <[email protected]>
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> > index 3b83880f9e2cc..10f14bf925778 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> > @@ -132,7 +132,7 @@ int amdgpu_mes_init(struct amdgpu_device *adev)
> >     for (i = 0; i < AMDGPU_MES_MAX_COMPUTE_PIPES; i++) {
>
> Unless I'm not seeing something, why not just keep it i <
> adev->gfx.mec.num_pipe_per_mec?
>
> Thanks,
> Lijo
>
This check way may benefit when the check case is 
adev->gfx.mec.num_pipe_per_mec < AMDGPU_MES_MAX_COMPUTE_PIPES; in this way it 
will reduce the later unused loop check.

Thanks,
Prike

> >             /* use only 1st MEC pipes */
> >             if (i >= adev->gfx.mec.num_pipe_per_mec)
> > -                   continue;
> > +                   break;
> >             adev->mes.compute_hqd_mask[i] = 0xc;
> >     }
> >

Reply via email to