]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amdgpu: use correct rounding macro for 64-bit
authorDave Airlie <airlied@redhat.com>
Thu, 10 Jun 2021 02:59:00 +0000 (12:59 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 10 Jun 2021 03:34:08 +0000 (13:34 +1000)
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 <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c

index 9a6df02477ceaff74d69fb52e3a265818846f77a..436ec246a7daccded3a7f0943a4db29152feaca7 100644 (file)
@@ -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),