From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Eriksen Xie <xiaolu.xie@intel.com>
Cc: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
jani.nikula@linux.intel.com, rodrigo.vivi@intel.com
Subject: Re: [PATCH] drm/xe/display: Use the GGTT PTE to find the initial FB in stolen
Date: Mon, 16 Nov 2026 13:42:52 +0200 [thread overview]
Message-ID: <avrsPNzE2eEmz4VB@intel.com> (raw)
In-Reply-To: <20261116105303.1374969-1-xiaolu.xie@intel.com>
On Mon, Nov 16, 2026 at 06:53:03PM +0800, Eriksen Xie wrote:
> On integrated platforms initial_plane_bo() passes the GGTT address of
> the initial plane as is to xe_bo_create_pin_map_at_novm() as the offset
> into stolen. That is only correct if the BIOS maps stolen 1:1 into the
> GGTT.
>
> On Nova Lake the BIOS puts the initial FB at GGTT address 0xff800000
> instead. Its PTE (0x800003) points to the start of stolen memory (the
> stolen base is 0x800000), but using the GGTT address as the stolen
> offset is far beyond the 120 MiB of stolen, so the BO creation fails and
> the driver can't take over the BIOS FB:
>
> xe 0000:00:02.0: [drm:xe_alloc_initial_plane_obj [xe]] Failed to create bo phys_base=0x00000000ff800000 size 8294400 with flags 430: -12
>
> Get the physical address from the PTE and convert it to an offset into
> stolen, similarly to what is done for the dGPU case. Keep using the
> GGTT address if the PTE doesn't point into stolen.
>
> Tested on a Nova Lake platform: the BIOS FB is now taken over as the
> initial FB.
>
> Signed-off-by: Eriksen Xie <xiaolu.xie@intel.com>
> ---
> drivers/gpu/drm/xe/display/xe_initial_plane.c | 18 +++++++++++++++++-
> 1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/display/xe_initial_plane.c b/drivers/gpu/drm/xe/display/xe_initial_plane.c
> index 0f86b7303..f69532b3a 100644
> --- a/drivers/gpu/drm/xe/display/xe_initial_plane.c
> +++ b/drivers/gpu/drm/xe/display/xe_initial_plane.c
> @@ -85,7 +85,7 @@ initial_plane_bo(struct xe_device *xe,
> &phys_base);
> } else {
> struct ttm_resource_manager *stolen;
> - u64 pte;
> + u64 pte, pte_addr, stolen_base;
>
> stolen = ttm_manager_type(&xe->ttm, XE_PL_STOLEN);
> if (!stolen) {
> @@ -100,7 +100,23 @@ initial_plane_bo(struct xe_device *xe,
> return NULL;
> }
>
> + /*
> + * The plane surface is a GGTT address, which equals the offset
> + * into stolen only if the BIOS maps stolen 1:1 into the GGTT.
> + * Get the offset from the PTE instead, and fall back to the
> + * GGTT address if the PTE doesn't point into stolen.
> + */
> phys_base = base;
> + stolen_base = xe_ttm_stolen_gpu_offset(xe);
> + pte_addr = pte & XE_PAGE_ADDR_MASK(XE_PTE_SHIFT);
> + if (pte_addr >= stolen_base &&
> + pte_addr - stolen_base < (u64)stolen->size << PAGE_SHIFT)
> + phys_base = pte_addr - stolen_base;
> +
> + drm_dbg_kms(&xe->drm,
> + "Initial plane GGTT address 0x%x, PTE 0x%llx -> stolen offset %pa\n",
> + base, pte, &phys_base);
> +
I had an earlier series trying to fix all this up, but the super
dodgy xe ggtt framework got in the way and we got stuck in some
kind of limbo. I think this was the series
https://patchwork.freedesktop.org/series/166361/
The problem is that we can't bind the buffer into it's original high
GGTT address because the GuC code assumes it has sole ownership of
that, and rebinding it to a low address could partially overwrite
some of the currently live old PTEs with new incorrect addresses.
So to be completely correct we'd need the same trick that I added
into the i915 counterpart code, that is first reserve the range
for the old PTEs, then attempt the rebind. If the rebind succeeds
release the old PTEs once no longer needed, otherwise we have no
option but to bind to the original high address or just turn off
the whole plane.
> flags |= XE_BO_FLAG_STOLEN;
>
> if (IS_ENABLED(CONFIG_FRAMEBUFFER_CONSOLE) &&
> --
> 2.43.0
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2026-11-16 11:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 10:53 [PATCH] drm/xe/display: Use the GGTT PTE to find the initial FB in stolen Eriksen Xie
2026-11-16 11:26 ` sashiko-bot
2026-11-16 11:42 ` Ville Syrjälä [this message]
2026-11-16 12:31 ` Maarten Lankhorst
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=avrsPNzE2eEmz4VB@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=xiaolu.xie@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.