drm/amdgpu: Fix memory range calculation
authorjsg <jsg@openbsd.org>
Mon, 5 Aug 2024 02:31:14 +0000 (02:31 +0000)
committerjsg <jsg@openbsd.org>
Mon, 5 Aug 2024 02:31:14 +0000 (02:31 +0000)
From Lijo Lazar
ae1dd0a379e41db7d4773880e6918948668ef3ad in linux-6.6.y/6.6.44
ce798376ef6764de51d8f4684ae525b55df295fa in mainline linux

sys/dev/pci/drm/amd/amdgpu/gmc_v9_0.c

index b53ac67..77f085e 100644 (file)
@@ -1956,7 +1956,7 @@ gmc_v9_0_init_sw_mem_ranges(struct amdgpu_device *adev,
                break;
        }
 
-       size = adev->gmc.real_vram_size >> AMDGPU_GPU_PAGE_SHIFT;
+       size = (adev->gmc.real_vram_size + SZ_16M) >> AMDGPU_GPU_PAGE_SHIFT;
        size /= adev->gmc.num_mem_partitions;
 
        for (i = 0; i < adev->gmc.num_mem_partitions; ++i) {