Commit 9288b874 authored by Felix Kuehling's avatar Felix Kuehling Committed by Alex Deucher

drm/amdgpu: Fix unaligned memory copies

When starting a new mm_node, the page_offset becomes 0.
Signed-off-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 3bd53269
...@@ -391,6 +391,7 @@ int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev, ...@@ -391,6 +391,7 @@ int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
src_node_start = amdgpu_mm_node_addr(src->bo, ++src_mm, src_node_start = amdgpu_mm_node_addr(src->bo, ++src_mm,
src->mem); src->mem);
src_node_size = (src_mm->size << PAGE_SHIFT); src_node_size = (src_mm->size << PAGE_SHIFT);
src_page_offset = 0;
} else { } else {
src_node_start += cur_size; src_node_start += cur_size;
src_page_offset = src_node_start & (PAGE_SIZE - 1); src_page_offset = src_node_start & (PAGE_SIZE - 1);
...@@ -400,6 +401,7 @@ int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev, ...@@ -400,6 +401,7 @@ int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
dst_node_start = amdgpu_mm_node_addr(dst->bo, ++dst_mm, dst_node_start = amdgpu_mm_node_addr(dst->bo, ++dst_mm,
dst->mem); dst->mem);
dst_node_size = (dst_mm->size << PAGE_SHIFT); dst_node_size = (dst_mm->size << PAGE_SHIFT);
dst_page_offset = 0;
} else { } else {
dst_node_start += cur_size; dst_node_start += cur_size;
dst_page_offset = dst_node_start & (PAGE_SIZE - 1); dst_page_offset = dst_node_start & (PAGE_SIZE - 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment