drm/amdgpu: fix max_entries calculation v4
authorChristian König <christian.koenig@amd.com>
Wed, 2 Sep 2020 09:07:14 +0000 (11:07 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 3 Sep 2020 18:48:04 +0000 (14:48 -0400)
commitee354ff1c7c210fb41952ebf0a820fb714eae7b1
tree620273b700b81cfed517986412b6aa7965541d04
parent1625951a3a7bdd776d38f2cdd35f72a795e82df0
drm/amdgpu: fix max_entries calculation v4

Calculate the correct value for max_entries or we might run after the
page_address array.

v2: Xinhui pointed out we don't need the shift
v3: use local copy of start and simplify some calculation
v4: fix the case that we map less VA range than BO size

Signed-off-by: Christian König <christian.koenig@amd.com>
Fixes: 1e691e244487 drm/amdgpu: stop allocating dummy GTT nodes
Reviewed-by: xinhui pan <xinhui.pan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c