public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Juasheem Sultan <jdsultan@google.com>
To: intel-gfx@lists.freedesktop.org, intel_xe@lists.freedesktop.org
Cc: Jani Nikula <jani.nikula@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	 Manasi Navare <navaremanasi@google.com>,
	Drew Davenport <ddavenport@google.com>,
	Sean Paul <seanpaul@google.com>,
	Samuel Jacob <samjaco@google.com>,
	 Rajat Jain <rajatja@google.com>,
	Juasheem Sultan <jdsultan@google.com>
Subject: [RFC PATCH v3 1/2] drm/xe/display: Fix reading the framebuffer from stolen memory
Date: Wed, 21 Jan 2026 12:46:52 -0800	[thread overview]
Message-ID: <20260121204705.432290-2-jdsultan@google.com> (raw)
In-Reply-To: <20260121204705.432290-1-jdsultan@google.com>

Currently, we attempt to pin stolen memory using the ggtt address. This
doesn't appear to actually read the framebuffer that was setup by the
bios. Instead, we have to use the underlying physical address offset
within stolen memory.

Signed-off-by: Juasheem Sultan <jdsultan@google.com>
---
 drivers/gpu/drm/xe/display/xe_plane_initial.c | 22 ++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/display/xe_plane_initial.c b/drivers/gpu/drm/xe/display/xe_plane_initial.c
index 94f00def811b..2b84d0cc97e3 100644
--- a/drivers/gpu/drm/xe/display/xe_plane_initial.c
+++ b/drivers/gpu/drm/xe/display/xe_plane_initial.c
@@ -22,6 +22,7 @@
 #include "intel_plane.h"
 #include "intel_plane_initial.h"
 #include "xe_bo.h"
+#include "xe_ttm_stolen_mgr.h"
 #include "xe_vram_types.h"
 #include "xe_wa.h"
 
@@ -120,7 +121,26 @@ initial_plane_bo(struct xe_device *xe,
 
 		if (!stolen)
 			return NULL;
-		phys_base = base;
+
+		/* Read PTE to find physical address backing the GGTT address */
+		u64 pte = xe_ggtt_read_pte(tile0->mem.ggtt, base);
+		u64 phys_addr = pte & ~(page_size - 1);
+
+		u64 stolen_base = xe_ttm_stolen_gpu_offset(xe);
+
+		drm_dbg_kms(&xe->drm,
+			"Stolen Framebuffer base=%x pte=%llx phys_addr=%llx stolen_base=%llx\n",
+			 base, pte, phys_addr, stolen_base);
+
+		/* Make sure that the physical address is in the range of stolen memory */
+		if (phys_addr >= stolen_base) {
+			phys_base = phys_addr - stolen_base;
+		} else {
+			drm_err(&xe->drm, "Stolen memory outside of stolen range phys_base=%pa\n",
+				&phys_base);
+			return NULL;
+		}
+
 		flags |= XE_BO_FLAG_STOLEN;
 
 		if (XE_GT_WA(xe_root_mmio_gt(xe), 22019338487_display))
-- 
2.52.0.457.g6b5491de43-goog


  reply	other threads:[~2026-01-21 20:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-21 20:46 [RFC PATCH v3 0/2] Enable seamless boot (fastboot) for PTL Juasheem Sultan
2026-01-21 20:46 ` Juasheem Sultan [this message]
2026-01-21 20:46 ` [RFC PATCH v3 2/2] drm/i915/display: Synchronize crtc_state for initial commit Juasheem Sultan
2026-01-21 22:02   ` Manasi Navare
2026-01-22 15:29   ` Jani Nikula
2026-01-27  8:05     ` Juasheem Sultan
2026-02-03 18:18       ` Manasi Navare
2026-02-03 19:47         ` Jani Nikula
2026-02-03 21:03           ` Manasi Navare
2026-03-03  0:43             ` Manasi Navare
2026-03-03  9:44               ` Jani Nikula
2026-03-04  3:30                 ` Juasheem Sultan
2026-01-21 21:29 ` ✗ Fi.CI.BUILD: failure for Enable seamless boot (fastboot) for PTL 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=20260121204705.432290-2-jdsultan@google.com \
    --to=jdsultan@google.com \
    --cc=ddavenport@google.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel_xe@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=navaremanasi@google.com \
    --cc=rajatja@google.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=samjaco@google.com \
    --cc=seanpaul@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox