Skip to content

Commit d537515

Browse files
Yi Lialexdeucher
authored andcommitted
drm/amdgpu: Fix GPU TLB update error when PAGE_SIZE > AMDGPU_PAGE_SIZE
When PAGE_SIZE is larger than AMDGPU_PAGE_SIZE, the number of GPU TLB entries which need to update in amdgpu_map_buffer() should be multiplied by AMDGPU_GPU_PAGES_IN_CPU_PAGE (PAGE_SIZE / AMDGPU_PAGE_SIZE). Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Yi Li <liyi@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
1 parent 0c8df34 commit d537515

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ static int amdgpu_ttm_map_buffer(struct ttm_buffer_object *bo,
225225
*addr += mm_cur->start & ~PAGE_MASK;
226226

227227
num_dw = ALIGN(adev->mman.buffer_funcs->copy_num_dw, 8);
228-
num_bytes = num_pages * 8;
228+
num_bytes = num_pages * 8 * AMDGPU_GPU_PAGES_IN_CPU_PAGE;
229229

230230
r = amdgpu_job_alloc_with_ib(adev, num_dw * 4 + num_bytes,
231231
AMDGPU_IB_POOL_DELAYED, &job);

0 commit comments

Comments
 (0)