Skip to content

Commit

Permalink
drm/amdgpu: Use correct size when access vram
Browse files Browse the repository at this point in the history
To make size is 4 byte aligned. Use &~0x3ULL instead of &3ULL.

Signed-off-by: xinhui pan <xinhui.pan@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
  • Loading branch information
xinhui pan authored and Gerrit Cr committed Mar 22, 2021
1 parent edc8846 commit 5012a43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5012a43

Please sign in to comment.