[PATCH 2/2] drm/amdgpu: remove unnecessary judgement in sdma reg offest calculaton
Alex Deucher
alexdeucher at gmail.com
Fri Sep 30 14:35:39 UTC 2022
Series is:
Acked-by: Alex Deucher <alexander.deucher at amd.com>
On Fri, Sep 30, 2022 at 2:17 AM Yifan Zhang <yifan1.zhang at amd.com> wrote:
>
> clean sdma_v6_0_get_reg_offset function.
>
> Signed-off-by: Yifan Zhang <yifan1.zhang at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
> index db51230163c5..b2c71f533e93 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
> @@ -67,12 +67,10 @@ static u32 sdma_v6_0_get_reg_offset(struct amdgpu_device *adev, u32 instance, u3
> if (internal_offset >= SDMA0_HYP_DEC_REG_START &&
> internal_offset <= SDMA0_HYP_DEC_REG_END) {
> base = adev->reg_offset[GC_HWIP][0][1];
> - if (instance != 0)
> - internal_offset += SDMA1_HYP_DEC_REG_OFFSET * instance;
> + internal_offset += SDMA1_HYP_DEC_REG_OFFSET * instance;
> } else {
> base = adev->reg_offset[GC_HWIP][0][0];
> - if (instance == 1)
> - internal_offset += SDMA1_REG_OFFSET;
> + internal_offset += SDMA1_REG_OFFSET * instance;
> }
>
> return base + internal_offset;
> --
> 2.37.3
>
More information about the amd-gfx
mailing list