27
27
28
28
#include "intel_guc_ads.h"
29
29
#include "intel_guc_capture.h"
30
+ #include "intel_guc_print.h"
30
31
#include "intel_guc_submission.h"
31
32
32
33
#include "i915_drv.h"
@@ -1443,8 +1444,7 @@ static void guc_init_engine_stats(struct intel_guc *guc)
1443
1444
int ret = guc_action_enable_usage_stats (guc );
1444
1445
1445
1446
if (ret )
1446
- drm_err (& gt -> i915 -> drm ,
1447
- "Failed to enable usage stats: %d!\n" , ret );
1447
+ guc_err (guc , "Failed to enable usage stats: %pe\n" , ERR_PTR (ret ));
1448
1448
}
1449
1449
}
1450
1450
@@ -3586,8 +3586,7 @@ static int guc_request_alloc(struct i915_request *rq)
3586
3586
intel_context_sched_disable_unpin (ce );
3587
3587
else if (intel_context_is_closed (ce ))
3588
3588
if (wait_for (context_close_done (ce ), 1500 ))
3589
- drm_warn (& guc_to_gt (guc )-> i915 -> drm ,
3590
- "timed out waiting on context sched close before realloc\n" );
3589
+ guc_warn (guc , "timed out waiting on context sched close before realloc\n" );
3591
3590
/*
3592
3591
* Call pin_guc_id here rather than in the pinning step as with
3593
3592
* dma_resv, contexts can be repeatedly pinned / unpinned trashing the
@@ -4350,11 +4349,14 @@ static int __guc_action_set_scheduling_policies(struct intel_guc *guc,
4350
4349
4351
4350
ret = intel_guc_send (guc , (u32 * )& policy -> h2g ,
4352
4351
__guc_scheduling_policy_action_size (policy ));
4353
- if (ret < 0 )
4352
+ if (ret < 0 ) {
4353
+ guc_probe_error (guc , "Failed to configure global scheduling policies: %pe!\n" ,
4354
+ ERR_PTR (ret ));
4354
4355
return ret ;
4356
+ }
4355
4357
4356
4358
if (ret != policy -> count ) {
4357
- drm_warn ( & guc_to_gt ( guc ) -> i915 -> drm , "GuC global scheduler policy processed %d of %d KLVs!" ,
4359
+ guc_warn ( guc , "global scheduler policy processed %d of %d KLVs!" ,
4358
4360
ret , policy -> count );
4359
4361
if (ret > policy -> count )
4360
4362
return - EPROTO ;
@@ -4368,7 +4370,7 @@ static int guc_init_global_schedule_policy(struct intel_guc *guc)
4368
4370
struct scheduling_policy policy ;
4369
4371
struct intel_gt * gt = guc_to_gt (guc );
4370
4372
intel_wakeref_t wakeref ;
4371
- int ret = 0 ;
4373
+ int ret ;
4372
4374
4373
4375
if (GUC_SUBMIT_VER (guc ) < MAKE_GUC_VER (1 , 1 , 0 ))
4374
4376
return 0 ;
@@ -4386,10 +4388,6 @@ static int guc_init_global_schedule_policy(struct intel_guc *guc)
4386
4388
yield , ARRAY_SIZE (yield ));
4387
4389
4388
4390
ret = __guc_action_set_scheduling_policies (guc , & policy );
4389
- if (ret )
4390
- i915_probe_error (gt -> i915 ,
4391
- "Failed to configure global scheduling policies: %pe!\n" ,
4392
- ERR_PTR (ret ));
4393
4391
}
4394
4392
4395
4393
return ret ;
@@ -4488,21 +4486,18 @@ g2h_context_lookup(struct intel_guc *guc, u32 ctx_id)
4488
4486
struct intel_context * ce ;
4489
4487
4490
4488
if (unlikely (ctx_id >= GUC_MAX_CONTEXT_ID )) {
4491
- drm_err (& guc_to_gt (guc )-> i915 -> drm ,
4492
- "Invalid ctx_id %u\n" , ctx_id );
4489
+ guc_err (guc , "Invalid ctx_id %u\n" , ctx_id );
4493
4490
return NULL ;
4494
4491
}
4495
4492
4496
4493
ce = __get_context (guc , ctx_id );
4497
4494
if (unlikely (!ce )) {
4498
- drm_err (& guc_to_gt (guc )-> i915 -> drm ,
4499
- "Context is NULL, ctx_id %u\n" , ctx_id );
4495
+ guc_err (guc , "Context is NULL, ctx_id %u\n" , ctx_id );
4500
4496
return NULL ;
4501
4497
}
4502
4498
4503
4499
if (unlikely (intel_context_is_child (ce ))) {
4504
- drm_err (& guc_to_gt (guc )-> i915 -> drm ,
4505
- "Context is child, ctx_id %u\n" , ctx_id );
4500
+ guc_err (guc , "Context is child, ctx_id %u\n" , ctx_id );
4506
4501
return NULL ;
4507
4502
}
4508
4503
@@ -4517,7 +4512,7 @@ int intel_guc_deregister_done_process_msg(struct intel_guc *guc,
4517
4512
u32 ctx_id ;
4518
4513
4519
4514
if (unlikely (len < 1 )) {
4520
- drm_err ( & guc_to_gt ( guc ) -> i915 -> drm , "Invalid length %u\n" , len );
4515
+ guc_err ( guc , "Invalid length %u\n" , len );
4521
4516
return - EPROTO ;
4522
4517
}
4523
4518
ctx_id = msg [0 ];
@@ -4569,7 +4564,7 @@ int intel_guc_sched_done_process_msg(struct intel_guc *guc,
4569
4564
u32 ctx_id ;
4570
4565
4571
4566
if (unlikely (len < 2 )) {
4572
- drm_err ( & guc_to_gt ( guc ) -> i915 -> drm , "Invalid length %u\n" , len );
4567
+ guc_err ( guc , "Invalid length %u\n" , len );
4573
4568
return - EPROTO ;
4574
4569
}
4575
4570
ctx_id = msg [0 ];
@@ -4581,8 +4576,7 @@ int intel_guc_sched_done_process_msg(struct intel_guc *guc,
4581
4576
if (unlikely (context_destroyed (ce ) ||
4582
4577
(!context_pending_enable (ce ) &&
4583
4578
!context_pending_disable (ce )))) {
4584
- drm_err (& guc_to_gt (guc )-> i915 -> drm ,
4585
- "Bad context sched_state 0x%x, ctx_id %u\n" ,
4579
+ guc_err (guc , "Bad context sched_state 0x%x, ctx_id %u\n" ,
4586
4580
ce -> guc_state .sched_state , ctx_id );
4587
4581
return - EPROTO ;
4588
4582
}
@@ -4674,8 +4668,7 @@ static void guc_handle_context_reset(struct intel_guc *guc,
4674
4668
capture_error_state (guc , ce );
4675
4669
guc_context_replay (ce );
4676
4670
} else {
4677
- drm_info (& guc_to_gt (guc )-> i915 -> drm ,
4678
- "Ignoring context reset notification of exiting context 0x%04X on %s" ,
4671
+ guc_info (guc , "Ignoring context reset notification of exiting context 0x%04X on %s" ,
4679
4672
ce -> guc_id .id , ce -> engine -> name );
4680
4673
}
4681
4674
}
@@ -4688,7 +4681,7 @@ int intel_guc_context_reset_process_msg(struct intel_guc *guc,
4688
4681
int ctx_id ;
4689
4682
4690
4683
if (unlikely (len != 1 )) {
4691
- drm_err ( & guc_to_gt ( guc ) -> i915 -> drm , "Invalid length %u" , len );
4684
+ guc_err ( guc , "Invalid length %u" , len );
4692
4685
return - EPROTO ;
4693
4686
}
4694
4687
@@ -4721,13 +4714,13 @@ int intel_guc_error_capture_process_msg(struct intel_guc *guc,
4721
4714
u32 status ;
4722
4715
4723
4716
if (unlikely (len != 1 )) {
4724
- drm_dbg ( & guc_to_gt ( guc ) -> i915 -> drm , "Invalid length %u" , len );
4717
+ guc_dbg ( guc , "Invalid length %u" , len );
4725
4718
return - EPROTO ;
4726
4719
}
4727
4720
4728
4721
status = msg [0 ] & INTEL_GUC_STATE_CAPTURE_EVENT_STATUS_MASK ;
4729
4722
if (status == INTEL_GUC_STATE_CAPTURE_EVENT_STATUS_NOSPACE )
4730
- drm_warn ( & guc_to_gt ( guc ) -> i915 -> drm , "G2H-Error capture no space " );
4723
+ guc_warn ( guc , "No space for error capture " );
4731
4724
4732
4725
intel_guc_capture_process (guc );
4733
4726
@@ -4783,13 +4776,12 @@ int intel_guc_engine_failure_process_msg(struct intel_guc *guc,
4783
4776
const u32 * msg , u32 len )
4784
4777
{
4785
4778
struct intel_engine_cs * engine ;
4786
- struct intel_gt * gt = guc_to_gt (guc );
4787
4779
u8 guc_class , instance ;
4788
4780
u32 reason ;
4789
4781
unsigned long flags ;
4790
4782
4791
4783
if (unlikely (len != 3 )) {
4792
- drm_err ( & gt -> i915 -> drm , "Invalid length %u" , len );
4784
+ guc_err ( guc , "Invalid length %u" , len );
4793
4785
return - EPROTO ;
4794
4786
}
4795
4787
@@ -4799,16 +4791,15 @@ int intel_guc_engine_failure_process_msg(struct intel_guc *guc,
4799
4791
4800
4792
engine = intel_guc_lookup_engine (guc , guc_class , instance );
4801
4793
if (unlikely (!engine )) {
4802
- drm_err (& gt -> i915 -> drm ,
4803
- "Invalid engine %d:%d" , guc_class , instance );
4794
+ guc_err (guc , "Invalid engine %d:%d" , guc_class , instance );
4804
4795
return - EPROTO ;
4805
4796
}
4806
4797
4807
4798
/*
4808
4799
* This is an unexpected failure of a hardware feature. So, log a real
4809
4800
* error message not just the informational that comes with the reset.
4810
4801
*/
4811
- drm_err ( & gt -> i915 -> drm , "GuC engine reset request failed on %d:%d (%s) because 0x%08X" ,
4802
+ guc_err ( guc , "Engine reset failed on %d:%d (%s) because 0x%08X" ,
4812
4803
guc_class , instance , engine -> name , reason );
4813
4804
4814
4805
spin_lock_irqsave (& guc -> submission_state .lock , flags );
@@ -5371,8 +5362,8 @@ guc_create_virtual(struct intel_engine_cs **siblings, unsigned int count,
5371
5362
5372
5363
GEM_BUG_ON (!is_power_of_2 (sibling -> mask ));
5373
5364
if (sibling -> mask & ve -> base .mask ) {
5374
- DRM_DEBUG ( "duplicate %s entry in load balancer\n" ,
5375
- sibling -> name );
5365
+ guc_dbg ( guc , "duplicate %s entry in load balancer\n" ,
5366
+ sibling -> name );
5376
5367
err = - EINVAL ;
5377
5368
goto err_put ;
5378
5369
}
@@ -5381,8 +5372,8 @@ guc_create_virtual(struct intel_engine_cs **siblings, unsigned int count,
5381
5372
ve -> base .logical_mask |= sibling -> logical_mask ;
5382
5373
5383
5374
if (n != 0 && ve -> base .class != sibling -> class ) {
5384
- DRM_DEBUG ( "invalid mixing of engine class, sibling %d, already %d\n" ,
5385
- sibling -> class , ve -> base .class );
5375
+ guc_dbg ( guc , "invalid mixing of engine class, sibling %d, already %d\n" ,
5376
+ sibling -> class , ve -> base .class );
5386
5377
err = - EINVAL ;
5387
5378
goto err_put ;
5388
5379
} else if (n == 0 ) {
0 commit comments