]> Git Repo - J-linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
Merge patch series "RISC-V kasan rework"
[J-linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_vram_mgr.c
index 9fa1d814508a6cd42e31f3f0fa8b0150835af548..43d6a9d6a5384f886b4460a539bb97450cf1a0e2 100644 (file)
@@ -453,7 +453,8 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man,
                /* Limit maximum size to 2GiB due to SG table limitations */
                size = min(remaining_size, 2ULL << 30);
 
-               if (size >= (u64)pages_per_block << PAGE_SHIFT)
+               if ((size >= (u64)pages_per_block << PAGE_SHIFT) &&
+                               !(size & (((u64)pages_per_block << PAGE_SHIFT) - 1)))
                        min_block_size = (u64)pages_per_block << PAGE_SHIFT;
 
                cur_size = size;
This page took 0.027488 seconds and 4 git commands to generate.