Skip to contentSkip to conversation

drm/amdgpu: Fix unaligned memory copies

PATCH In review Kuehling, Felix 3 participants 3 messages Jul 13, 2019 – Jul 15, 2019 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Fix unaligned memory copies

When starting a new mm_node, the page_offset becomes 0.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2 -0
index 37d9a3b09946..d0f6c23ec7cf 100644
@@ -386,6 +386,7 @@ int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
 			src_node_start = amdgpu_mm_node_addr(src->bo, ++src_mm,
 							     src->mem);
 			src_node_size = (src_mm->size << PAGE_SHIFT);
+			src_page_offset = 0;
 		} else {
 			src_node_start += cur_size;
 			src_page_offset = src_node_start & (PAGE_SIZE - 1);
@@ -395,6 +396,7 @@ int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
 			dst_node_start = amdgpu_mm_node_addr(dst->bo, ++dst_mm,
 							     dst->mem);
 			dst_node_size = (dst_mm->size << PAGE_SHIFT);
+			dst_page_offset = 0;
 		} else {
 			dst_node_start += cur_size;
 			dst_page_offset = dst_node_start & (PAGE_SIZE - 1);
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20190713064245.20097-1-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw
Quoted 4 lines · Felix

When starting a new mm_node, the page_offset becomes 0.

Quoted 27 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2 -1
index 37d9a3b09946..d0f6c23ec7cf 100644
@@ -386,6 +386,7 @@ int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
                        src_node_start = amdgpu_mm_node_addr(src->bo, ++src_mm,
                                                             src->mem);
                        src_node_size = (src_mm->size << PAGE_SHIFT);
+                       src_page_offset = 0;
                } else {
                        src_node_start += cur_size;
                        src_page_offset = src_node_start & (PAGE_SIZE - 1);
@@ -395,6 +396,7 @@ int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
                        dst_node_start = amdgpu_mm_node_addr(dst->bo, ++dst_mm,
                                                             dst->mem);
                        dst_node_size = (dst_mm->size << PAGE_SHIFT);
+                       dst_page_offset = 0;
                } else {
                        dst_node_start += cur_size;
                        dst_page_offset = dst_node_start & (PAGE_SIZE - 1);
--

2.17.1

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CADnq5_OCXiEoPU5+K2-NQ+9zNMVRd2mMwY6NYeK6Jp0ssLcjtg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

Reviewed-by
#4 lore raw

Am 15.07.19 um 18:12 schrieb Alex Deucher:

Quoted 5 lines · Felix
Quoted 3 lines

When starting a new mm_node, the page_offset becomes 0.

Quoted 28 lines
Quoted 28 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2 -1
index 37d9a3b09946..d0f6c23ec7cf 100644
@@ -386,6 +386,7 @@ int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
                         src_node_start = amdgpu_mm_node_addr(src->bo, ++src_mm,
                                                              src->mem);
                         src_node_size = (src_mm->size << PAGE_SHIFT);
+                       src_page_offset = 0;
                 } else {
                         src_node_start += cur_size;
                         src_page_offset = src_node_start & (PAGE_SIZE - 1);
@@ -395,6 +396,7 @@ int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
                         dst_node_start = amdgpu_mm_node_addr(dst->bo, ++dst_mm,
                                                              dst->mem);
                         dst_node_size = (dst_mm->size << PAGE_SHIFT);
+                       dst_page_offset = 0;
                 } else {
                         dst_node_start += cur_size;
                         dst_page_offset = dst_node_start & (PAGE_SIZE - 1);
--

2.17.1

Quoted 8 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx