All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: fix "fix 64bit division"
@ 2017-04-07  8:44 Christian König
       [not found] ` <1491554650-9691-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Christian König @ 2017-04-07  8:44 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

From: Christian König <christian.koenig@amd.com>

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

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index c91f13b..ba11ff254 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -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;
 }
 
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] drm/amdgpu: fix "fix 64bit division"
       [not found] ` <1491554650-9691-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
@ 2017-04-07  8:53   ` Quan, Evan
  2017-04-07  8:55   ` Zhang, Jerry (Junwei)
  1 sibling, 0 replies; 3+ messages in thread
From: Quan, Evan @ 2017-04-07  8:53 UTC (permalink / raw)
  To: Christian König, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Reviewed-by: Evan Quan <evan.quan@amd.com>

>-----Original Message-----
>From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf Of
>Christian K?nig
>Sent: Friday, April 07, 2017 4:44 PM
>To: amd-gfx@lists.freedesktop.org
>Subject: [PATCH] drm/amdgpu: fix "fix 64bit division"
>
>From: Christian König <christian.koenig@amd.com>
>
>The offset must be 64bit and add back the accidential dropped line.
>
>Signed-off-by: Christian König <christian.koenig@amd.com>
>---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>index c91f13b..ba11ff254 100644
>--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>@@ -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;
> }
>
>--
>2.7.4
>
>_______________________________________________
>amd-gfx mailing list
>amd-gfx@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdgpu: fix "fix 64bit division"
       [not found] ` <1491554650-9691-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
  2017-04-07  8:53   ` Quan, Evan
@ 2017-04-07  8:55   ` Zhang, Jerry (Junwei)
  1 sibling, 0 replies; 3+ messages in thread
From: Zhang, Jerry (Junwei) @ 2017-04-07  8:55 UTC (permalink / raw)
  To: Christian König, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW



On 04/07/2017 04:44 PM, Christian König wrote:
> From: Christian König <christian.koenig@amd.com>
>
> The offset must be 64bit and add back the accidential dropped line.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index c91f13b..ba11ff254 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -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;
>   }
>
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-07  8:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-07  8:44 [PATCH] drm/amdgpu: fix "fix 64bit division" Christian König
     [not found] ` <1491554650-9691-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-07  8:53   ` Quan, Evan
2017-04-07  8:55   ` Zhang, Jerry (Junwei)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.