drm/amdgpu: Fix a bug in amdgpu_fill_buffer()
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fix a bug in amdgpu_fill_buffer()
When max_bytes is not 8 bytes aligned and bo size is larger than max_bytes, the last 8 bytes in a ttm node may be left unchanged. For example, on pre SDMA 4.0, max_bytes = 0x1fffff, and the bo size is 0x200000, the problem will happen. This commit fixed that.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2 -1
@@ -1619,7 +1619,8 @@ int amdgpu_fill_buffer(struct amdgpu_bo *bo, dst_addr =amdgpu_mm_node_addr (&bo->tbo, mm_node, &bo->tbo.mem);while (byte_count) { -uint32_t cur_size_in_bytes =min (byte_count, max_bytes); +uint32_t cur_size_in_bytes = +min (byte_count, max_bytes) & ~0x7 ; amdgpu_vm_set_pte_pde(adev, &job->ibs[0], dst_addr, 0,
Signature · 6 lines
2.7.4 _______________________________________________ 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): 1505517489-17588-1-git-send-email-yong.zhao-5C7GfCeVMHo@public.gmane.org
Am 16.09.2017 um 01:18 schrieb Yong Zhao:
Quoted 4 lines
When
max_bytesis not 8 bytes aligned and bo size is larger thanmax_bytes, the last 8 bytes in a ttm node may be left unchanged. For example, on pre SDMA 4.0,max_bytes=0x1fffff, and the bo size is0x200000, the problem will happen. This commit fixed that.
Nice catch, but please fix buffer_funcs->fill_max_bytes instead of working around an incorrect value here.
Regards,
Christian.
Quoted 12 lines
Change-Id I37c588a57cb63f1a8251fb5ead2eff4b39e047c9Signed-off-by Yong Zhao <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c int amdgpu_fill_buffer(struct amdgpu_bo *bo, · line 1626
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2
-1@@ -1619,7 +1619,8 @@ int amdgpu_fill_buffer(struct amdgpu_bo *bo, dst_addr =amdgpu_mm_node_addr (&bo->tbo, mm_node, &bo->tbo.mem);while (byte_count) { -uint32_t cur_size_in_bytes =min (byte_count, max_bytes); +uint32_t cur_size_in_bytes = +min (byte_count, max_bytes) & ~0x7 ; amdgpu_vm_set_pte_pde(adev, &job->ibs[0], dst_addr, 0,
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx