All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Eriksen Xie" <xiaolu.xie@intel.com>,
	intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/xe/display: Use the GGTT PTE to find the initial FB in stolen
Date: Mon, 16 Nov 2026 11:26:32 +0000	[thread overview]
Message-ID: <sashiko-outbox-216920@kernel.org> (raw)
In-Reply-To: <20261116105303.1374969-1-xiaolu.xie@intel.com>

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

  reply	other threads:[~2026-11-16 11:26 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 [this message]
2026-11-16 11:42 ` Ville Syrjälä
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=sashiko-outbox-216920@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --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.