@@ -445,6 +445,21 @@ static void populate_dml21_timing_config_from_stream_state(struct dml2_timing_cf
445445 timing -> vblank_nom = timing -> v_total - timing -> v_active ;
446446}
447447
448+ /**
449+ * adjust_dml21_hblank_timing_config_from_pipe_ctx - Adjusts the horizontal blanking timing configuration
450+ * based on the pipe context.
451+ * @timing: Pointer to the dml2_timing_cfg structure to be adjusted.
452+ * @pipe: Pointer to the pipe_ctx structure containing the horizontal blanking borrow value.
453+ *
454+ * This function modifies the horizontal active and blank end timings by adding and subtracting
455+ * the horizontal blanking borrow value from the pipe context, respectively.
456+ */
457+ static void adjust_dml21_hblank_timing_config_from_pipe_ctx (struct dml2_timing_cfg * timing , struct pipe_ctx * pipe )
458+ {
459+ timing -> h_active += pipe -> hblank_borrow ;
460+ timing -> h_blank_end -= pipe -> hblank_borrow ;
461+ }
462+
448463static void populate_dml21_output_config_from_stream_state (struct dml2_link_output_cfg * output ,
449464 struct dc_stream_state * stream , const struct pipe_ctx * pipe )
450465{
@@ -732,6 +747,7 @@ static const struct scaler_data *get_scaler_data_for_plane(
732747 temp_pipe -> plane_state = pipe -> plane_state ;
733748 temp_pipe -> plane_res .scl_data .taps = pipe -> plane_res .scl_data .taps ;
734749 temp_pipe -> stream_res = pipe -> stream_res ;
750+ temp_pipe -> hblank_borrow = pipe -> hblank_borrow ;
735751 dml_ctx -> config .callbacks .build_scaling_params (temp_pipe );
736752 break ;
737753 }
@@ -996,6 +1012,7 @@ bool dml21_map_dc_state_into_dml_display_cfg(const struct dc *in_dc, struct dc_s
9961012
9971013 ASSERT (disp_cfg_stream_location >= 0 && disp_cfg_stream_location <= __DML2_WRAPPER_MAX_STREAMS_PLANES__ );
9981014 populate_dml21_timing_config_from_stream_state (& dml_dispcfg -> stream_descriptors [disp_cfg_stream_location ].timing , context -> streams [stream_index ], dml_ctx );
1015+ adjust_dml21_hblank_timing_config_from_pipe_ctx (& dml_dispcfg -> stream_descriptors [disp_cfg_stream_location ].timing , & context -> res_ctx .pipe_ctx [stream_index ]);
9991016 populate_dml21_output_config_from_stream_state (& dml_dispcfg -> stream_descriptors [disp_cfg_stream_location ].output , context -> streams [stream_index ], & context -> res_ctx .pipe_ctx [stream_index ]);
10001017 populate_dml21_stream_overrides_from_stream_state (& dml_dispcfg -> stream_descriptors [disp_cfg_stream_location ], context -> streams [stream_index ]);
10011018
@@ -1134,12 +1151,12 @@ void dml21_populate_pipe_ctx_dlg_params(struct dml2_context *dml_ctx, struct dc_
11341151 struct dc_crtc_timing * timing = & pipe_ctx -> stream -> timing ;
11351152 union dml2_global_sync_programming * global_sync = & stream_programming -> global_sync ;
11361153
1137- hactive = timing -> h_addressable + timing -> h_border_left + timing -> h_border_right ;
1154+ hactive = timing -> h_addressable + timing -> h_border_left + timing -> h_border_right + pipe_ctx -> hblank_borrow ;
11381155 vactive = timing -> v_addressable + timing -> v_border_bottom + timing -> v_border_top ;
11391156 hblank_start = pipe_ctx -> stream -> timing .h_total - pipe_ctx -> stream -> timing .h_front_porch ;
11401157 vblank_start = pipe_ctx -> stream -> timing .v_total - pipe_ctx -> stream -> timing .v_front_porch ;
11411158
1142- hblank_end = hblank_start - timing -> h_addressable - timing -> h_border_left - timing -> h_border_right ;
1159+ hblank_end = hblank_start - timing -> h_addressable - timing -> h_border_left - timing -> h_border_right - pipe_ctx -> hblank_borrow ;
11431160 vblank_end = vblank_start - timing -> v_addressable - timing -> v_border_top - timing -> v_border_bottom ;
11441161
11451162 if (dml_ctx -> config .svp_pstate .callbacks .get_pipe_subvp_type (context , pipe_ctx ) == SUBVP_PHANTOM ) {
0 commit comments