drm/amd/amdgpu: Fix incorrect logic to increment VCN doorbell index
authorBokun Zhang <Bokun.Zhang@amd.com>
Mon, 9 Nov 2020 18:59:27 +0000 (13:59 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 10 Nov 2020 19:26:24 +0000 (14:26 -0500)
commit25a35065c066496935217748b1662a7fcf26ed58
tree9ffbfb9384bb38e77e9b770472b00c37d7891f2c
parent880af2eaedd3f63d413a439ef29edcc0a5fbdc73
drm/amd/amdgpu: Fix incorrect logic to increment VCN doorbell index

- The original logic uses a counter based index assignment,
  which is incorrect if we only assign VCN1 to this VF but no VCN0

  The doorbell index is absolute, so we can calculate it by
  using index variable i and j

Signed-off-by: Bokun Zhang <Bokun.Zhang@amd.com>
Reviewed-by: Monk Liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c