Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 96950929eb23 ("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

authored by

Arunpravin Paneer Selvam and committed by
Dave Airlie
5a5a10d9 431c590c

+3 -3
+3 -3
drivers/gpu/drm/drm_buddy.c
··· 524 524 continue; 525 525 } 526 526 527 + if (!fallback && block_incompatible(block, flags)) 528 + continue; 529 + 527 530 if (contains(start, end, block_start, block_end) && 528 531 order == drm_buddy_block_order(block)) { 529 - if (!fallback && block_incompatible(block, flags)) 530 - continue; 531 - 532 532 /* 533 533 * Find the free block within the range. 534 534 */