[PATCH v2 1/2] drm/xe: Rename wait_for_lmem_ready and make it non-static

Karthik Poosa karthik.poosa at intel.com
Thu May 8 09:08:15 UTC 2025


Rename wait_for_lmem_ready to wait_for_vram_ready.
Convert it to non-static to enable calls from other functions.

v2:
 - Add xe_device_ prefix to wait_for_vram_ready. (Anshuman, Riana)
 - Rename verify_lmem_ready to verify_vram_ready.
 - Replace mentions of lmem to vram in xe_device.c.

Signed-off-by: Karthik Poosa <karthik.poosa at intel.com>
---
 drivers/gpu/drm/xe/xe_device.c | 18 +++++++++---------
 drivers/gpu/drm/xe/xe_device.h |  1 +
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index c02c4c4e9412..6d130a6dcba2 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -624,14 +624,14 @@ static int xe_set_dma_info(struct xe_device *xe)
 	return err;
 }
 
-static bool verify_lmem_ready(struct xe_device *xe)
+static bool verify_vram_ready(struct xe_device *xe)
 {
 	u32 val = xe_mmio_read32(xe_root_tile_mmio(xe), GU_CNTL) & LMEM_INIT;
 
 	return !!val;
 }
 
-static int wait_for_lmem_ready(struct xe_device *xe)
+int xe_device_wait_for_vram_ready(struct xe_device *xe)
 {
 	unsigned long timeout, start;
 
@@ -641,10 +641,10 @@ static int wait_for_lmem_ready(struct xe_device *xe)
 	if (IS_SRIOV_VF(xe))
 		return 0;
 
-	if (verify_lmem_ready(xe))
+	if (verify_vram_ready(xe))
 		return 0;
 
-	drm_dbg(&xe->drm, "Waiting for lmem initialization\n");
+	drm_dbg(&xe->drm, "Waiting for vram initialization\n");
 
 	start = jiffies;
 	timeout = start + secs_to_jiffies(60); /* 60 sec! */
@@ -664,20 +664,20 @@ static int wait_for_lmem_ready(struct xe_device *xe)
 		 * use a timeout and defer the probe to prevent this.
 		 */
 		if (time_after(jiffies, timeout)) {
-			drm_dbg(&xe->drm, "lmem not initialized by firmware\n");
+			drm_dbg(&xe->drm, "vram not initialized by firmware\n");
 			return -EPROBE_DEFER;
 		}
 
 		msleep(20);
 
-	} while (!verify_lmem_ready(xe));
+	} while (!verify_vram_ready(xe));
 
-	drm_dbg(&xe->drm, "lmem ready after %ums",
+	drm_dbg(&xe->drm, "vram ready after %ums",
 		jiffies_to_msecs(jiffies - start));
 
 	return 0;
 }
-ALLOW_ERROR_INJECTION(wait_for_lmem_ready, ERRNO); /* See xe_pci_probe() */
+ALLOW_ERROR_INJECTION(xe_device_wait_for_vram_ready, ERRNO); /* See xe_pci_probe() */
 
 static void sriov_update_device_info(struct xe_device *xe)
 {
@@ -728,7 +728,7 @@ int xe_device_probe_early(struct xe_device *xe)
 		return save_err;
 	}
 
-	err = wait_for_lmem_ready(xe);
+	err = xe_device_wait_for_vram_ready(xe);
 	if (err)
 		return err;
 
diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
index 0bc3bc8e6803..0e807748287d 100644
--- a/drivers/gpu/drm/xe/xe_device.h
+++ b/drivers/gpu/drm/xe/xe_device.h
@@ -47,6 +47,7 @@ int xe_device_probe_early(struct xe_device *xe);
 int xe_device_probe(struct xe_device *xe);
 void xe_device_remove(struct xe_device *xe);
 void xe_device_shutdown(struct xe_device *xe);
+int xe_device_wait_for_vram_ready(struct xe_device *xe);
 
 void xe_device_wmb(struct xe_device *xe);
 
-- 
2.25.1



More information about the Intel-xe mailing list