From 1be929d430b5127916fea059d5fa0467f1535175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Tue, 12 May 2026 00:41:17 +0300 Subject: [PATCH] drm/xe: Abstract the initial FB PTE checks a bit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ä Reviewed-by: Jani Nikula Link: https://patch.msgid.link/20260511214122.8468-10-ville.syrjala@linux.intel.com Signed-off-by: Maarten Lankhorst Acked-by: Matthew Brost #teams --- 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 a62e5394c3f7..1e1962c95589 100644 --- a/drivers/gpu/drm/xe/display/xe_initial_plane.c +++ b/drivers/gpu/drm/xe/display/xe_initial_plane.c @@ -19,8 +19,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) @@ -44,13 +55,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; } phys_base = pte & ~(page_size - 1); + flags |= XE_BO_FLAG_VRAM0; /*