@@ -210,36 +210,41 @@ int dpu_core_perf_crtc_check(struct drm_crtc *crtc,
210
210
return 0 ;
211
211
}
212
212
213
- static int _dpu_core_perf_crtc_update_bus (struct dpu_kms * kms ,
214
- struct drm_crtc * crtc )
213
+ static void dpu_core_perf_aggregate (struct drm_device * ddev ,
214
+ enum dpu_crtc_client_type curr_client_type ,
215
+ struct dpu_core_perf_params * perf )
215
216
{
216
- struct dpu_core_perf_params perf = { 0 };
217
- enum dpu_crtc_client_type curr_client_type
218
- = dpu_crtc_get_client_type (crtc );
219
- struct drm_crtc * tmp_crtc ;
220
217
struct dpu_crtc_state * dpu_cstate ;
221
- int i , ret = 0 ;
222
- u64 avg_bw ;
223
-
224
- if (!kms -> num_paths )
225
- return 0 ;
218
+ struct drm_crtc * tmp_crtc ;
226
219
227
- drm_for_each_crtc (tmp_crtc , crtc -> dev ) {
220
+ drm_for_each_crtc (tmp_crtc , ddev ) {
228
221
if (tmp_crtc -> enabled &&
229
- curr_client_type ==
230
- dpu_crtc_get_client_type (tmp_crtc )) {
222
+ curr_client_type == dpu_crtc_get_client_type (tmp_crtc )) {
231
223
dpu_cstate = to_dpu_crtc_state (tmp_crtc -> state );
232
224
233
- perf . max_per_pipe_ib = max (perf . max_per_pipe_ib ,
234
- dpu_cstate -> new_perf .max_per_pipe_ib );
225
+ perf -> max_per_pipe_ib = max (perf -> max_per_pipe_ib ,
226
+ dpu_cstate -> new_perf .max_per_pipe_ib );
235
227
236
- perf . bw_ctl += dpu_cstate -> new_perf .bw_ctl ;
228
+ perf -> bw_ctl += dpu_cstate -> new_perf .bw_ctl ;
237
229
238
- DRM_DEBUG_ATOMIC ("crtc=%d bw=%llu paths:%d \n" ,
239
- tmp_crtc -> base .id ,
240
- dpu_cstate -> new_perf .bw_ctl , kms -> num_paths );
230
+ DRM_DEBUG_ATOMIC ("crtc=%d bw=%llu\n" ,
231
+ tmp_crtc -> base .id ,
232
+ dpu_cstate -> new_perf .bw_ctl );
241
233
}
242
234
}
235
+ }
236
+
237
+ static int _dpu_core_perf_crtc_update_bus (struct dpu_kms * kms ,
238
+ struct drm_crtc * crtc )
239
+ {
240
+ struct dpu_core_perf_params perf = { 0 };
241
+ int i , ret = 0 ;
242
+ u64 avg_bw ;
243
+
244
+ if (!kms -> num_paths )
245
+ return 0 ;
246
+
247
+ dpu_core_perf_aggregate (crtc -> dev , dpu_crtc_get_client_type (crtc ), & perf );
243
248
244
249
avg_bw = perf .bw_ctl ;
245
250
do_div (avg_bw , (kms -> num_paths * 1000 )); /*Bps_to_icc*/
0 commit comments