Skip to contentSkip to conversation

drm/amdgpu: fix "fix 64bit division"

PATCH In review Christian König 3 participants 3 messages Apr 7, 2017 1 message not in the archive

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

PATCH 1/1 drm/amdgpu: fix "fix 64bit division"

From: Christian König <[email protected]>

The offset must be 64bit and add back the accidential dropped line.

---
 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
index c91f13b..ba11ff254 100644
@@ -551,9 +551,10 @@ 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;
+	uint64_t offset = page_offset;
 
 	page_offset = do_div(offset, size);
+	mm += offset;
 	return (bo->mem.bus.base >> PAGE_SHIFT) + mm->start + page_offset;
 }
 
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): 1491554650-9691-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

Reviewed-by Evan Quan
#2 lore raw
Quoted 35 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Christian K?nig
Sent: Friday, April 07, 2017 4:44 PM
To: [email protected]
Subject: [PATCH] drm/amdgpu: fix "fix 64bit division"

From: Christian König <[email protected]>

The offset must be 64bit and add back the accidential dropped line.

---
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
index c91f13b..ba11ff254 100644
@@ -551,9 +551,10 @@ 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;
+	uint64_t offset = page_offset;
 
 	page_offset = do_div(offset, size);
+	mm += offset;
 	return (bo->mem.bus.base >> PAGE_SHIFT) + mm->start +
 page_offset;

}

Quoted 7 lines

--
2.7.4

_______________________________________________
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

Reviewed-by Junwei Zhang
#3 lore raw
In reply to a message not in the archive
Quoted 5 lines · Christian König

From: Christian König <[email protected]>

The offset must be 64bit and add back the accidential dropped line.

Quoted 11 lines
---
  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
index c91f13b..ba11ff254 100644
@@ -551,9 +551,10 @@ static unsigned long amdgpu_ttm_io_mem_pfn(struct ttm_buffer_object *bo,
  {

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c static unsigned long amdgpu_ttm_io_mem_pfn(struct ttm_buffer_object *bo, · line 560

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2 -1
  	struct drm_mm_node *mm = bo->mem.mm_node;
  	uint64_t size = mm->size;
-	unsigned long offset = page_offset;
+	uint64_t offset = page_offset;
 
  	page_offset = do_div(offset, size);
+	mm += offset;
  	return (bo->mem.bus.base >> PAGE_SHIFT) + mm->start + page_offset;
  }
 

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