From: Matthew Auld <matthew.auld@intel.com>
To: Sanjay Yadav <sanjay.kumar.yadav@intel.com>,
intel-xe@lists.freedesktop.org
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Matthew Brost <matthew.brost@intel.com>,
Vinod Govindapillai <vinod.govindapillai@intel.com>
Subject: Re: [PATCH v4] drm/xe: Convert stolen memory over to ttm_range_manager
Date: Wed, 22 Apr 2026 14:41:20 +0100 [thread overview]
Message-ID: <4a44667f-d2f8-40af-a67f-12adb56ac8ad@intel.com> (raw)
In-Reply-To: <20260422125502.3088222-2-sanjay.kumar.yadav@intel.com>
On 22/04/2026 13:55, Sanjay Yadav wrote:
> Stolen memory requires physically contiguous allocations for display
> scanout and compressed framebuffers. The stolen memory manager was
> sharing the gpu_buddy allocator backend with the VRAM manager, but
> buddy manages non-contiguous power-of-two blocks making it a poor fit.
> Stolen memory also has fundamentally different allocation patterns:
>
> - Allocation sizes are not power-of-two. Since buddy rounds up to the
> next power-of-two block size, a ~17MB request can fail even with
> ~22MB free, because the free space is fragmented across non-fitting
> power-of-two blocks.
> - Hardware restrictions prevent using the first 4K page of stolen for
> certain allocations (e.g., FBC). The display code sets fpfn=1 to
> enforce this, but when fpfn != 0, gpu_buddy enables
> GPU_BUDDY_RANGE_ALLOCATION mode which disables the try_harder
> coalescing path, further reducing allocation success.
>
> This combination caused FBC compressed framebuffer (CFB) allocation
> failures on platforms like NVL/PTL. In case of NVL where stolen memory
> is ~56MB and the initial plane framebuffer consumes ~34MB at probe time,
> leaving ~22MB for subsequent allocations.
>
> Use ttm_range_man_init_nocheck() to set up a drm_mm-backed TTM resource
> manager for stolen memory. This reuses the TTM core's ttm_range_manager
> callbacks, avoiding duplicate implementations.
>
> Tested on NVL with a 4K DP display: stolen_mm shows a single ~22MB
> contiguous free hole after initial plane framebuffer allocation, and
> FBC successfully allocates its CFB from that region. The corresponding
> IGT was previously skipped and now passes.
>
> v2:
> - Clarify that stolen memory requires contiguous allocations (Matt B)
> - Properly handle xe_ttm_resource_visible() for stolen instead of
> unconditionally returning true (Matt A)
>
> v3:
> - Rebase
> - Fix xe_display_bo_fbdev_prefer_stolen() to compare in pages, since
> ttm_range_manager stores stolen->size in pages not bytes (Matt A)
>
> v4:
> - Add kernel-doc for struct xe_ttm_stolen_mgr (Matt B)
>
> Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/work_items/7631
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com>
> Suggested-by: Matthew Auld <matthew.auld@intel.com>
> Assisted-by: GitHub Copilot:claude-sonnet-4.6
> Signed-off-by: Sanjay Yadav <sanjay.kumar.yadav@intel.com>
> Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Acked-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
next prev parent reply other threads:[~2026-04-22 13:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-22 12:55 [PATCH v4] drm/xe: Convert stolen memory over to ttm_range_manager Sanjay Yadav
2026-04-22 13:15 ` ✗ CI.checkpatch: warning for drm/xe: Convert stolen memory over to ttm_range_manager (rev4) Patchwork
2026-04-22 13:16 ` ✓ CI.KUnit: success " Patchwork
2026-04-22 13:41 ` Matthew Auld [this message]
2026-04-22 14:33 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-23 6:30 ` ✓ Xe.CI.FULL: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4a44667f-d2f8-40af-a67f-12adb56ac8ad@intel.com \
--to=matthew.auld@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matthew.brost@intel.com \
--cc=sanjay.kumar.yadav@intel.com \
--cc=vinod.govindapillai@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox