All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Maarten Lankhorst <dev@lankhorst.se>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v4 4/6] drm/xe/display: Use the correct calculation for phys_base on integrated
Date: Wed, 18 Nov 2026 22:32:04 +0200	[thread overview]
Message-ID: <av4LRFZZXU2zmd73@intel.com> (raw)
In-Reply-To: <20261116122828.266113-12-dev@lankhorst.se>

On Mon, Nov 16, 2026 at 01:28:33PM +0100, Maarten Lankhorst wrote:
> The code originally assumed there was a 1:1 mapping between
> stolen and GGTT offset. This is no longer true as of MTL, so
> perform the correct calculations, similar to how they're
> performed for the DGFX case.
> 
> Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
> ---
>  drivers/gpu/drm/xe/display/xe_initial_plane.c | 2 +-
>  1 file changed, 1 insertion(+), 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 a100ad23be2a0..451c24a4ed8d5 100644
> --- a/drivers/gpu/drm/xe/display/xe_initial_plane.c
> +++ b/drivers/gpu/drm/xe/display/xe_initial_plane.c
> @@ -101,7 +101,7 @@ initial_plane_bo(struct xe_device *xe,
>  			return NULL;
>  		}
>  
> -		phys_base = base;
> +		phys_base = (pte & ~(page_size - 1)) - xe_ttm_stolen_gpu_offset(xe);

Do we have anything guarding against a bogus dma address in the PTE?

In the i915 code I'm doing this:

if (dma_addr < mem->region.start || dma_addr > mem->region.end)
	-> bail
*out_phys_base = dma_addr - mem->region.start;

The end check is perhaps redundant because we will anyway fail later
if the whole thing doesn't fit inside the appointed memory region.
On the other hand, I think making sure it's at least partially in
there is a decent sanity check to do before going any further.

i915 also consistently logs all the information: the dma address,
the resulting phys_base, and the name of the memory region.
Having all that information at hand could help with debugging,
so I think the xe code should do the same.

>  		flags |= XE_BO_FLAG_STOLEN;
>  
>  		if (IS_ENABLED(CONFIG_FRAMEBUFFER_CONSOLE) &&
> -- 
> 2.55.0

-- 
Ville Syrjälä
Intel

  parent reply	other threads:[~2026-11-18 20:32 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 12:28 [PATCH v4 0/6] drm/xe: More BIOS FB takeover fixes Maarten Lankhorst
2026-11-16 12:28 ` [PATCH v4 1/6] drm/xe/ggtt: Add xe_ggtt_reserve_area Maarten Lankhorst
2026-11-16 12:38   ` sashiko-bot
2026-11-18 20:09   ` Ville Syrjälä
2026-11-19 11:59     ` Maarten Lankhorst
2026-11-19 13:48       ` Ville Syrjälä
2026-11-19 15:47         ` Maarten Lankhorst
2026-11-19 16:27           ` Ville Syrjälä
2026-11-16 12:28 ` [PATCH v4 2/6] drm/xe/ggtt: Add xe_ggtt_node_remove_noclear Maarten Lankhorst
2026-11-16 12:28 ` [PATCH v4 3/6] drm/xe/display: Reserve the original GGTT space before creating a bo Maarten Lankhorst
2026-11-18 20:38   ` Ville Syrjälä
2026-11-16 12:28 ` [PATCH v4 4/6] drm/xe/display: Use the correct calculation for phys_base on integrated Maarten Lankhorst
2026-11-16 12:49   ` sashiko-bot
2026-11-18 20:32   ` Ville Syrjälä [this message]
2026-11-19 11:31     ` Maarten Lankhorst
2026-11-16 12:28 ` [PATCH v4 5/6] drm/xe/display: Remove duplicated code Maarten Lankhorst
2026-11-16 12:56   ` sashiko-bot
2026-11-18 20:14     ` Ville Syrjälä
2026-11-16 12:28 ` [PATCH v4 6/6] drm/xe/ggtt: Remove xe_ggtt_insert_bo_at Maarten Lankhorst
2026-11-18 20:13   ` Ville Syrjälä
2026-11-16 14:40 ` ✗ CI.checkpatch: warning for drm/xe: More BIOS FB takeover fixes (rev5) Patchwork
2026-11-16 14:43 ` ✓ CI.KUnit: success " Patchwork
2026-11-16 15:17 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-16 23:16 ` ✗ Xe.CI.FULL: failure " 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=av4LRFZZXU2zmd73@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dev@lankhorst.se \
    --cc=intel-xe@lists.freedesktop.org \
    /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.