@@ -71,6 +71,9 @@ static void rps_enable_interrupts(struct intel_rps *rps)
71
71
{
72
72
struct intel_gt * gt = rps_to_gt (rps );
73
73
74
+ GT_TRACE (gt , "interrupts:on rps->pm_events: %x, rps_pm_mask:%x\n" ,
75
+ rps -> pm_events , rps_pm_mask (rps , rps -> last_freq ));
76
+
74
77
rps_reset_ei (rps );
75
78
76
79
spin_lock_irq (& gt -> irq_lock );
@@ -128,6 +131,7 @@ static void rps_disable_interrupts(struct intel_rps *rps)
128
131
cancel_work_sync (& rps -> work );
129
132
130
133
rps_reset_interrupts (rps );
134
+ GT_TRACE (gt , "interrupts:off\n" );
131
135
}
132
136
133
137
static const struct cparams {
@@ -569,6 +573,10 @@ static void rps_set_power(struct intel_rps *rps, int new_power)
569
573
if (IS_VALLEYVIEW (i915 ))
570
574
goto skip_hw_write ;
571
575
576
+ GT_TRACE (rps_to_gt (rps ),
577
+ "changing power mode [%d], up %d%% @ %dus, down %d%% @ %dus\n" ,
578
+ new_power , threshold_up , ei_up , threshold_down , ei_down );
579
+
572
580
set (uncore , GEN6_RP_UP_EI , GT_INTERVAL_FROM_US (i915 , ei_up ));
573
581
set (uncore , GEN6_RP_UP_THRESHOLD ,
574
582
GT_INTERVAL_FROM_US (i915 , ei_up * threshold_up / 100 ));
@@ -633,6 +641,8 @@ static void gen6_rps_set_thresholds(struct intel_rps *rps, u8 val)
633
641
634
642
void intel_rps_mark_interactive (struct intel_rps * rps , bool interactive )
635
643
{
644
+ GT_TRACE (rps_to_gt (rps ), "mark interactive: %s\n" , yesno (interactive ));
645
+
636
646
mutex_lock (& rps -> power .mutex );
637
647
if (interactive ) {
638
648
if (!rps -> power .interactive ++ && READ_ONCE (rps -> active ))
@@ -660,6 +670,9 @@ static int gen6_rps_set(struct intel_rps *rps, u8 val)
660
670
GEN6_AGGRESSIVE_TURBO );
661
671
set (uncore , GEN6_RPNSWREQ , swreq );
662
672
673
+ GT_TRACE (rps_to_gt (rps ), "set val:%x, freq:%d, swreq:%x\n" ,
674
+ val , intel_gpu_freq (rps , val ), swreq );
675
+
663
676
return 0 ;
664
677
}
665
678
@@ -672,6 +685,9 @@ static int vlv_rps_set(struct intel_rps *rps, u8 val)
672
685
err = vlv_punit_write (i915 , PUNIT_REG_GPU_FREQ_REQ , val );
673
686
vlv_punit_put (i915 );
674
687
688
+ GT_TRACE (rps_to_gt (rps ), "set val:%x, freq:%d\n" ,
689
+ val , intel_gpu_freq (rps , val ));
690
+
675
691
return err ;
676
692
}
677
693
@@ -705,6 +721,8 @@ void intel_rps_unpark(struct intel_rps *rps)
705
721
if (!rps -> enabled )
706
722
return ;
707
723
724
+ GT_TRACE (rps_to_gt (rps ), "unpark:%x\n" , rps -> cur_freq );
725
+
708
726
/*
709
727
* Use the user's desired frequency as a guide, but for better
710
728
* performance, jump directly to RPe as our starting frequency.
@@ -772,6 +790,8 @@ void intel_rps_park(struct intel_rps *rps)
772
790
*/
773
791
rps -> cur_freq =
774
792
max_t (int , round_down (rps -> cur_freq - 1 , 2 ), rps -> min_freq );
793
+
794
+ GT_TRACE (rps_to_gt (rps ), "park:%x\n" , rps -> cur_freq );
775
795
}
776
796
777
797
void intel_rps_boost (struct i915_request * rq )
@@ -788,6 +808,9 @@ void intel_rps_boost(struct i915_request *rq)
788
808
!dma_fence_is_signaled_locked (& rq -> fence )) {
789
809
set_bit (I915_FENCE_FLAG_BOOST , & rq -> fence .flags );
790
810
811
+ GT_TRACE (rps_to_gt (rps ), "boost fence:%llx:%llx\n" ,
812
+ rq -> fence .context , rq -> fence .seqno );
813
+
791
814
if (!atomic_fetch_inc (& rps -> num_waiters ) &&
792
815
READ_ONCE (rps -> cur_freq ) < rps -> boost_freq )
793
816
schedule_work (& rps -> work );
@@ -883,6 +906,7 @@ static void gen6_rps_init(struct intel_rps *rps)
883
906
static bool rps_reset (struct intel_rps * rps )
884
907
{
885
908
struct drm_i915_private * i915 = rps_to_i915 (rps );
909
+
886
910
/* force a reset */
887
911
rps -> power .mode = -1 ;
888
912
rps -> last_freq = -1 ;
@@ -1210,11 +1234,17 @@ void intel_rps_enable(struct intel_rps *rps)
1210
1234
if (!rps -> enabled )
1211
1235
return ;
1212
1236
1213
- drm_WARN_ON (& i915 -> drm , rps -> max_freq < rps -> min_freq );
1214
- drm_WARN_ON (& i915 -> drm , rps -> idle_freq > rps -> max_freq );
1237
+ GT_TRACE (rps_to_gt (rps ),
1238
+ "min:%x, max:%x, freq:[%d, %d]\n" ,
1239
+ rps -> min_freq , rps -> max_freq ,
1240
+ intel_gpu_freq (rps , rps -> min_freq ),
1241
+ intel_gpu_freq (rps , rps -> max_freq ));
1215
1242
1216
- drm_WARN_ON (& i915 -> drm , rps -> efficient_freq < rps -> min_freq );
1217
- drm_WARN_ON (& i915 -> drm , rps -> efficient_freq > rps -> max_freq );
1243
+ GEM_BUG_ON (rps -> max_freq < rps -> min_freq );
1244
+ GEM_BUG_ON (rps -> idle_freq > rps -> max_freq );
1245
+
1246
+ GEM_BUG_ON (rps -> efficient_freq < rps -> min_freq );
1247
+ GEM_BUG_ON (rps -> efficient_freq > rps -> max_freq );
1218
1248
}
1219
1249
1220
1250
static void gen6_rps_disable (struct intel_rps * rps )
@@ -1482,6 +1512,12 @@ static void rps_work(struct work_struct *work)
1482
1512
max = rps -> max_freq_softlimit ;
1483
1513
if (client_boost )
1484
1514
max = rps -> max_freq ;
1515
+
1516
+ GT_TRACE (gt ,
1517
+ "pm_iir:%x, client_boost:%s, last:%d, cur:%x, min:%x, max:%x\n" ,
1518
+ pm_iir , yesno (client_boost ),
1519
+ adj , new_freq , min , max );
1520
+
1485
1521
if (client_boost && new_freq < rps -> boost_freq ) {
1486
1522
new_freq = rps -> boost_freq ;
1487
1523
adj = 0 ;
@@ -1556,6 +1592,8 @@ void gen11_rps_irq_handler(struct intel_rps *rps, u32 pm_iir)
1556
1592
if (unlikely (!events ))
1557
1593
return ;
1558
1594
1595
+ GT_TRACE (gt , "irq events:%x\n" , events );
1596
+
1559
1597
gen6_gt_pm_mask_irq (gt , events );
1560
1598
1561
1599
rps -> pm_iir |= events ;
@@ -1571,6 +1609,8 @@ void gen6_rps_irq_handler(struct intel_rps *rps, u32 pm_iir)
1571
1609
if (events ) {
1572
1610
spin_lock (& gt -> irq_lock );
1573
1611
1612
+ GT_TRACE (gt , "irq events:%x\n" , events );
1613
+
1574
1614
gen6_gt_pm_mask_irq (gt , events );
1575
1615
rps -> pm_iir |= events ;
1576
1616
0 commit comments