From: Dave Airlie Date: Thu, 10 Jun 2021 02:59:00 +0000 (+1000) Subject: drm/amdgpu: use correct rounding macro for 64-bit X-Git-Tag: v5.15~765^2~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=691cf8cd7a531dbfcc29d09a23c509a86fd9b24f;p=platform%2Fkernel%2Flinux-starfive.git drm/amdgpu: use correct rounding macro for 64-bit 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") Link: https://patchwork.freedesktop.org/patch/438442/ Reviewed-by: Alex Deucher Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c index 9a6df02..436ec24 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),