Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/guc: Move ADS BO realloc to xe_guc_ads code
@ 2025-09-05 14:35 Michal Wajdeczko
  2025-09-05 14:42 ` ✓ CI.KUnit: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Michal Wajdeczko @ 2025-09-05 14:35 UTC (permalink / raw)
  To: intel-xe; +Cc: Michal Wajdeczko, Matthew Brost

We already have dedicated GuC ADS function that is called during
the post_hwconfig step. Move ADS BO reallocation there to have all
of ADS BO management together. Note that since any BO reinit must
be done prior to the point where we prepare GuC boot params, as
those include BO offsets, we have to move up call to ADS function.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/xe/xe_guc.c     | 10 +++++-----
 drivers/gpu/drm/xe/xe_guc_ads.c |  8 ++++++++
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
index b3a6408a5760..a62c483c9d88 100644
--- a/drivers/gpu/drm/xe/xe_guc.c
+++ b/drivers/gpu/drm/xe/xe_guc.c
@@ -705,10 +705,6 @@ static int xe_guc_realloc_post_hwconfig(struct xe_guc *guc)
 	if (ret)
 		return ret;
 
-	ret = xe_managed_bo_reinit_in_vram(xe, tile, &guc->ads.bo);
-	if (ret)
-		return ret;
-
 	return 0;
 }
 
@@ -847,6 +843,10 @@ int xe_guc_init_post_hwconfig(struct xe_guc *guc)
 	if (ret)
 		return ret;
 
+	ret = xe_guc_ads_init_post_hwconfig(&guc->ads);
+	if (ret)
+		return ret;
+
 	guc_init_params_post_hwconfig(guc);
 
 	ret = xe_guc_submit_init(guc, ~0);
@@ -869,7 +869,7 @@ int xe_guc_init_post_hwconfig(struct xe_guc *guc)
 	if (ret)
 		return ret;
 
-	return xe_guc_ads_init_post_hwconfig(&guc->ads);
+	return 0;
 }
 
 int xe_guc_post_load_init(struct xe_guc *guc)
diff --git a/drivers/gpu/drm/xe/xe_guc_ads.c b/drivers/gpu/drm/xe/xe_guc_ads.c
index 5631722f34f5..fc2c37ca9dbc 100644
--- a/drivers/gpu/drm/xe/xe_guc_ads.c
+++ b/drivers/gpu/drm/xe/xe_guc_ads.c
@@ -424,11 +424,19 @@ ALLOW_ERROR_INJECTION(xe_guc_ads_init, ERRNO); /* See xe_pci_probe() */
  */
 int xe_guc_ads_init_post_hwconfig(struct xe_guc_ads *ads)
 {
+	struct xe_device *xe = ads_to_xe(ads);
 	struct xe_gt *gt = ads_to_gt(ads);
 	u32 prev_regset_size = ads->regset_size;
+	int ret;
 
 	xe_gt_assert(gt, ads->bo);
 
+	if (IS_DGFX(xe)) {
+		ret = xe_managed_bo_reinit_in_vram(xe, gt->tile, &ads->bo);
+		if (ret)
+			return ret;
+	}
+
 	ads->golden_lrc_size = calculate_golden_lrc_size(ads);
 	/* Calculate Capture size with worst size */
 	ads->capture_size = xe_guc_capture_ads_input_worst_size(ads_to_guc(ads));
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-09-09 19:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-05 14:35 [PATCH] drm/xe/guc: Move ADS BO realloc to xe_guc_ads code Michal Wajdeczko
2025-09-05 14:42 ` ✓ CI.KUnit: success for " Patchwork
2025-09-05 15:19 ` ✓ Xe.CI.BAT: " Patchwork
2025-09-05 20:03 ` [PATCH] " John Harrison
2025-09-08  8:20   ` Michal Wajdeczko
2025-09-09 19:47     ` John Harrison
2025-09-06  0:41 ` ✗ Xe.CI.Full: failure for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox