[PATCH v3.1] drm/xe: Simplify GuC early initialization

Lucas De Marchi lucas.demarchi at intel.com
Wed Jun 18 19:28:16 UTC 2025


On Wed, Jun 18, 2025 at 11:44:37AM +0200, Maarten Lankhorst wrote:
>Add a 2-stage GuC init. An early one for everything that is needed
>for VF, and a full one that loads GuC and is allowed to do allocations.
>
>Signed-off-by: Maarten Lankhorst <dev at lankhorst.se>
>---
>Changes since v3:
>- keep xe_guc_relay_init() to allow full IGT to pass.
>
> drivers/gpu/drm/xe/xe_device.c | 17 ------------
> drivers/gpu/drm/xe/xe_gt.c     |  9 +++++-
> drivers/gpu/drm/xe/xe_guc.c    | 51 +++++++++++++++++++++-------------
> drivers/gpu/drm/xe/xe_guc.h    |  1 +
> drivers/gpu/drm/xe/xe_guc_ct.c | 28 ++++++++++++-------
> drivers/gpu/drm/xe/xe_guc_ct.h |  1 +
> drivers/gpu/drm/xe/xe_uc.c     | 16 +++++++++++
> drivers/gpu/drm/xe/xe_uc.h     |  1 +
> 8 files changed, 77 insertions(+), 47 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
>index 03825cc214085..ead538029b128 100644
>--- a/drivers/gpu/drm/xe/xe_device.c
>+++ b/drivers/gpu/drm/xe/xe_device.c
>@@ -793,23 +793,6 @@ int xe_device_probe(struct xe_device *xe)
> 		err = xe_gt_init_early(gt);
> 		if (err)
> 			return err;
>-
>-		/*
>-		 * Only after this point can GT-specific MMIO operations
>-		 * (including things like communication with the GuC)
>-		 * be performed.
>-		 */
>-		xe_gt_mmio_init(gt);
>-
>-		if (IS_SRIOV_VF(xe)) {
>-			xe_guc_comm_init_early(&gt->uc.guc);
>-			err = xe_gt_sriov_vf_bootstrap(gt);
>-			if (err)
>-				return err;
>-			err = xe_gt_sriov_vf_query_config(gt);
>-			if (err)
>-				return err;

are these supposed to be squashed in the previous patch?

...

>diff --git a/drivers/gpu/drm/xe/xe_uc.h b/drivers/gpu/drm/xe/xe_uc.h
>index c23e6f5e25141..b573b7731f62e 100644
>--- a/drivers/gpu/drm/xe/xe_uc.h
>+++ b/drivers/gpu/drm/xe/xe_uc.h
>@@ -8,6 +8,7 @@
>
> struct xe_uc;
>
>+int xe_uc_init_noalloc(struct xe_uc *uc);
> int xe_uc_init(struct xe_uc *uc);
> int xe_uc_init_hwconfig(struct xe_uc *uc);
> int xe_uc_init_post_hwconfig(struct xe_uc *uc);

quite not happy with these multiple init. IMO we are exposing too much
from guc to be handled from the main device probe function.

I think that if we eventually balance it with not doing a double guc
load it would be good

Lucas De Marchi

>-- 
>2.45.2
>


More information about the Intel-xe mailing list