@@ -24,9 +24,12 @@ static void vlv_steal_power_sequencer(struct drm_i915_private *dev_priv,
24
24
static void pps_init_delays (struct intel_dp * intel_dp );
25
25
static void pps_init_registers (struct intel_dp * intel_dp , bool force_disable_vdd );
26
26
27
- static const char * pps_name (struct drm_i915_private * i915 ,
28
- struct intel_pps * pps )
27
+ static const char * pps_name (struct intel_dp * intel_dp )
29
28
{
29
+ struct intel_display * display = to_intel_display (intel_dp );
30
+ struct drm_i915_private * i915 = to_i915 (display -> drm );
31
+ struct intel_pps * pps = & intel_dp -> pps ;
32
+
30
33
if (IS_VALLEYVIEW (i915 ) || IS_CHERRYVIEW (i915 )) {
31
34
switch (pps -> pps_pipe ) {
32
35
case INVALID_PIPE :
@@ -97,13 +100,13 @@ vlv_power_sequencer_kick(struct intel_dp *intel_dp)
97
100
if (drm_WARN (& dev_priv -> drm ,
98
101
intel_de_read (dev_priv , intel_dp -> output_reg ) & DP_PORT_EN ,
99
102
"skipping %s kick due to [ENCODER:%d:%s] being active\n" ,
100
- pps_name (dev_priv , & intel_dp -> pps ),
103
+ pps_name (intel_dp ),
101
104
dig_port -> base .base .base .id , dig_port -> base .base .name ))
102
105
return ;
103
106
104
107
drm_dbg_kms (& dev_priv -> drm ,
105
108
"kicking %s for [ENCODER:%d:%s]\n" ,
106
- pps_name (dev_priv , & intel_dp -> pps ),
109
+ pps_name (intel_dp ),
107
110
dig_port -> base .base .base .id , dig_port -> base .base .name );
108
111
109
112
/* Preserve the BIOS-computed detected bit. This is
@@ -227,7 +230,7 @@ vlv_power_sequencer_pipe(struct intel_dp *intel_dp)
227
230
228
231
drm_dbg_kms (& dev_priv -> drm ,
229
232
"picked %s for [ENCODER:%d:%s]\n" ,
230
- pps_name (dev_priv , & intel_dp -> pps ),
233
+ pps_name (intel_dp ),
231
234
dig_port -> base .base .base .id , dig_port -> base .base .name );
232
235
233
236
/* init power sequencer on this pipe and port */
@@ -340,7 +343,7 @@ vlv_initial_power_sequencer_setup(struct intel_dp *intel_dp)
340
343
drm_dbg_kms (& dev_priv -> drm ,
341
344
"[ENCODER:%d:%s] initial power sequencer: %s\n" ,
342
345
dig_port -> base .base .base .id , dig_port -> base .base .name ,
343
- pps_name (dev_priv , & intel_dp -> pps ));
346
+ pps_name (intel_dp ));
344
347
}
345
348
346
349
static int intel_num_pps (struct drm_i915_private * i915 )
@@ -424,12 +427,12 @@ pps_initial_setup(struct intel_dp *intel_dp)
424
427
drm_dbg_kms (& i915 -> drm ,
425
428
"[ENCODER:%d:%s] no initial power sequencer, assuming %s\n" ,
426
429
encoder -> base .base .id , encoder -> base .name ,
427
- pps_name (i915 , & intel_dp -> pps ));
430
+ pps_name (intel_dp ));
428
431
} else {
429
432
drm_dbg_kms (& i915 -> drm ,
430
433
"[ENCODER:%d:%s] initial power sequencer: %s\n" ,
431
434
encoder -> base .base .id , encoder -> base .name ,
432
- pps_name (i915 , & intel_dp -> pps ));
435
+ pps_name (intel_dp ));
433
436
}
434
437
435
438
return intel_pps_is_valid (intel_dp );
@@ -565,11 +568,11 @@ void intel_pps_check_power_unlocked(struct intel_dp *intel_dp)
565
568
drm_WARN (& dev_priv -> drm , 1 ,
566
569
"[ENCODER:%d:%s] %s powered off while attempting AUX CH communication.\n" ,
567
570
dig_port -> base .base .base .id , dig_port -> base .base .name ,
568
- pps_name (dev_priv , & intel_dp -> pps ));
571
+ pps_name (intel_dp ));
569
572
drm_dbg_kms (& dev_priv -> drm ,
570
573
"[ENCODER:%d:%s] %s PP_STATUS: 0x%08x PP_CONTROL: 0x%08x\n" ,
571
574
dig_port -> base .base .base .id , dig_port -> base .base .name ,
572
- pps_name (dev_priv , & intel_dp -> pps ),
575
+ pps_name (intel_dp ),
573
576
intel_de_read (dev_priv , _pp_stat_reg (intel_dp )),
574
577
intel_de_read (dev_priv , _pp_ctrl_reg (intel_dp )));
575
578
}
@@ -603,7 +606,7 @@ static void wait_panel_status(struct intel_dp *intel_dp,
603
606
drm_dbg_kms (& dev_priv -> drm ,
604
607
"[ENCODER:%d:%s] %s mask: 0x%08x value: 0x%08x PP_STATUS: 0x%08x PP_CONTROL: 0x%08x\n" ,
605
608
dig_port -> base .base .base .id , dig_port -> base .base .name ,
606
- pps_name (dev_priv , & intel_dp -> pps ),
609
+ pps_name (intel_dp ),
607
610
mask , value ,
608
611
intel_de_read (dev_priv , pp_stat_reg ),
609
612
intel_de_read (dev_priv , pp_ctrl_reg ));
@@ -612,7 +615,7 @@ static void wait_panel_status(struct intel_dp *intel_dp,
612
615
drm_err (& dev_priv -> drm ,
613
616
"[ENCODER:%d:%s] %s panel status timeout: PP_STATUS: 0x%08x PP_CONTROL: 0x%08x\n" ,
614
617
dig_port -> base .base .base .id , dig_port -> base .base .name ,
615
- pps_name (dev_priv , & intel_dp -> pps ),
618
+ pps_name (intel_dp ),
616
619
intel_de_read (dev_priv , pp_stat_reg ),
617
620
intel_de_read (dev_priv , pp_ctrl_reg ));
618
621
@@ -626,7 +629,7 @@ static void wait_panel_on(struct intel_dp *intel_dp)
626
629
627
630
drm_dbg_kms (& i915 -> drm , "[ENCODER:%d:%s] %s wait for panel power on\n" ,
628
631
dig_port -> base .base .base .id , dig_port -> base .base .name ,
629
- pps_name (i915 , & intel_dp -> pps ));
632
+ pps_name (intel_dp ));
630
633
wait_panel_status (intel_dp , IDLE_ON_MASK , IDLE_ON_VALUE );
631
634
}
632
635
@@ -637,7 +640,7 @@ static void wait_panel_off(struct intel_dp *intel_dp)
637
640
638
641
drm_dbg_kms (& i915 -> drm , "[ENCODER:%d:%s] %s wait for panel power off time\n" ,
639
642
dig_port -> base .base .base .id , dig_port -> base .base .name ,
640
- pps_name (i915 , & intel_dp -> pps ));
643
+ pps_name (intel_dp ));
641
644
wait_panel_status (intel_dp , IDLE_OFF_MASK , IDLE_OFF_VALUE );
642
645
}
643
646
@@ -650,7 +653,7 @@ static void wait_panel_power_cycle(struct intel_dp *intel_dp)
650
653
651
654
drm_dbg_kms (& i915 -> drm , "[ENCODER:%d:%s] %s wait for panel power cycle\n" ,
652
655
dig_port -> base .base .base .id , dig_port -> base .base .name ,
653
- pps_name (i915 , & intel_dp -> pps ));
656
+ pps_name (intel_dp ));
654
657
655
658
/* take the difference of current time and panel power off time
656
659
* and then make panel wait for t11_t12 if needed. */
@@ -742,7 +745,7 @@ bool intel_pps_vdd_on_unlocked(struct intel_dp *intel_dp)
742
745
743
746
drm_dbg_kms (& dev_priv -> drm , "[ENCODER:%d:%s] %s turning VDD on\n" ,
744
747
dig_port -> base .base .base .id , dig_port -> base .base .name ,
745
- pps_name (dev_priv , & intel_dp -> pps ));
748
+ pps_name (intel_dp ));
746
749
747
750
if (!edp_have_panel_power (intel_dp ))
748
751
wait_panel_power_cycle (intel_dp );
@@ -754,7 +757,7 @@ bool intel_pps_vdd_on_unlocked(struct intel_dp *intel_dp)
754
757
intel_de_posting_read (dev_priv , pp_ctrl_reg );
755
758
drm_dbg_kms (& dev_priv -> drm , "[ENCODER:%d:%s] %s PP_STATUS: 0x%08x PP_CONTROL: 0x%08x\n" ,
756
759
dig_port -> base .base .base .id , dig_port -> base .base .name ,
757
- pps_name (dev_priv , & intel_dp -> pps ),
760
+ pps_name (intel_dp ),
758
761
intel_de_read (dev_priv , pp_stat_reg ),
759
762
intel_de_read (dev_priv , pp_ctrl_reg ));
760
763
/*
@@ -764,7 +767,7 @@ bool intel_pps_vdd_on_unlocked(struct intel_dp *intel_dp)
764
767
drm_dbg_kms (& dev_priv -> drm ,
765
768
"[ENCODER:%d:%s] %s panel power wasn't enabled\n" ,
766
769
dig_port -> base .base .base .id , dig_port -> base .base .name ,
767
- pps_name (dev_priv , & intel_dp -> pps ));
770
+ pps_name (intel_dp ));
768
771
msleep (intel_dp -> pps .panel_power_up_delay );
769
772
}
770
773
@@ -792,7 +795,7 @@ void intel_pps_vdd_on(struct intel_dp *intel_dp)
792
795
I915_STATE_WARN (i915 , !vdd , "[ENCODER:%d:%s] %s VDD already requested on\n" ,
793
796
dp_to_dig_port (intel_dp )-> base .base .base .id ,
794
797
dp_to_dig_port (intel_dp )-> base .base .name ,
795
- pps_name (i915 , & intel_dp -> pps ));
798
+ pps_name (intel_dp ));
796
799
}
797
800
798
801
static void intel_pps_vdd_off_sync_unlocked (struct intel_dp * intel_dp )
@@ -812,7 +815,7 @@ static void intel_pps_vdd_off_sync_unlocked(struct intel_dp *intel_dp)
812
815
813
816
drm_dbg_kms (& dev_priv -> drm , "[ENCODER:%d:%s] %s turning VDD off\n" ,
814
817
dig_port -> base .base .base .id , dig_port -> base .base .name ,
815
- pps_name (dev_priv , & intel_dp -> pps ));
818
+ pps_name (intel_dp ));
816
819
817
820
pp = ilk_get_pp_control (intel_dp );
818
821
pp &= ~EDP_FORCE_VDD ;
@@ -826,7 +829,7 @@ static void intel_pps_vdd_off_sync_unlocked(struct intel_dp *intel_dp)
826
829
/* Make sure sequencer is idle before allowing subsequent activity */
827
830
drm_dbg_kms (& dev_priv -> drm , "[ENCODER:%d:%s] %s PP_STATUS: 0x%08x PP_CONTROL: 0x%08x\n" ,
828
831
dig_port -> base .base .base .id , dig_port -> base .base .name ,
829
- pps_name (dev_priv , & intel_dp -> pps ),
832
+ pps_name (intel_dp ),
830
833
intel_de_read (dev_priv , pp_stat_reg ),
831
834
intel_de_read (dev_priv , pp_ctrl_reg ));
832
835
@@ -907,7 +910,7 @@ void intel_pps_vdd_off_unlocked(struct intel_dp *intel_dp, bool sync)
907
910
"[ENCODER:%d:%s] %s VDD not forced on" ,
908
911
dp_to_dig_port (intel_dp )-> base .base .base .id ,
909
912
dp_to_dig_port (intel_dp )-> base .base .name ,
910
- pps_name (dev_priv , & intel_dp -> pps ));
913
+ pps_name (intel_dp ));
911
914
912
915
intel_dp -> pps .want_panel_vdd = false;
913
916
@@ -931,13 +934,13 @@ void intel_pps_on_unlocked(struct intel_dp *intel_dp)
931
934
drm_dbg_kms (& dev_priv -> drm , "[ENCODER:%d:%s] %s turn panel power on\n" ,
932
935
dp_to_dig_port (intel_dp )-> base .base .base .id ,
933
936
dp_to_dig_port (intel_dp )-> base .base .name ,
934
- pps_name (dev_priv , & intel_dp -> pps ));
937
+ pps_name (intel_dp ));
935
938
936
939
if (drm_WARN (& dev_priv -> drm , edp_have_panel_power (intel_dp ),
937
940
"[ENCODER:%d:%s] %s panel power already on\n" ,
938
941
dp_to_dig_port (intel_dp )-> base .base .base .id ,
939
942
dp_to_dig_port (intel_dp )-> base .base .name ,
940
- pps_name (dev_priv , & intel_dp -> pps )))
943
+ pps_name (intel_dp )))
941
944
return ;
942
945
943
946
wait_panel_power_cycle (intel_dp );
@@ -1005,12 +1008,12 @@ void intel_pps_off_unlocked(struct intel_dp *intel_dp)
1005
1008
1006
1009
drm_dbg_kms (& dev_priv -> drm , "[ENCODER:%d:%s] %s turn panel power off\n" ,
1007
1010
dig_port -> base .base .base .id , dig_port -> base .base .name ,
1008
- pps_name (dev_priv , & intel_dp -> pps ));
1011
+ pps_name (intel_dp ));
1009
1012
1010
1013
drm_WARN (& dev_priv -> drm , !intel_dp -> pps .want_panel_vdd ,
1011
1014
"[ENCODER:%d:%s] %s need VDD to turn off panel\n" ,
1012
1015
dig_port -> base .base .base .id , dig_port -> base .base .name ,
1013
- pps_name (dev_priv , & intel_dp -> pps ));
1016
+ pps_name (intel_dp ));
1014
1017
1015
1018
pp = ilk_get_pp_control (intel_dp );
1016
1019
/* We need to switch off panel power _and_ force vdd, for otherwise some
@@ -1146,7 +1149,7 @@ static void vlv_detach_power_sequencer(struct intel_dp *intel_dp)
1146
1149
*/
1147
1150
drm_dbg_kms (& dev_priv -> drm ,
1148
1151
"detaching %s from [ENCODER:%d:%s]\n" ,
1149
- pps_name (dev_priv , & intel_dp -> pps ),
1152
+ pps_name (intel_dp ),
1150
1153
dig_port -> base .base .base .id , dig_port -> base .base .name );
1151
1154
intel_de_write (dev_priv , pp_on_reg , 0 );
1152
1155
intel_de_posting_read (dev_priv , pp_on_reg );
@@ -1219,7 +1222,7 @@ void vlv_pps_init(struct intel_encoder *encoder,
1219
1222
1220
1223
drm_dbg_kms (& dev_priv -> drm ,
1221
1224
"initializing %s for [ENCODER:%d:%s]\n" ,
1222
- pps_name (dev_priv , & intel_dp -> pps ),
1225
+ pps_name (intel_dp ),
1223
1226
encoder -> base .base .id , encoder -> base .name );
1224
1227
1225
1228
/* init power sequencer on this pipe and port */
@@ -1246,7 +1249,7 @@ static void pps_vdd_init(struct intel_dp *intel_dp)
1246
1249
drm_dbg_kms (& dev_priv -> drm ,
1247
1250
"[ENCODER:%d:%s] %s VDD left on by BIOS, adjusting state tracking\n" ,
1248
1251
dig_port -> base .base .base .id , dig_port -> base .base .name ,
1249
- pps_name (dev_priv , & intel_dp -> pps ));
1252
+ pps_name (intel_dp ));
1250
1253
drm_WARN_ON (& dev_priv -> drm , intel_dp -> pps .vdd_wakeref );
1251
1254
intel_dp -> pps .vdd_wakeref = intel_display_power_get (dev_priv ,
1252
1255
intel_aux_power_domain (dig_port ));
0 commit comments