@@ -142,108 +142,21 @@ int dml21_find_dc_pipes_for_plane(const struct dc *in_dc,
142142 return num_pipes ;
143143}
144144
145-
146- void dml21_update_pipe_ctx_dchub_regs (struct dml2_display_rq_regs * rq_regs ,
147- struct dml2_display_dlg_regs * disp_dlg_regs ,
148- struct dml2_display_ttu_regs * disp_ttu_regs ,
149- struct pipe_ctx * out )
145+ void dml21_pipe_populate_global_sync (struct dml2_context * dml_ctx ,
146+ struct dc_state * context ,
147+ struct pipe_ctx * pipe_ctx ,
148+ struct dml2_per_stream_programming * stream_programming )
150149{
151- memset (& out -> rq_regs , 0 , sizeof (out -> rq_regs ));
152- out -> rq_regs .rq_regs_l .chunk_size = rq_regs -> rq_regs_l .chunk_size ;
153- out -> rq_regs .rq_regs_l .min_chunk_size = rq_regs -> rq_regs_l .min_chunk_size ;
154- //out->rq_regs.rq_regs_l.meta_chunk_size = rq_regs->rq_regs_l.meta_chunk_size;
155- //out->rq_regs.rq_regs_l.min_meta_chunk_size = rq_regs->rq_regs_l.min_meta_chunk_size;
156- out -> rq_regs .rq_regs_l .dpte_group_size = rq_regs -> rq_regs_l .dpte_group_size ;
157- out -> rq_regs .rq_regs_l .mpte_group_size = rq_regs -> rq_regs_l .mpte_group_size ;
158- out -> rq_regs .rq_regs_l .swath_height = rq_regs -> rq_regs_l .swath_height ;
159- out -> rq_regs .rq_regs_l .pte_row_height_linear = rq_regs -> rq_regs_l .pte_row_height_linear ;
160-
161- out -> rq_regs .rq_regs_c .chunk_size = rq_regs -> rq_regs_c .chunk_size ;
162- out -> rq_regs .rq_regs_c .min_chunk_size = rq_regs -> rq_regs_c .min_chunk_size ;
163- //out->rq_regs.rq_regs_c.meta_chunk_size = rq_regs->rq_regs_c.meta_chunk_size;
164- //out->rq_regs.rq_regs_c.min_meta_chunk_size = rq_regs->rq_regs_c.min_meta_chunk_size;
165- out -> rq_regs .rq_regs_c .dpte_group_size = rq_regs -> rq_regs_c .dpte_group_size ;
166- out -> rq_regs .rq_regs_c .mpte_group_size = rq_regs -> rq_regs_c .mpte_group_size ;
167- out -> rq_regs .rq_regs_c .swath_height = rq_regs -> rq_regs_c .swath_height ;
168- out -> rq_regs .rq_regs_c .pte_row_height_linear = rq_regs -> rq_regs_c .pte_row_height_linear ;
169-
170- out -> rq_regs .drq_expansion_mode = rq_regs -> drq_expansion_mode ;
171- out -> rq_regs .prq_expansion_mode = rq_regs -> prq_expansion_mode ;
172- //out->rq_regs.mrq_expansion_mode = rq_regs->mrq_expansion_mode;
173- out -> rq_regs .crq_expansion_mode = rq_regs -> crq_expansion_mode ;
174- out -> rq_regs .plane1_base_address = rq_regs -> plane1_base_address ;
175- out -> unbounded_req = rq_regs -> unbounded_request_enabled ;
176-
177- memset (& out -> dlg_regs , 0 , sizeof (out -> dlg_regs ));
178- out -> dlg_regs .refcyc_h_blank_end = disp_dlg_regs -> refcyc_h_blank_end ;
179- out -> dlg_regs .dlg_vblank_end = disp_dlg_regs -> dlg_vblank_end ;
180- out -> dlg_regs .min_dst_y_next_start = disp_dlg_regs -> min_dst_y_next_start ;
181- out -> dlg_regs .refcyc_per_htotal = disp_dlg_regs -> refcyc_per_htotal ;
182- out -> dlg_regs .refcyc_x_after_scaler = disp_dlg_regs -> refcyc_x_after_scaler ;
183- out -> dlg_regs .dst_y_after_scaler = disp_dlg_regs -> dst_y_after_scaler ;
184- out -> dlg_regs .dst_y_prefetch = disp_dlg_regs -> dst_y_prefetch ;
185- out -> dlg_regs .dst_y_per_vm_vblank = disp_dlg_regs -> dst_y_per_vm_vblank ;
186- out -> dlg_regs .dst_y_per_row_vblank = disp_dlg_regs -> dst_y_per_row_vblank ;
187- out -> dlg_regs .dst_y_per_vm_flip = disp_dlg_regs -> dst_y_per_vm_flip ;
188- out -> dlg_regs .dst_y_per_row_flip = disp_dlg_regs -> dst_y_per_row_flip ;
189- out -> dlg_regs .ref_freq_to_pix_freq = disp_dlg_regs -> ref_freq_to_pix_freq ;
190- out -> dlg_regs .vratio_prefetch = disp_dlg_regs -> vratio_prefetch ;
191- out -> dlg_regs .vratio_prefetch_c = disp_dlg_regs -> vratio_prefetch_c ;
192- out -> dlg_regs .refcyc_per_tdlut_group = disp_dlg_regs -> refcyc_per_tdlut_group ;
193- out -> dlg_regs .refcyc_per_pte_group_vblank_l = disp_dlg_regs -> refcyc_per_pte_group_vblank_l ;
194- out -> dlg_regs .refcyc_per_pte_group_vblank_c = disp_dlg_regs -> refcyc_per_pte_group_vblank_c ;
195- //out->dlg_regs.refcyc_per_meta_chunk_vblank_l = disp_dlg_regs->refcyc_per_meta_chunk_vblank_l;
196- //out->dlg_regs.refcyc_per_meta_chunk_vblank_c = disp_dlg_regs->refcyc_per_meta_chunk_vblank_c;
197- out -> dlg_regs .refcyc_per_pte_group_flip_l = disp_dlg_regs -> refcyc_per_pte_group_flip_l ;
198- out -> dlg_regs .refcyc_per_pte_group_flip_c = disp_dlg_regs -> refcyc_per_pte_group_flip_c ;
199- //out->dlg_regs.refcyc_per_meta_chunk_flip_l = disp_dlg_regs->refcyc_per_meta_chunk_flip_l;
200- //out->dlg_regs.refcyc_per_meta_chunk_flip_c = disp_dlg_regs->refcyc_per_meta_chunk_flip_c;
201- out -> dlg_regs .dst_y_per_pte_row_nom_l = disp_dlg_regs -> dst_y_per_pte_row_nom_l ;
202- out -> dlg_regs .dst_y_per_pte_row_nom_c = disp_dlg_regs -> dst_y_per_pte_row_nom_c ;
203- out -> dlg_regs .refcyc_per_pte_group_nom_l = disp_dlg_regs -> refcyc_per_pte_group_nom_l ;
204- out -> dlg_regs .refcyc_per_pte_group_nom_c = disp_dlg_regs -> refcyc_per_pte_group_nom_c ;
205- //out->dlg_regs.dst_y_per_meta_row_nom_l = disp_dlg_regs->dst_y_per_meta_row_nom_l;
206- //out->dlg_regs.dst_y_per_meta_row_nom_c = disp_dlg_regs->dst_y_per_meta_row_nom_c;
207- //out->dlg_regs.refcyc_per_meta_chunk_nom_l = disp_dlg_regs->refcyc_per_meta_chunk_nom_l;
208- //out->dlg_regs.refcyc_per_meta_chunk_nom_c = disp_dlg_regs->refcyc_per_meta_chunk_nom_c;
209- out -> dlg_regs .refcyc_per_line_delivery_pre_l = disp_dlg_regs -> refcyc_per_line_delivery_pre_l ;
210- out -> dlg_regs .refcyc_per_line_delivery_pre_c = disp_dlg_regs -> refcyc_per_line_delivery_pre_c ;
211- out -> dlg_regs .refcyc_per_line_delivery_l = disp_dlg_regs -> refcyc_per_line_delivery_l ;
212- out -> dlg_regs .refcyc_per_line_delivery_c = disp_dlg_regs -> refcyc_per_line_delivery_c ;
213- out -> dlg_regs .refcyc_per_vm_group_vblank = disp_dlg_regs -> refcyc_per_vm_group_vblank ;
214- out -> dlg_regs .refcyc_per_vm_group_flip = disp_dlg_regs -> refcyc_per_vm_group_flip ;
215- out -> dlg_regs .refcyc_per_vm_req_vblank = disp_dlg_regs -> refcyc_per_vm_req_vblank ;
216- out -> dlg_regs .refcyc_per_vm_req_flip = disp_dlg_regs -> refcyc_per_vm_req_flip ;
217- out -> dlg_regs .dst_y_offset_cur0 = disp_dlg_regs -> dst_y_offset_cur0 ;
218- out -> dlg_regs .chunk_hdl_adjust_cur0 = disp_dlg_regs -> chunk_hdl_adjust_cur0 ;
219- //out->dlg_regs.dst_y_offset_cur1 = disp_dlg_regs->dst_y_offset_cur1;
220- //out->dlg_regs.chunk_hdl_adjust_cur1 = disp_dlg_regs->chunk_hdl_adjust_cur1;
221- out -> dlg_regs .vready_after_vcount0 = disp_dlg_regs -> vready_after_vcount0 ;
222- out -> dlg_regs .dst_y_delta_drq_limit = disp_dlg_regs -> dst_y_delta_drq_limit ;
223- out -> dlg_regs .refcyc_per_vm_dmdata = disp_dlg_regs -> refcyc_per_vm_dmdata ;
224- out -> dlg_regs .dmdata_dl_delta = disp_dlg_regs -> dmdata_dl_delta ;
225-
226- memset (& out -> ttu_regs , 0 , sizeof (out -> ttu_regs ));
227- out -> ttu_regs .qos_level_low_wm = disp_ttu_regs -> qos_level_low_wm ;
228- out -> ttu_regs .qos_level_high_wm = disp_ttu_regs -> qos_level_high_wm ;
229- out -> ttu_regs .min_ttu_vblank = disp_ttu_regs -> min_ttu_vblank ;
230- out -> ttu_regs .qos_level_flip = disp_ttu_regs -> qos_level_flip ;
231- out -> ttu_regs .refcyc_per_req_delivery_l = disp_ttu_regs -> refcyc_per_req_delivery_l ;
232- out -> ttu_regs .refcyc_per_req_delivery_c = disp_ttu_regs -> refcyc_per_req_delivery_c ;
233- out -> ttu_regs .refcyc_per_req_delivery_cur0 = disp_ttu_regs -> refcyc_per_req_delivery_cur0 ;
234- //out->ttu_regs.refcyc_per_req_delivery_cur1 = disp_ttu_regs->refcyc_per_req_delivery_cur1;
235- out -> ttu_regs .refcyc_per_req_delivery_pre_l = disp_ttu_regs -> refcyc_per_req_delivery_pre_l ;
236- out -> ttu_regs .refcyc_per_req_delivery_pre_c = disp_ttu_regs -> refcyc_per_req_delivery_pre_c ;
237- out -> ttu_regs .refcyc_per_req_delivery_pre_cur0 = disp_ttu_regs -> refcyc_per_req_delivery_pre_cur0 ;
238- //out->ttu_regs.refcyc_per_req_delivery_pre_cur1 = disp_ttu_regs->refcyc_per_req_delivery_pre_cur1;
239- out -> ttu_regs .qos_level_fixed_l = disp_ttu_regs -> qos_level_fixed_l ;
240- out -> ttu_regs .qos_level_fixed_c = disp_ttu_regs -> qos_level_fixed_c ;
241- out -> ttu_regs .qos_level_fixed_cur0 = disp_ttu_regs -> qos_level_fixed_cur0 ;
242- //out->ttu_regs.qos_level_fixed_cur1 = disp_ttu_regs->qos_level_fixed_cur1;
243- out -> ttu_regs .qos_ramp_disable_l = disp_ttu_regs -> qos_ramp_disable_l ;
244- out -> ttu_regs .qos_ramp_disable_c = disp_ttu_regs -> qos_ramp_disable_c ;
245- out -> ttu_regs .qos_ramp_disable_cur0 = disp_ttu_regs -> qos_ramp_disable_cur0 ;
246- //out->ttu_regs.qos_ramp_disable_cur1 = disp_ttu_regs->qos_ramp_disable_cur1;
150+ union dml2_global_sync_programming * global_sync = & stream_programming -> global_sync ;
151+
152+ if (dml_ctx -> config .svp_pstate .callbacks .get_pipe_subvp_type (context , pipe_ctx ) == SUBVP_PHANTOM ) {
153+ /* phantom has its own global sync */
154+ global_sync = & stream_programming -> phantom_stream .global_sync ;
155+ }
156+
157+ memcpy (& pipe_ctx -> global_sync ,
158+ global_sync ,
159+ sizeof (union dml2_global_sync_programming ));
247160}
248161
249162void dml21_populate_mall_allocation_size (struct dc_state * context ,
@@ -301,28 +214,16 @@ void dml21_program_dc_pipe(struct dml2_context *dml_ctx, struct dc_state *contex
301214{
302215 unsigned int pipe_reg_index = 0 ;
303216
304- dml21_populate_pipe_ctx_dlg_params (dml_ctx , context , pipe_ctx , stream_prog );
217+ dml21_pipe_populate_global_sync (dml_ctx , context , pipe_ctx , stream_prog );
305218 find_pipe_regs_idx (dml_ctx , pipe_ctx , & pipe_reg_index );
306219
307220 if (dml_ctx -> config .svp_pstate .callbacks .get_pipe_subvp_type (context , pipe_ctx ) == SUBVP_PHANTOM ) {
308221 memcpy (& pipe_ctx -> hubp_regs , pln_prog -> phantom_plane .pipe_regs [pipe_reg_index ], sizeof (struct dml2_dchub_per_pipe_register_set ));
309222 pipe_ctx -> unbounded_req = false;
310-
311- /* legacy only, should be removed later */
312- dml21_update_pipe_ctx_dchub_regs (& pln_prog -> phantom_plane .pipe_regs [pipe_reg_index ]-> rq_regs ,
313- & pln_prog -> phantom_plane .pipe_regs [pipe_reg_index ]-> dlg_regs ,
314- & pln_prog -> phantom_plane .pipe_regs [pipe_reg_index ]-> ttu_regs , pipe_ctx );
315-
316223 pipe_ctx -> det_buffer_size_kb = 0 ;
317224 } else {
318225 memcpy (& pipe_ctx -> hubp_regs , pln_prog -> pipe_regs [pipe_reg_index ], sizeof (struct dml2_dchub_per_pipe_register_set ));
319226 pipe_ctx -> unbounded_req = pln_prog -> pipe_regs [pipe_reg_index ]-> rq_regs .unbounded_request_enabled ;
320-
321- /* legacy only, should be removed later */
322- dml21_update_pipe_ctx_dchub_regs (& pln_prog -> pipe_regs [pipe_reg_index ]-> rq_regs ,
323- & pln_prog -> pipe_regs [pipe_reg_index ]-> dlg_regs ,
324- & pln_prog -> pipe_regs [pipe_reg_index ]-> ttu_regs , pipe_ctx );
325-
326227 pipe_ctx -> det_buffer_size_kb = pln_prog -> pipe_regs [pipe_reg_index ]-> det_size * 64 ;
327228 }
328229
0 commit comments