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ä <[email protected]> > > > > 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ä <[email protected]> > > --- > > 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
