@@ -417,6 +417,8 @@ bool dc_stream_adjust_vmin_vmax(struct dc *dc,
417417 if (!memcmp (& stream -> adjust , adjust , sizeof (* adjust )))
418418 return true;
419419
420+ dc_exit_ips_for_hw_access (dc );
421+
420422 stream -> adjust .v_total_max = adjust -> v_total_max ;
421423 stream -> adjust .v_total_mid = adjust -> v_total_mid ;
422424 stream -> adjust .v_total_mid_frame_num = adjust -> v_total_mid_frame_num ;
@@ -457,6 +459,8 @@ bool dc_stream_get_last_used_drr_vtotal(struct dc *dc,
457459
458460 int i = 0 ;
459461
462+ dc_exit_ips_for_hw_access (dc );
463+
460464 for (i = 0 ; i < MAX_PIPES ; i ++ ) {
461465 struct pipe_ctx * pipe = & dc -> current_state -> res_ctx .pipe_ctx [i ];
462466
@@ -487,6 +491,8 @@ bool dc_stream_get_crtc_position(struct dc *dc,
487491 bool ret = false;
488492 struct crtc_position position ;
489493
494+ dc_exit_ips_for_hw_access (dc );
495+
490496 for (i = 0 ; i < MAX_PIPES ; i ++ ) {
491497 struct pipe_ctx * pipe =
492498 & dc -> current_state -> res_ctx .pipe_ctx [i ];
@@ -606,6 +612,8 @@ bool dc_stream_configure_crc(struct dc *dc, struct dc_stream_state *stream,
606612 if (pipe == NULL )
607613 return false;
608614
615+ dc_exit_ips_for_hw_access (dc );
616+
609617 /* By default, capture the full frame */
610618 param .windowa_x_start = 0 ;
611619 param .windowa_y_start = 0 ;
@@ -665,6 +673,8 @@ bool dc_stream_get_crc(struct dc *dc, struct dc_stream_state *stream,
665673 struct pipe_ctx * pipe ;
666674 struct timing_generator * tg ;
667675
676+ dc_exit_ips_for_hw_access (dc );
677+
668678 for (i = 0 ; i < MAX_PIPES ; i ++ ) {
669679 pipe = & dc -> current_state -> res_ctx .pipe_ctx [i ];
670680 if (pipe -> stream == stream )
@@ -689,6 +699,8 @@ void dc_stream_set_dyn_expansion(struct dc *dc, struct dc_stream_state *stream,
689699 int i ;
690700 struct pipe_ctx * pipe_ctx ;
691701
702+ dc_exit_ips_for_hw_access (dc );
703+
692704 for (i = 0 ; i < MAX_PIPES ; i ++ ) {
693705 if (dc -> current_state -> res_ctx .pipe_ctx [i ].stream
694706 == stream ) {
@@ -724,6 +736,8 @@ void dc_stream_set_dither_option(struct dc_stream_state *stream,
724736 if (option > DITHER_OPTION_MAX )
725737 return ;
726738
739+ dc_exit_ips_for_hw_access (stream -> ctx -> dc );
740+
727741 stream -> dither_option = option ;
728742
729743 memset (& params , 0 , sizeof (params ));
@@ -748,6 +762,8 @@ bool dc_stream_set_gamut_remap(struct dc *dc, const struct dc_stream_state *stre
748762 bool ret = false;
749763 struct pipe_ctx * pipes ;
750764
765+ dc_exit_ips_for_hw_access (dc );
766+
751767 for (i = 0 ; i < MAX_PIPES ; i ++ ) {
752768 if (dc -> current_state -> res_ctx .pipe_ctx [i ].stream == stream ) {
753769 pipes = & dc -> current_state -> res_ctx .pipe_ctx [i ];
@@ -765,6 +781,8 @@ bool dc_stream_program_csc_matrix(struct dc *dc, struct dc_stream_state *stream)
765781 bool ret = false;
766782 struct pipe_ctx * pipes ;
767783
784+ dc_exit_ips_for_hw_access (dc );
785+
768786 for (i = 0 ; i < MAX_PIPES ; i ++ ) {
769787 if (dc -> current_state -> res_ctx .pipe_ctx [i ].stream
770788 == stream ) {
@@ -791,6 +809,8 @@ void dc_stream_set_static_screen_params(struct dc *dc,
791809 struct pipe_ctx * pipes_affected [MAX_PIPES ];
792810 int num_pipes_affected = 0 ;
793811
812+ dc_exit_ips_for_hw_access (dc );
813+
794814 for (i = 0 ; i < num_streams ; i ++ ) {
795815 struct dc_stream_state * stream = streams [i ];
796816
@@ -1769,6 +1789,8 @@ void dc_enable_stereo(
17691789 int i , j ;
17701790 struct pipe_ctx * pipe ;
17711791
1792+ dc_exit_ips_for_hw_access (dc );
1793+
17721794 for (i = 0 ; i < MAX_PIPES ; i ++ ) {
17731795 if (context != NULL ) {
17741796 pipe = & context -> res_ctx .pipe_ctx [i ];
@@ -1788,6 +1810,8 @@ void dc_enable_stereo(
17881810void dc_trigger_sync (struct dc * dc , struct dc_state * context )
17891811{
17901812 if (context -> stream_count > 1 && !dc -> debug .disable_timing_sync ) {
1813+ dc_exit_ips_for_hw_access (dc );
1814+
17911815 enable_timing_multisync (dc , context );
17921816 program_timing_sync (dc , context );
17931817 }
@@ -2044,6 +2068,8 @@ enum dc_status dc_commit_streams(struct dc *dc,
20442068 if (!streams_changed (dc , streams , stream_count ))
20452069 return res ;
20462070
2071+ dc_exit_ips_for_hw_access (dc );
2072+
20472073 DC_LOG_DC ("%s: %d streams\n" , __func__ , stream_count );
20482074
20492075 for (i = 0 ; i < stream_count ; i ++ ) {
@@ -3373,6 +3399,8 @@ static void commit_planes_for_stream_fast(struct dc *dc,
33733399 int i , j ;
33743400 struct pipe_ctx * top_pipe_to_program = NULL ;
33753401 struct dc_stream_status * stream_status = NULL ;
3402+ dc_exit_ips_for_hw_access (dc );
3403+
33763404 dc_z10_restore (dc );
33773405
33783406 top_pipe_to_program = resource_get_otg_master_for_stream (
@@ -3527,6 +3555,8 @@ static void commit_planes_for_stream(struct dc *dc,
35273555 // dc->current_state anymore, so we have to cache it before we apply
35283556 // the new SubVP context
35293557 subvp_prev_use = false;
3558+ dc_exit_ips_for_hw_access (dc );
3559+
35303560 dc_z10_restore (dc );
35313561 if (update_type == UPDATE_TYPE_FULL )
35323562 wait_for_outstanding_hw_updates (dc , context );
@@ -4409,6 +4439,8 @@ bool dc_update_planes_and_stream(struct dc *dc,
44094439 bool is_plane_addition = 0 ;
44104440 bool is_fast_update_only ;
44114441
4442+ dc_exit_ips_for_hw_access (dc );
4443+
44124444 populate_fast_updates (fast_update , srf_updates , surface_count , stream_update );
44134445 is_fast_update_only = fast_update_only (dc , fast_update , srf_updates ,
44144446 surface_count , stream_update , stream );
@@ -4529,6 +4561,8 @@ void dc_commit_updates_for_stream(struct dc *dc,
45294561 int i , j ;
45304562 struct dc_fast_update fast_update [MAX_SURFACES ] = {0 };
45314563
4564+ dc_exit_ips_for_hw_access (dc );
4565+
45324566 populate_fast_updates (fast_update , srf_updates , surface_count , stream_update );
45334567 stream_status = dc_stream_get_status (stream );
45344568 context = dc -> current_state ;
@@ -4713,6 +4747,8 @@ void dc_set_power_state(
47134747 case DC_ACPI_CM_POWER_STATE_D0 :
47144748 dc_state_construct (dc , dc -> current_state );
47154749
4750+ dc_exit_ips_for_hw_access (dc );
4751+
47164752 dc_z10_restore (dc );
47174753
47184754 dc -> hwss .init_hw (dc );
@@ -4854,6 +4890,12 @@ void dc_allow_idle_optimizations(struct dc *dc, bool allow)
48544890 dc -> idle_optimizations_allowed = allow ;
48554891}
48564892
4893+ void dc_exit_ips_for_hw_access (struct dc * dc )
4894+ {
4895+ if (dc -> caps .ips_support )
4896+ dc_allow_idle_optimizations (dc , false);
4897+ }
4898+
48574899bool dc_dmub_is_ips_idle_state (struct dc * dc )
48584900{
48594901 uint32_t idle_state = 0 ;
0 commit comments