* [PATCH] drm/xe/display: Use the GGTT PTE to find the initial FB in stolen
@ 2026-11-16 10:53 Eriksen Xie
2026-11-16 11:26 ` sashiko-bot
2026-11-16 11:42 ` Ville Syrjälä
0 siblings, 2 replies; 4+ messages in thread
From: Eriksen Xie @ 2026-11-16 10:53 UTC (permalink / raw)
To: intel-xe, intel-gfx; +Cc: jani.nikula, rodrigo.vivi, ville.syrjala, Eriksen Xie
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);
+
flags |= XE_BO_FLAG_STOLEN;
if (IS_ENABLED(CONFIG_FRAMEBUFFER_CONSOLE) &&
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/xe/display: Use the GGTT PTE to find the initial FB in stolen
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ä
1 sibling, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-11-16 11:26 UTC (permalink / raw)
To: Eriksen Xie, intel-xe, intel-gfx
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] drm/xe/display: invalid fallback to GGTT offset in
initial_plane_bo()
- [Low] drm/xe/display: missing Fixes trailer for initial_plane_bo()
stolen fix
--
commit ed0b0b266d1c0a44fa0b64d4c8d1de936bec8937
Author: Eriksen Xie <xiaolu.xie@intel.com>
> drm/xe/display: Use the GGTT PTE to find the initial FB in stolen
>
> 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>
[Severity: Low]
This fixes a bug in initial_plane_bo() when taking over the initial
framebuffer in stolen memory. Should this include:
Fixes: 44e694958b95 ("drm/xe/display: Implement display support")
> diff --git a/drivers/gpu/drm/xe/display/xe_initial_plane.c b/drivers/gpu/drm/xe/display/xe_initial_plane.c
> index 0f86b73036d03..f69532b3aa94c 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;
[Severity: Medium]
Should initial_plane_bo() return NULL instead of falling back to
phys_base = base when pte_addr is outside the usable stolen range?
GGTT PTEs pointing into stolen memory always encode stolen_base + offset,
even when the BIOS maps stolen 1:1 into the GGTT. If pte_addr is outside
[stolen_base, stolen_base + (stolen->size << PAGE_SHIFT)) — for instance,
when the BIOS places the initial framebuffer in system memory on pre-MTL
or in a reserved DSM carveout — the initial framebuffer is not in usable
stolen memory at all. Falling back to phys_base = base while keeping
XE_BO_FLAG_STOLEN causes xe_bo_create_pin_map_at_novm() to allocate
unrelated stolen memory at stolen_base + base whenever base fits within
stolen->size, and the display will scan out from that uninitialized memory
instead of discarding the initial FB like the IS_DGFX(xe) branch and
i915's initial_plane_phys() do.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261116105303.1374969-1-xiaolu.xie@intel.com?part=1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/xe/display: Use the GGTT PTE to find the initial FB in stolen
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ä
2026-11-16 12:31 ` Maarten Lankhorst
1 sibling, 1 reply; 4+ messages in thread
From: Ville Syrjälä @ 2026-11-16 11:42 UTC (permalink / raw)
To: Eriksen Xie; +Cc: intel-xe, intel-gfx, jani.nikula, rodrigo.vivi
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/xe/display: Use the GGTT PTE to find the initial FB in stolen
2026-11-16 11:42 ` Ville Syrjälä
@ 2026-11-16 12:31 ` Maarten Lankhorst
0 siblings, 0 replies; 4+ messages in thread
From: Maarten Lankhorst @ 2026-11-16 12:31 UTC (permalink / raw)
To: Ville Syrjälä, Eriksen Xie
Cc: intel-xe, intel-gfx, jani.nikula, rodrigo.vivi
Hey,
On 11/16/26 12:42, Ville Syrjälä wrote:
> 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.Part of that serires was merged, but the part that actually fixes
GGTT and DPT access was not.
I reposted the series I had that fixes it:
https://patchwork.freedesktop.org/series/170430/
Can you review it so that it can be merged?
Kind regards,
~Maarten Lankhorst
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-16 12:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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ä
2026-11-16 12:31 ` Maarten Lankhorst
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.