drm/amdgpu: fix 64bit division
Subsystems (2)
PATCH 1/1 drm/amdgpu: fix 64bit division
From: Christian König <[email protected]>
Added with "handle CPU access for split VRAM buffers".
Signed-off-by Christian König <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2 -2
@@ -551,9 +551,9 @@ static unsigned long amdgpu_ttm_io_mem_pfn(struct ttm_buffer_object *bo, {struct drm_mm_node *mm = bo->mem.mm_node;uint64_t size = mm->size; +unsigned long offset = page_offset; - mm += page_offset / size; - page_offset %= size; + page_offset =do_div (offset, size);return (bo->mem.bus.base >>PAGE_SHIFT ) + mm->start + page_offset; }
Signature · 6 lines
2.5.0 _______________________________________________ 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): 1491385157-16175-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
Alex Deucher
Reviewed-byQuoted 5 lines · Christian König
From: Christian König <[email protected]>
Added with "handle CPU access for split VRAM buffers".
Signed-off-by Christian König <[email protected]>
Reviewed-by Alex Deucher <[email protected]>
Quoted 23 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2
-3@@ -551,9 +551,9 @@ static unsigned long amdgpu_ttm_io_mem_pfn(struct ttm_buffer_object *bo, {struct drm_mm_node *mm = bo->mem.mm_node;uint64_t size = mm->size; +unsigned long offset = page_offset; - mm += page_offset / size; - page_offset %= size; + page_offset =do_div (offset, size);return (bo->mem.bus.base >>PAGE_SHIFT ) + mm->start + page_offset; } --2.5.0
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