@@ -528,3 +528,75 @@ void dcn314_disable_link_output(struct dc_link *link,
528
528
529
529
apply_symclk_on_tx_off_wa (link );
530
530
}
531
+
532
+ /**
533
+ * dcn314_dpp_pg_control - DPP power gate control.
534
+ *
535
+ * @hws: dce_hwseq reference.
536
+ * @dpp_inst: DPP instance reference.
537
+ * @power_on: true if we want to enable power gate, false otherwise.
538
+ *
539
+ * Enable or disable power gate in the specific DPP instance.
540
+ * If power gating is disabled, will force disable cursor in the DPP instance.
541
+ */
542
+ void dcn314_dpp_pg_control (
543
+ struct dce_hwseq * hws ,
544
+ unsigned int dpp_inst ,
545
+ bool power_on )
546
+ {
547
+ uint32_t power_gate = power_on ? 0 : 1 ;
548
+ uint32_t pwr_status = power_on ? 0 : 2 ;
549
+
550
+
551
+ if (hws -> ctx -> dc -> debug .disable_dpp_power_gate ) {
552
+ /* Workaround for DCN314 with disabled power gating */
553
+ if (!power_on ) {
554
+
555
+ /* Force disable cursor if power gating is disabled */
556
+ struct dpp * dpp = hws -> ctx -> dc -> res_pool -> dpps [dpp_inst ];
557
+ if (dpp && dpp -> funcs -> dpp_force_disable_cursor )
558
+ dpp -> funcs -> dpp_force_disable_cursor (dpp );
559
+ }
560
+ return ;
561
+ }
562
+ if (REG (DOMAIN1_PG_CONFIG ) == 0 )
563
+ return ;
564
+
565
+ switch (dpp_inst ) {
566
+ case 0 : /* DPP0 */
567
+ REG_UPDATE (DOMAIN1_PG_CONFIG ,
568
+ DOMAIN1_POWER_GATE , power_gate );
569
+
570
+ REG_WAIT (DOMAIN1_PG_STATUS ,
571
+ DOMAIN1_PGFSM_PWR_STATUS , pwr_status ,
572
+ 1 , 1000 );
573
+ break ;
574
+ case 1 : /* DPP1 */
575
+ REG_UPDATE (DOMAIN3_PG_CONFIG ,
576
+ DOMAIN3_POWER_GATE , power_gate );
577
+
578
+ REG_WAIT (DOMAIN3_PG_STATUS ,
579
+ DOMAIN3_PGFSM_PWR_STATUS , pwr_status ,
580
+ 1 , 1000 );
581
+ break ;
582
+ case 2 : /* DPP2 */
583
+ REG_UPDATE (DOMAIN5_PG_CONFIG ,
584
+ DOMAIN5_POWER_GATE , power_gate );
585
+
586
+ REG_WAIT (DOMAIN5_PG_STATUS ,
587
+ DOMAIN5_PGFSM_PWR_STATUS , pwr_status ,
588
+ 1 , 1000 );
589
+ break ;
590
+ case 3 : /* DPP3 */
591
+ REG_UPDATE (DOMAIN7_PG_CONFIG ,
592
+ DOMAIN7_POWER_GATE , power_gate );
593
+
594
+ REG_WAIT (DOMAIN7_PG_STATUS ,
595
+ DOMAIN7_PGFSM_PWR_STATUS , pwr_status ,
596
+ 1 , 1000 );
597
+ break ;
598
+ default :
599
+ BREAK_TO_DEBUGGER ();
600
+ break ;
601
+ }
602
+ }
0 commit comments