6
6
#include <linux/string_helpers.h>
7
7
8
8
#include "gt/intel_gt.h"
9
+ #include "gt/intel_gt_print.h"
9
10
#include "gt/intel_reset.h"
10
11
#include "intel_gsc_fw.h"
11
12
#include "intel_gsc_uc.h"
12
13
#include "intel_guc.h"
13
14
#include "intel_guc_ads.h"
15
+ #include "intel_guc_print.h"
14
16
#include "intel_guc_submission.h"
15
17
#include "gt/intel_rps.h"
16
18
#include "intel_uc.h"
@@ -67,14 +69,14 @@ static int __intel_uc_reset_hw(struct intel_uc *uc)
67
69
68
70
ret = intel_reset_guc (gt );
69
71
if (ret ) {
70
- DRM_ERROR ( "Failed to reset GuC, ret = %d\n" , ret );
72
+ gt_err ( gt , "Failed to reset GuC, ret = %d\n" , ret );
71
73
return ret ;
72
74
}
73
75
74
76
guc_status = intel_uncore_read (gt -> uncore , GUC_STATUS );
75
- WARN ( !(guc_status & GS_MIA_IN_RESET ),
76
- "GuC status: 0x%x, MIA core expected to be in reset\n" ,
77
- guc_status );
77
+ gt_WARN ( gt , !(guc_status & GS_MIA_IN_RESET ),
78
+ "GuC status: 0x%x, MIA core expected to be in reset\n" ,
79
+ guc_status );
78
80
79
81
return ret ;
80
82
}
@@ -252,15 +254,13 @@ static int guc_enable_communication(struct intel_guc *guc)
252
254
intel_guc_ct_event_handler (& guc -> ct );
253
255
spin_unlock_irq (gt -> irq_lock );
254
256
255
- drm_dbg ( & i915 -> drm , "GuC communication enabled\n" );
257
+ guc_dbg ( guc , "communication enabled\n" );
256
258
257
259
return 0 ;
258
260
}
259
261
260
262
static void guc_disable_communication (struct intel_guc * guc )
261
263
{
262
- struct drm_i915_private * i915 = guc_to_gt (guc )-> i915 ;
263
-
264
264
/*
265
265
* Events generated during or after CT disable are logged by guc in
266
266
* via mmio. Make sure the register is clear before disabling CT since
@@ -280,11 +280,12 @@ static void guc_disable_communication(struct intel_guc *guc)
280
280
*/
281
281
guc_get_mmio_msg (guc );
282
282
283
- drm_dbg ( & i915 -> drm , "GuC communication disabled\n" );
283
+ guc_dbg ( guc , "communication disabled\n" );
284
284
}
285
285
286
286
static void __uc_fetch_firmwares (struct intel_uc * uc )
287
287
{
288
+ struct intel_gt * gt = uc_to_gt (uc );
288
289
int err ;
289
290
290
291
GEM_BUG_ON (!intel_uc_wants_guc (uc ));
@@ -293,15 +294,13 @@ static void __uc_fetch_firmwares(struct intel_uc *uc)
293
294
if (err ) {
294
295
/* Make sure we transition out of transient "SELECTED" state */
295
296
if (intel_uc_wants_huc (uc )) {
296
- drm_dbg (& uc_to_gt (uc )-> i915 -> drm ,
297
- "Failed to fetch GuC: %d disabling HuC\n" , err );
297
+ gt_dbg (gt , "Failed to fetch GuC fw (%pe) disabling HuC\n" , ERR_PTR (err ));
298
298
intel_uc_fw_change_status (& uc -> huc .fw ,
299
299
INTEL_UC_FIRMWARE_ERROR );
300
300
}
301
301
302
302
if (intel_uc_wants_gsc_uc (uc )) {
303
- drm_dbg (& uc_to_gt (uc )-> i915 -> drm ,
304
- "Failed to fetch GuC: %d disabling GSC\n" , err );
303
+ gt_dbg (gt , "Failed to fetch GuC fw (%pe) disabling GSC\n" , ERR_PTR (err ));
305
304
intel_uc_fw_change_status (& uc -> gsc .fw ,
306
305
INTEL_UC_FIRMWARE_ERROR );
307
306
}
@@ -382,7 +381,7 @@ static int uc_init_wopcm(struct intel_uc *uc)
382
381
int err ;
383
382
384
383
if (unlikely (!base || !size )) {
385
- i915_probe_error (gt -> i915 , "Unsuccessful WOPCM partitioning\n" );
384
+ gt_probe_error (gt , "Unsuccessful WOPCM partitioning\n" );
386
385
return - E2BIG ;
387
386
}
388
387
@@ -413,13 +412,13 @@ static int uc_init_wopcm(struct intel_uc *uc)
413
412
return 0 ;
414
413
415
414
err_out :
416
- i915_probe_error (gt -> i915 , "Failed to init uC WOPCM registers!\n" );
417
- i915_probe_error (gt -> i915 , "%s(%#x)=%#x\n" , "DMA_GUC_WOPCM_OFFSET" ,
418
- i915_mmio_reg_offset (DMA_GUC_WOPCM_OFFSET ),
419
- intel_uncore_read (uncore , DMA_GUC_WOPCM_OFFSET ));
420
- i915_probe_error (gt -> i915 , "%s(%#x)=%#x\n" , "GUC_WOPCM_SIZE" ,
421
- i915_mmio_reg_offset (GUC_WOPCM_SIZE ),
422
- intel_uncore_read (uncore , GUC_WOPCM_SIZE ));
415
+ gt_probe_error (gt , "Failed to init uC WOPCM registers!\n" );
416
+ gt_probe_error (gt , "%s(%#x)=%#x\n" , "DMA_GUC_WOPCM_OFFSET" ,
417
+ i915_mmio_reg_offset (DMA_GUC_WOPCM_OFFSET ),
418
+ intel_uncore_read (uncore , DMA_GUC_WOPCM_OFFSET ));
419
+ gt_probe_error (gt , "%s(%#x)=%#x\n" , "GUC_WOPCM_SIZE" ,
420
+ i915_mmio_reg_offset (GUC_WOPCM_SIZE ),
421
+ intel_uncore_read (uncore , GUC_WOPCM_SIZE ));
423
422
424
423
return err ;
425
424
}
@@ -449,31 +448,30 @@ static int __uc_check_hw(struct intel_uc *uc)
449
448
return 0 ;
450
449
}
451
450
452
- static void print_fw_ver (struct intel_uc * uc , struct intel_uc_fw * fw )
451
+ static void print_fw_ver (struct intel_gt * gt , struct intel_uc_fw * fw )
453
452
{
454
- struct drm_i915_private * i915 = uc_to_gt (uc )-> i915 ;
455
-
456
- drm_info (& i915 -> drm , "%s firmware %s version %u.%u.%u\n" ,
457
- intel_uc_fw_type_repr (fw -> type ), fw -> file_selected .path ,
458
- fw -> file_selected .ver .major ,
459
- fw -> file_selected .ver .minor ,
460
- fw -> file_selected .ver .patch );
453
+ gt_info (gt , "%s firmware %s version %u.%u.%u\n" ,
454
+ intel_uc_fw_type_repr (fw -> type ), fw -> file_selected .path ,
455
+ fw -> file_selected .ver .major ,
456
+ fw -> file_selected .ver .minor ,
457
+ fw -> file_selected .ver .patch );
461
458
}
462
459
463
460
static int __uc_init_hw (struct intel_uc * uc )
464
461
{
465
- struct drm_i915_private * i915 = uc_to_gt (uc )-> i915 ;
462
+ struct intel_gt * gt = uc_to_gt (uc );
463
+ struct drm_i915_private * i915 = gt -> i915 ;
466
464
struct intel_guc * guc = & uc -> guc ;
467
465
struct intel_huc * huc = & uc -> huc ;
468
466
int ret , attempts ;
469
467
470
468
GEM_BUG_ON (!intel_uc_supports_guc (uc ));
471
469
GEM_BUG_ON (!intel_uc_wants_guc (uc ));
472
470
473
- print_fw_ver (uc , & guc -> fw );
471
+ print_fw_ver (gt , & guc -> fw );
474
472
475
473
if (intel_uc_uses_huc (uc ))
476
- print_fw_ver (uc , & huc -> fw );
474
+ print_fw_ver (gt , & huc -> fw );
477
475
478
476
if (!intel_uc_fw_is_loadable (& guc -> fw )) {
479
477
ret = __uc_check_hw (uc ) ||
@@ -514,8 +512,8 @@ static int __uc_init_hw(struct intel_uc *uc)
514
512
if (ret == 0 )
515
513
break ;
516
514
517
- DRM_DEBUG_DRIVER ( "GuC fw load failed: %d; will reset and "
518
- "retry %d more time(s)\n" , ret , attempts );
515
+ gt_dbg ( gt , "GuC fw load failed (%pe) will reset and retry %d more time(s)\n" ,
516
+ ERR_PTR ( ret ) , attempts );
519
517
}
520
518
521
519
/* Did we succeded or run out of retries? */
@@ -551,10 +549,10 @@ static int __uc_init_hw(struct intel_uc *uc)
551
549
552
550
intel_gsc_uc_load_start (& uc -> gsc );
553
551
554
- drm_info ( & i915 -> drm , "GuC submission %s\n" ,
555
- str_enabled_disabled (intel_uc_uses_guc_submission (uc )));
556
- drm_info ( & i915 -> drm , "GuC SLPC %s\n" ,
557
- str_enabled_disabled (intel_uc_uses_guc_slpc (uc )));
552
+ gt_info ( gt , "GuC submission %s\n" ,
553
+ str_enabled_disabled (intel_uc_uses_guc_submission (uc )));
554
+ gt_info ( gt , "GuC SLPC %s\n" ,
555
+ str_enabled_disabled (intel_uc_uses_guc_slpc (uc )));
558
556
559
557
return 0 ;
560
558
@@ -572,12 +570,12 @@ static int __uc_init_hw(struct intel_uc *uc)
572
570
__uc_sanitize (uc );
573
571
574
572
if (!ret ) {
575
- drm_notice ( & i915 -> drm , "GuC is uninitialized\n" );
573
+ gt_notice ( gt , "GuC is uninitialized\n" );
576
574
/* We want to run without GuC submission */
577
575
return 0 ;
578
576
}
579
577
580
- i915_probe_error ( i915 , "GuC initialization failed %d \n" , ret );
578
+ gt_probe_error ( gt , "GuC initialization failed %pe \n" , ERR_PTR ( ret ) );
581
579
582
580
/* We want to keep KMS alive */
583
581
return - EIO ;
@@ -690,7 +688,7 @@ void intel_uc_suspend(struct intel_uc *uc)
690
688
with_intel_runtime_pm (& uc_to_gt (uc )-> i915 -> runtime_pm , wakeref ) {
691
689
err = intel_guc_suspend (guc );
692
690
if (err )
693
- DRM_DEBUG_DRIVER ( "Failed to suspend GuC, err=%d " , err );
691
+ guc_dbg ( guc , "Failed to suspend, %pe " , ERR_PTR ( err ) );
694
692
}
695
693
}
696
694
@@ -718,7 +716,7 @@ static int __uc_resume(struct intel_uc *uc, bool enable_communication)
718
716
719
717
err = intel_guc_resume (guc );
720
718
if (err ) {
721
- DRM_DEBUG_DRIVER ( "Failed to resume GuC, err=%d " , err );
719
+ guc_dbg ( guc , "Failed to resume, %pe " , ERR_PTR ( err ) );
722
720
return err ;
723
721
}
724
722
0 commit comments