@@ -1469,6 +1469,19 @@ static void __reset_guc_busyness_stats(struct intel_guc *guc)
1469
1469
spin_unlock_irqrestore (& guc -> timestamp .lock , flags );
1470
1470
}
1471
1471
1472
+ static void __update_guc_busyness_running_state (struct intel_guc * guc )
1473
+ {
1474
+ struct intel_gt * gt = guc_to_gt (guc );
1475
+ struct intel_engine_cs * engine ;
1476
+ enum intel_engine_id id ;
1477
+ unsigned long flags ;
1478
+
1479
+ spin_lock_irqsave (& guc -> timestamp .lock , flags );
1480
+ for_each_engine (engine , gt , id )
1481
+ engine -> stats .guc .running = false;
1482
+ spin_unlock_irqrestore (& guc -> timestamp .lock , flags );
1483
+ }
1484
+
1472
1485
static void __update_guc_busyness_stats (struct intel_guc * guc )
1473
1486
{
1474
1487
struct intel_gt * gt = guc_to_gt (guc );
@@ -1619,6 +1632,9 @@ void intel_guc_busyness_park(struct intel_gt *gt)
1619
1632
if (!guc_submission_initialized (guc ))
1620
1633
return ;
1621
1634
1635
+ /* Assume no engines are running and set running state to false */
1636
+ __update_guc_busyness_running_state (guc );
1637
+
1622
1638
/*
1623
1639
* There is a race with suspend flow where the worker runs after suspend
1624
1640
* and causes an unclaimed register access warning. Cancel the worker
@@ -5519,12 +5535,20 @@ static inline void guc_log_context(struct drm_printer *p,
5519
5535
{
5520
5536
drm_printf (p , "GuC lrc descriptor %u:\n" , ce -> guc_id .id );
5521
5537
drm_printf (p , "\tHW Context Desc: 0x%08x\n" , ce -> lrc .lrca );
5522
- drm_printf (p , "\t\tLRC Head: Internal %u, Memory %u\n" ,
5523
- ce -> ring -> head ,
5524
- ce -> lrc_reg_state [CTX_RING_HEAD ]);
5525
- drm_printf (p , "\t\tLRC Tail: Internal %u, Memory %u\n" ,
5526
- ce -> ring -> tail ,
5527
- ce -> lrc_reg_state [CTX_RING_TAIL ]);
5538
+ if (intel_context_pin_if_active (ce )) {
5539
+ drm_printf (p , "\t\tLRC Head: Internal %u, Memory %u\n" ,
5540
+ ce -> ring -> head ,
5541
+ ce -> lrc_reg_state [CTX_RING_HEAD ]);
5542
+ drm_printf (p , "\t\tLRC Tail: Internal %u, Memory %u\n" ,
5543
+ ce -> ring -> tail ,
5544
+ ce -> lrc_reg_state [CTX_RING_TAIL ]);
5545
+ intel_context_unpin (ce );
5546
+ } else {
5547
+ drm_printf (p , "\t\tLRC Head: Internal %u, Memory not pinned\n" ,
5548
+ ce -> ring -> head );
5549
+ drm_printf (p , "\t\tLRC Tail: Internal %u, Memory not pinned\n" ,
5550
+ ce -> ring -> tail );
5551
+ }
5528
5552
drm_printf (p , "\t\tContext Pin Count: %u\n" ,
5529
5553
atomic_read (& ce -> pin_count ));
5530
5554
drm_printf (p , "\t\tGuC ID Ref Count: %u\n" ,
0 commit comments