Intel-XE Archive on 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-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 09/14] drm/xe: Abstract the initial FB PTE checks a bit
Date: Mon, 18 May 2026 16:46:30 +0300	[thread overview]
Message-ID: <agsYNq7xz0Agp3-U@intel.com> (raw)
In-Reply-To: <54bd10bc-84e2-45ad-9df9-cefe91dcf208@lankhorst.se>

On Mon, May 18, 2026 at 10:15:10AM +0200, Maarten Lankhorst wrote:
> Hey Ville,
> 
> Den 2026-05-11 kl. 23:41, skrev Ville Syrjala:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Add a few helpers that allow us to abstract the xe initial FB PTE
> > check a bit. Still very ad-hoc compared to the nicely abstracted
> > i915 counterpart, but whatever.
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/xe/display/xe_initial_plane.c | 17 ++++++++++++++---
> >  1 file changed, 14 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/xe/display/xe_initial_plane.c b/drivers/gpu/drm/xe/display/xe_initial_plane.c
> > index b7e0685351bb..0dabc5709d01 100644
> > --- a/drivers/gpu/drm/xe/display/xe_initial_plane.c
> > +++ b/drivers/gpu/drm/xe/display/xe_initial_plane.c
> > @@ -18,8 +18,19 @@
> >  #include "xe_fb_pin.h"
> >  #include "xe_ggtt.h"
> >  #include "xe_mmio.h"
> > +#include "xe_ttm_stolen_mgr.h"
> >  #include "xe_vram_types.h"
> >  
> > +static bool is_pte_local(u64 pte)
> > +{
> > +	return pte & XE_GGTT_PTE_DM;
> > +}
> > +
> > +static bool need_pte_local(struct xe_device *xe)
> > +{
> > +	return IS_DGFX(xe);
> > +}
> > +
> >  static struct xe_bo *
> >  initial_plane_bo(struct xe_device *xe,
> >  		 struct intel_initial_plane_config *plane_config)
> > @@ -43,13 +54,13 @@ initial_plane_bo(struct xe_device *xe,
> >  	if (IS_DGFX(xe)) {
> >  		u64 pte = xe_ggtt_read_pte(tile0->mem.ggtt, base);
> >  
> > -		if (!(pte & XE_GGTT_PTE_DM)) {
> > -			drm_err(&xe->drm,
> > -				"Initial plane programming missing DM bit\n");
> > +		if (is_pte_local(pte) != need_pte_local(xe)) {
> > +			drm_err(&xe->drm, "Initial plane PTE has bad local memory bit\n");
> >  			return NULL;
> >  		}
> This is unnecessary, this is already inside the IS_DGFX branch, so all you're doing is checking twice.
> Remove need_pte_local and use the has_lmembar() check directly in the next patch?

The point is to abstract this mess to look a bit more like the clean
version in i915. Ideally I'd like to end up with a single codepath like
in i915, but xe doesn't seem to have anything like intel_mem_region
so it's a bit hard to achieve right now :(

> 
> >  		phys_base = pte & ~(page_size - 1);
> > +
> >  		flags |= XE_BO_FLAG_VRAM0;
> >  
> >  		/*
> Extra newline.
> 
> Kind regards,
> ~Maarten Lankhorst

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2026-05-18 13:46 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-11 21:41 [PATCH 00/14] drm/{i915,xe}: BIOS FB takeover fixes Ville Syrjala
2026-05-11 21:41 ` [PATCH 01/14] drm/i915: Disable the plane if initial plane config readout failed Ville Syrjala
2026-05-12 10:25   ` Jani Nikula
2026-05-11 21:41 ` [PATCH 02/14] drm/i915/fbdev: Extract bios_fb_ok() Ville Syrjala
2026-05-12 10:29   ` Jani Nikula
2026-05-11 21:41 ` [PATCH 03/14] drm/i915: Throw away the BIOS fb if has the wrong depth/bpp Ville Syrjala
2026-05-12 10:33   ` Jani Nikula
2026-05-11 21:41 ` [PATCH 04/14] drm/i915: Introduce intel_bo_fbdev_bios_fb_ok() Ville Syrjala
2026-05-11 21:41 ` [PATCH 05/14] drm/i915: Use drm_dbg_kms() for initial FB debugs Ville Syrjala
2026-05-12 10:40   ` Jani Nikula
2026-05-11 21:41 ` [PATCH 06/14] drm/xe: Do the initial FB size alignment earlier Ville Syrjala
2026-05-11 21:41 ` [PATCH 07/14] drm/xe/ggtt: Decouple lmem/stolen physcial offset from GGTT offset Ville Syrjala
2026-05-11 21:41 ` [PATCH 08/14] drm/xe: Print a debug message if we have no stolen for the initial FB Ville Syrjala
2026-05-12 10:45   ` Jani Nikula
2026-05-11 21:41 ` [PATCH 09/14] drm/xe: Abstract the initial FB PTE checks a bit Ville Syrjala
2026-05-12 10:48   ` Jani Nikula
2026-05-18  8:15   ` Maarten Lankhorst
2026-05-18 13:46     ` Ville Syrjälä [this message]
2026-05-11 21:41 ` [PATCH 10/14] drm/xe: Check the PTE local memory bit for initial FB in stolen Ville Syrjala
2026-05-11 21:41 ` [PATCH 11/14] drm/xe: s/bar2/lmembar/ Ville Syrjala
2026-05-12 10:49   ` Jani Nikula
2026-05-11 21:41 ` [PATCH 12/14] drm/xe: Use the correct stolen offset in initial FB readout Ville Syrjala
2026-05-18  9:27   ` Maarten Lankhorst
2026-05-18 13:59     ` Ville Syrjälä
2026-05-18 20:16       ` Maarten Lankhorst
2026-05-19 12:26         ` Ville Syrjälä
2026-05-19 14:23           ` Jani Nikula
2026-05-11 21:41 ` [PATCH 13/14] drm/i915: Fix BIOS FB memory region name debug prints Ville Syrjala
2026-05-11 21:41 ` [PATCH 14/14] drm/i915: Print the phys_base in addition to the dma_addr for the BIOS FB Ville Syrjala
2026-05-12  9:02 ` ✓ CI.KUnit: success for drm/{i915,xe}: BIOS FB takeover fixes Patchwork
2026-05-12 10:12 ` ✓ Xe.CI.BAT: " Patchwork
2026-05-12 18:47 ` ✗ 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=agsYNq7xz0Agp3-U@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dev@lankhorst.se \
    --cc=intel-gfx@lists.freedesktop.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox