linux-next: manual merge of the drm-xe tree with the drm-misc tree

Mark Brown posted 1 patch 1 month, 3 weeks ago
linux-next: manual merge of the drm-xe tree with the drm-misc tree
Posted by Mark Brown 1 month, 3 weeks ago
Hi all,

Today's linux-next merge of the drm-xe tree got a conflict in:

  drivers/gpu/drm/xe/xe_ttm_vram_mgr.c

between commit:

  ba110db8e1bc2 ("gpu: Move DRM buddy allocator one level up (part two)")

from the drm-misc tree and commit:

  dc2fc00ba94de ("drm/xe: Use DRM_BUDDY_CONTIGUOUS_ALLOCATION for contiguous allocations")

from the drm-xe tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --cc drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
index 2c44aa4b5562b,d6aa61e55f4d7..0000000000000
--- a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
+++ b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
@@@ -80,10 -79,13 +80,13 @@@ static int xe_ttm_vram_mgr_new(struct t
  	INIT_LIST_HEAD(&vres->blocks);
  
  	if (place->flags & TTM_PL_FLAG_TOPDOWN)
 -		vres->flags |= DRM_BUDDY_TOPDOWN_ALLOCATION;
 +		vres->flags |= GPU_BUDDY_TOPDOWN_ALLOCATION;
  
+ 	if (place->flags & TTM_PL_FLAG_CONTIGUOUS)
+ 		vres->flags |= DRM_BUDDY_CONTIGUOUS_ALLOCATION;
+ 
  	if (place->fpfn || lpfn != man->size >> PAGE_SHIFT)
 -		vres->flags |= DRM_BUDDY_RANGE_ALLOCATION;
 +		vres->flags |= GPU_BUDDY_RANGE_ALLOCATION;
  
  	if (WARN_ON(!vres->base.size)) {
  		err = -EINVAL;
@@@ -111,15 -113,7 +114,7 @@@
  		goto error_unlock;
  	}
  
- 	if (place->fpfn + (size >> PAGE_SHIFT) != lpfn &&
- 	    place->flags & TTM_PL_FLAG_CONTIGUOUS) {
- 		size = roundup_pow_of_two(size);
- 		min_page_size = size;
- 
- 		lpfn = max_t(unsigned long, place->fpfn + (size >> PAGE_SHIFT), lpfn);
- 	}
- 
 -	err = drm_buddy_alloc_blocks(mm, (u64)place->fpfn << PAGE_SHIFT,
 +	err = gpu_buddy_alloc_blocks(mm, (u64)place->fpfn << PAGE_SHIFT,
  				     (u64)lpfn << PAGE_SHIFT, size,
  				     min_page_size, &vres->blocks, vres->flags);
  	if (err)
Re: linux-next: manual merge of the drm-xe tree with the drm-misc tree
Posted by Joel Fernandes 1 month, 3 weeks ago
On Feb 23, 2026, at 8:35 AM, Mark Brown <broonie@kernel.org> wrote:

Hi all,

Today's linux-next merge of the drm-xe tree got a conflict in:

 drivers/gpu/drm/xe/xe_ttm_vram_mgr.c

between commit:

 ba110db8e1bc2 ("gpu: Move DRM buddy allocator one level up (part two)")

from the drm-misc tree and commit:

 dc2fc00ba94de ("drm/xe: Use DRM_BUDDY_CONTIGUOUS_ALLOCATION for contiguous allocations")

Dave, this commit should also carry the rename?

Thanks,
Joel


from the drm-xe tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --cc drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
index 2c44aa4b5562b,d6aa61e55f4d7..0000000000000
--- a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
+++ b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
@@@ -80,10 -79,13 +80,13 @@@ static int xe_ttm_vram_mgr_new(struct t
     INIT_LIST_HEAD(&vres->blocks);

     if (place->flags & TTM_PL_FLAG_TOPDOWN)
-        vres->flags |= DRM_BUDDY_TOPDOWN_ALLOCATION;
+        vres->flags |= GPU_BUDDY_TOPDOWN_ALLOCATION;

+    if (place->flags & TTM_PL_FLAG_CONTIGUOUS)
+        vres->flags |= DRM_BUDDY_CONTIGUOUS_ALLOCATION;
+
     if (place->fpfn || lpfn != man->size >> PAGE_SHIFT)
-        vres->flags |= DRM_BUDDY_RANGE_ALLOCATION;
+        vres->flags |= GPU_BUDDY_RANGE_ALLOCATION;

     if (WARN_ON(!vres->base.size)) {
         err = -EINVAL;
@@@ -111,15 -113,7 +114,7 @@@
         goto error_unlock;
     }

-    if (place->fpfn + (size >> PAGE_SHIFT) != lpfn &&
-        place->flags & TTM_PL_FLAG_CONTIGUOUS) {
-        size = roundup_pow_of_two(size);
-        min_page_size = size;
-
-        lpfn = max_t(unsigned long, place->fpfn + (size >> PAGE_SHIFT), lpfn);
-    }
-
-    err = drm_buddy_alloc_blocks(mm, (u64)place->fpfn << PAGE_SHIFT,
+    err = gpu_buddy_alloc_blocks(mm, (u64)place->fpfn << PAGE_SHIFT,
                      (u64)lpfn << PAGE_SHIFT, size,
                      min_page_size, &vres->blocks, vres->flags);
     if (err)
-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmmcV5EACgkQJNaLcl1U
h9BKygf7BHi5DF86Mxf9Wn54wFbPY39BwlSmtne56jkgm7VmiH3OJey2gGaGfp92
ce8ASM6ob7U91+a485LAkvh54Uzoa7hg5EWXXqtT8dzeeBXA14kUHmRtqEWO/c9K
pRa9fntFCd7hDZt9wD8eN5TCVK/nfcO2cVNiPTa7NYAa0hHUT2kNktxZssCBD+ai
mzqGwTdy4sgak6wDyVQ4Eae/8Ii8NXOyt+8nBefXfS7AnRYJwJIL3UhP8jyGPlJz
+9Xm22e8waSnlXke5DtY3T2S1VGsRs4o0wmvln1sdVSCUGYoamkzGIexfhAy2Tyt
lT/h+6rgZJpqYSENGCVfpwNAb09VMg==
=jQQA
-----END PGP SIGNATURE-----