drm/buddy: Fix the warn on's during force merge

Move the fallback and block incompatible checks
above, so that we dont unnecessarily split the blocks
and leaving the unmerged. This resolves the unnecessary
warn on's thrown during force_merge call.

v2:(Matthew)
  - Move the fallback and block incompatible checks above
    the contains check.

Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Fixes: 96950929eb ("drm/buddy: Implement tracking clear page feature")
Link: https://patchwork.kernel.org/project/dri-devel/patch/20240517135015.17565-1-Arunpravin.PaneerSelvam@amd.com/
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240517143305.17894-1-Arunpravin.PaneerSelvam@amd.com
This commit is contained in:
Arunpravin Paneer Selvam 2024-05-17 20:03:05 +05:30 committed by Dave Airlie
parent 431c590c3a
commit 5a5a10d9db

View File

@ -524,11 +524,11 @@ __alloc_range_bias(struct drm_buddy *mm,
continue;
}
if (!fallback && block_incompatible(block, flags))
continue;
if (contains(start, end, block_start, block_end) &&
order == drm_buddy_block_order(block)) {
if (!fallback && block_incompatible(block, flags))
continue;
/*
* Find the free block within the range.
*/