* [PATCH] drm/amdgpu: use correct rounding macro for 64-bit
@ 2021-06-10 3:03 Dave Airlie
2021-06-10 3:23 ` Alex Deucher
2021-06-10 6:55 ` Christian König
0 siblings, 2 replies; 5+ messages in thread
From: Dave Airlie @ 2021-06-10 3:03 UTC (permalink / raw)
To: dri-devel; +Cc: alexander.deucher, christian.koenig
From: Dave Airlie <airlied@redhat.com>
This fixes 32-bit arm build due to lack of 64-bit divides.
Fixes: cb1c81467af3 ("drm/ttm: flip the switch for driver allocated resources v2")
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
index 9a6df02477ce..436ec246a7da 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
@@ -407,7 +407,7 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man,
#endif
pages_per_node = max_t(uint32_t, pages_per_node,
tbo->page_alignment);
- num_nodes = DIV_ROUND_UP(PFN_UP(mem_bytes), pages_per_node);
+ num_nodes = DIV_ROUND_UP_ULL(PFN_UP(mem_bytes), pages_per_node);
}
node = kvmalloc(struct_size(node, mm_nodes, num_nodes),
--
2.25.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/amdgpu: use correct rounding macro for 64-bit
2021-06-10 3:03 [PATCH] drm/amdgpu: use correct rounding macro for 64-bit Dave Airlie
@ 2021-06-10 3:23 ` Alex Deucher
2021-06-10 3:33 ` Dave Airlie
2021-06-10 6:55 ` Christian König
1 sibling, 1 reply; 5+ messages in thread
From: Alex Deucher @ 2021-06-10 3:23 UTC (permalink / raw)
To: Dave Airlie
Cc: Deucher, Alexander, Christian Koenig,
Maling list - DRI developers
On Wed, Jun 9, 2021 at 11:10 PM Dave Airlie <airlied@gmail.com> wrote:
>
> From: Dave Airlie <airlied@redhat.com>
>
> This fixes 32-bit arm build due to lack of 64-bit divides.
>
> Fixes: cb1c81467af3 ("drm/ttm: flip the switch for driver allocated resources v2")
> Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> index 9a6df02477ce..436ec246a7da 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> @@ -407,7 +407,7 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man,
> #endif
> pages_per_node = max_t(uint32_t, pages_per_node,
> tbo->page_alignment);
> - num_nodes = DIV_ROUND_UP(PFN_UP(mem_bytes), pages_per_node);
> + num_nodes = DIV_ROUND_UP_ULL(PFN_UP(mem_bytes), pages_per_node);
> }
>
> node = kvmalloc(struct_size(node, mm_nodes, num_nodes),
> --
> 2.25.4
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/amdgpu: use correct rounding macro for 64-bit
2021-06-10 3:23 ` Alex Deucher
@ 2021-06-10 3:33 ` Dave Airlie
2021-06-10 3:37 ` Alex Deucher
0 siblings, 1 reply; 5+ messages in thread
From: Dave Airlie @ 2021-06-10 3:33 UTC (permalink / raw)
To: Alex Deucher
Cc: Deucher, Alexander, Christian Koenig,
Maling list - DRI developers
On Thu, 10 Jun 2021 at 13:23, Alex Deucher <alexdeucher@gmail.com> wrote:
>
> On Wed, Jun 9, 2021 at 11:10 PM Dave Airlie <airlied@gmail.com> wrote:
> >
> > From: Dave Airlie <airlied@redhat.com>
> >
> > This fixes 32-bit arm build due to lack of 64-bit divides.
> >
> > Fixes: cb1c81467af3 ("drm/ttm: flip the switch for driver allocated resources v2")
> > Signed-off-by: Dave Airlie <airlied@redhat.com>
>
> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
I'm going to apply this directly to next.
Dave.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/amdgpu: use correct rounding macro for 64-bit
2021-06-10 3:33 ` Dave Airlie
@ 2021-06-10 3:37 ` Alex Deucher
0 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2021-06-10 3:37 UTC (permalink / raw)
To: Dave Airlie
Cc: Deucher, Alexander, Christian Koenig,
Maling list - DRI developers
On Wed, Jun 9, 2021 at 11:33 PM Dave Airlie <airlied@gmail.com> wrote:
>
> On Thu, 10 Jun 2021 at 13:23, Alex Deucher <alexdeucher@gmail.com> wrote:
> >
> > On Wed, Jun 9, 2021 at 11:10 PM Dave Airlie <airlied@gmail.com> wrote:
> > >
> > > From: Dave Airlie <airlied@redhat.com>
> > >
> > > This fixes 32-bit arm build due to lack of 64-bit divides.
> > >
> > > Fixes: cb1c81467af3 ("drm/ttm: flip the switch for driver allocated resources v2")
> > > Signed-off-by: Dave Airlie <airlied@redhat.com>
> >
> > Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
>
> I'm going to apply this directly to next.
Thanks!
Alex
>
> Dave.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/amdgpu: use correct rounding macro for 64-bit
2021-06-10 3:03 [PATCH] drm/amdgpu: use correct rounding macro for 64-bit Dave Airlie
2021-06-10 3:23 ` Alex Deucher
@ 2021-06-10 6:55 ` Christian König
1 sibling, 0 replies; 5+ messages in thread
From: Christian König @ 2021-06-10 6:55 UTC (permalink / raw)
To: Dave Airlie, dri-devel; +Cc: alexander.deucher
Am 10.06.21 um 05:03 schrieb Dave Airlie:
> From: Dave Airlie <airlied@redhat.com>
>
> This fixes 32-bit arm build due to lack of 64-bit divides.
>
> Fixes: cb1c81467af3 ("drm/ttm: flip the switch for driver allocated resources v2")
> Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
I was already wondering why we suddenly have a 64bit division here, but
couldn't see it of hand.
Should I push that to drm-misc-next?
Thanks,
Christian.
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> index 9a6df02477ce..436ec246a7da 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> @@ -407,7 +407,7 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man,
> #endif
> pages_per_node = max_t(uint32_t, pages_per_node,
> tbo->page_alignment);
> - num_nodes = DIV_ROUND_UP(PFN_UP(mem_bytes), pages_per_node);
> + num_nodes = DIV_ROUND_UP_ULL(PFN_UP(mem_bytes), pages_per_node);
> }
>
> node = kvmalloc(struct_size(node, mm_nodes, num_nodes),
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-06-10 6:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-10 3:03 [PATCH] drm/amdgpu: use correct rounding macro for 64-bit Dave Airlie
2021-06-10 3:23 ` Alex Deucher
2021-06-10 3:33 ` Dave Airlie
2021-06-10 3:37 ` Alex Deucher
2021-06-10 6:55 ` Christian König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).