drm/amdgpu: Use correct size when access vram
Subsystems (2)
PATCH 1/1 drm/amdgpu: Use correct size when access vram
To make size is 4 byte aligned. Use &~0x3ULL instead of &3ULL.
Signed-off-by xinhui pan <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 -1
@@ -1503,7 +1503,7 @@ static int amdgpu_ttm_access_memory(struct ttm_buffer_object *bo,memcpy (buf, &value, bytes); } }else { - bytes = cursor.size &0x3ull ; + bytes = cursor.size & ~0x3ULL ;amdgpu_device_vram_access (adev, cursor.start, (uint32_t *)buf, bytes, write);
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Christian König
maintainerAm 22.03.21 um 01:53 schrieb xinhui pan:
Quoted 3 lines
To make size is 4 byte aligned. Use &~0x3ULL instead of &3ULL.
Signed-off-by xinhui pan <[email protected]>
Good catch. Patch is Reviewed-by: Christian König <[email protected]>
Quoted 9 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c static int amdgpu_ttm_access_memory(struct ttm_buffer_object *bo, · line 1509
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1
-1@@ -1503,7 +1503,7 @@ static int amdgpu_ttm_access_memory(struct ttm_buffer_object *bo,memcpy (buf, &value, bytes); } }else { - bytes = cursor.size &0x3ull ; + bytes = cursor.size & ~0x3ULL ;amdgpu_device_vram_access (adev, cursor.start, (uint32_t *)buf, bytes, write);
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx