Lines Matching refs:data
78 struct bw_calcs_data *data) in calculate_bandwidth() argument
170 if (data->d0_underlay_mode == bw_def_none) in calculate_bandwidth()
174 if (data->d1_underlay_mode == bw_def_none) in calculate_bandwidth()
178 data->number_of_underlay_surfaces = d0_underlay_enable + d1_underlay_enable; in calculate_bandwidth()
179 switch (data->underlay_surface_type) { in calculate_bandwidth()
183 data->bytes_per_pixel[0] = 1; in calculate_bandwidth()
184 data->bytes_per_pixel[2] = 1; in calculate_bandwidth()
187 data->bytes_per_pixel[1] = 2; in calculate_bandwidth()
188 data->bytes_per_pixel[3] = 2; in calculate_bandwidth()
189 data->lb_size_per_component[0] = dceip->underlay420_luma_lb_size_per_component; in calculate_bandwidth()
190 data->lb_size_per_component[1] = dceip->underlay420_chroma_lb_size_per_component; in calculate_bandwidth()
191 data->lb_size_per_component[2] = dceip->underlay420_luma_lb_size_per_component; in calculate_bandwidth()
192 data->lb_size_per_component[3] = dceip->underlay420_chroma_lb_size_per_component; in calculate_bandwidth()
197 data->bytes_per_pixel[0] = 2; in calculate_bandwidth()
198 data->bytes_per_pixel[2] = 2; in calculate_bandwidth()
199 data->lb_size_per_component[0] = dceip->underlay422_lb_size_per_component; in calculate_bandwidth()
200 data->lb_size_per_component[2] = dceip->underlay422_lb_size_per_component; in calculate_bandwidth()
205 data->bytes_per_pixel[0] = 4; in calculate_bandwidth()
206 data->bytes_per_pixel[2] = 4; in calculate_bandwidth()
207 data->lb_size_per_component[0] = dceip->lb_size_per_component444; in calculate_bandwidth()
208 data->lb_size_per_component[2] = dceip->lb_size_per_component444; in calculate_bandwidth()
212 switch (data->underlay_surface_type) { in calculate_bandwidth()
214 data->enable[0] = 1; in calculate_bandwidth()
215 data->enable[1] = 1; in calculate_bandwidth()
218 data->enable[0] = 1; in calculate_bandwidth()
219 data->enable[1] = 0; in calculate_bandwidth()
224 data->enable[0] = 0; in calculate_bandwidth()
225 data->enable[1] = 0; in calculate_bandwidth()
228 switch (data->underlay_surface_type) { in calculate_bandwidth()
230 data->enable[2] = 1; in calculate_bandwidth()
231 data->enable[3] = 1; in calculate_bandwidth()
234 data->enable[2] = 1; in calculate_bandwidth()
235 data->enable[3] = 0; in calculate_bandwidth()
240 data->enable[2] = 0; in calculate_bandwidth()
241 data->enable[3] = 0; in calculate_bandwidth()
243 data->use_alpha[0] = 0; in calculate_bandwidth()
244 data->use_alpha[1] = 0; in calculate_bandwidth()
245 data->use_alpha[2] = 0; in calculate_bandwidth()
246 data->use_alpha[3] = 0; in calculate_bandwidth()
247 data->scatter_gather_enable_for_pipe[0] = vbios->scatter_gather_enable; in calculate_bandwidth()
248 data->scatter_gather_enable_for_pipe[1] = vbios->scatter_gather_enable; in calculate_bandwidth()
249 data->scatter_gather_enable_for_pipe[2] = vbios->scatter_gather_enable; in calculate_bandwidth()
250 data->scatter_gather_enable_for_pipe[3] = vbios->scatter_gather_enable; in calculate_bandwidth()
252 data->interlace_mode[0] = data->interlace_mode[4]; in calculate_bandwidth()
253 data->interlace_mode[1] = data->interlace_mode[4]; in calculate_bandwidth()
255 data->interlace_mode[2] = data->interlace_mode[5]; in calculate_bandwidth()
256 data->interlace_mode[3] = data->interlace_mode[5]; in calculate_bandwidth()
258 data->h_total[0] = data->h_total[4]; in calculate_bandwidth()
259 data->v_total[0] = data->v_total[4]; in calculate_bandwidth()
260 data->h_total[1] = data->h_total[4]; in calculate_bandwidth()
261 data->v_total[1] = data->v_total[4]; in calculate_bandwidth()
263 data->h_total[2] = data->h_total[5]; in calculate_bandwidth()
264 data->v_total[2] = data->v_total[5]; in calculate_bandwidth()
265 data->h_total[3] = data->h_total[5]; in calculate_bandwidth()
266 data->v_total[3] = data->v_total[5]; in calculate_bandwidth()
268 data->pixel_rate[0] = data->pixel_rate[4]; in calculate_bandwidth()
269 data->pixel_rate[1] = data->pixel_rate[4]; in calculate_bandwidth()
271 data->pixel_rate[2] = data->pixel_rate[5]; in calculate_bandwidth()
272 data->pixel_rate[3] = data->pixel_rate[5]; in calculate_bandwidth()
273 …if ((data->underlay_tiling_mode == bw_def_array_linear_general || data->underlay_tiling_mode == bw… in calculate_bandwidth()
285 data->lb_bpc[0] = data->underlay_lb_bpc; in calculate_bandwidth()
286 data->lb_bpc[1] = data->underlay_lb_bpc; in calculate_bandwidth()
287 data->lb_bpc[2] = data->underlay_lb_bpc; in calculate_bandwidth()
288 data->lb_bpc[3] = data->underlay_lb_bpc; in calculate_bandwidth()
289 data->compression_rate[0] = bw_int_to_fixed(1); in calculate_bandwidth()
290 data->compression_rate[1] = bw_int_to_fixed(1); in calculate_bandwidth()
291 data->compression_rate[2] = bw_int_to_fixed(1); in calculate_bandwidth()
292 data->compression_rate[3] = bw_int_to_fixed(1); in calculate_bandwidth()
293 data->access_one_channel_only[0] = 0; in calculate_bandwidth()
294 data->access_one_channel_only[1] = 0; in calculate_bandwidth()
295 data->access_one_channel_only[2] = 0; in calculate_bandwidth()
296 data->access_one_channel_only[3] = 0; in calculate_bandwidth()
297 data->cursor_width_pixels[0] = bw_int_to_fixed(0); in calculate_bandwidth()
298 data->cursor_width_pixels[1] = bw_int_to_fixed(0); in calculate_bandwidth()
299 data->cursor_width_pixels[2] = bw_int_to_fixed(0); in calculate_bandwidth()
300 data->cursor_width_pixels[3] = bw_int_to_fixed(0); in calculate_bandwidth()
305 if (i < data->number_of_displays + 4) { in calculate_bandwidth()
306 if (i == 4 && data->d0_underlay_mode == bw_def_underlay_only) { in calculate_bandwidth()
307 data->enable[i] = 0; in calculate_bandwidth()
308 data->use_alpha[i] = 0; in calculate_bandwidth()
310 else if (i == 4 && data->d0_underlay_mode == bw_def_blend) { in calculate_bandwidth()
311 data->enable[i] = 1; in calculate_bandwidth()
312 data->use_alpha[i] = 1; in calculate_bandwidth()
315 data->enable[i] = 1; in calculate_bandwidth()
316 data->use_alpha[i] = 0; in calculate_bandwidth()
318 else if (i == 5 && data->d1_underlay_mode == bw_def_underlay_only) { in calculate_bandwidth()
319 data->enable[i] = 0; in calculate_bandwidth()
320 data->use_alpha[i] = 0; in calculate_bandwidth()
322 else if (i == 5 && data->d1_underlay_mode == bw_def_blend) { in calculate_bandwidth()
323 data->enable[i] = 1; in calculate_bandwidth()
324 data->use_alpha[i] = 1; in calculate_bandwidth()
327 data->enable[i] = 1; in calculate_bandwidth()
328 data->use_alpha[i] = 0; in calculate_bandwidth()
332 data->enable[i] = 0; in calculate_bandwidth()
333 data->use_alpha[i] = 0; in calculate_bandwidth()
335 data->scatter_gather_enable_for_pipe[i] = vbios->scatter_gather_enable; in calculate_bandwidth()
337 data->lb_size_per_component[i] = dceip->lb_size_per_component444; in calculate_bandwidth()
338 …if (data->graphics_tiling_mode == bw_def_array_linear_general || data->graphics_tiling_mode == bw_… in calculate_bandwidth()
344 data->lb_bpc[i] = data->graphics_lb_bpc; in calculate_bandwidth()
345 …if ((data->fbc_en[i] == 1 && (dceip->argb_compression_support || data->d0_underlay_mode != bw_def_… in calculate_bandwidth()
346 data->compression_rate[i] = bw_int_to_fixed(vbios->average_compression_rate); in calculate_bandwidth()
347 data->access_one_channel_only[i] = data->lpt_en[i]; in calculate_bandwidth()
350 data->compression_rate[i] = bw_int_to_fixed(1); in calculate_bandwidth()
351 data->access_one_channel_only[i] = 0; in calculate_bandwidth()
353 if (data->fbc_en[i] == 1) { in calculate_bandwidth()
355 if (data->lpt_en[i] == 1) { in calculate_bandwidth()
359 data->cursor_width_pixels[i] = bw_int_to_fixed(vbios->cursor_width); in calculate_bandwidth()
362 data->scatter_gather_enable_for_pipe[maximum_number_of_surfaces - 2] = 0; in calculate_bandwidth()
363 data->scatter_gather_enable_for_pipe[maximum_number_of_surfaces - 1] = 0; in calculate_bandwidth()
364 if (data->d1_display_write_back_dwb_enable == 1) { in calculate_bandwidth()
365 data->enable[maximum_number_of_surfaces - 2] = 1; in calculate_bandwidth()
366 data->enable[maximum_number_of_surfaces - 1] = 1; in calculate_bandwidth()
369 data->enable[maximum_number_of_surfaces - 2] = 0; in calculate_bandwidth()
370 data->enable[maximum_number_of_surfaces - 1] = 0; in calculate_bandwidth()
374 …data->lb_size_per_component[maximum_number_of_surfaces - 2] = dceip->underlay420_luma_lb_size_per_… in calculate_bandwidth()
375 …data->lb_size_per_component[maximum_number_of_surfaces - 1] = dceip->underlay420_chroma_lb_size_pe… in calculate_bandwidth()
376 data->bytes_per_pixel[maximum_number_of_surfaces - 2] = 1; in calculate_bandwidth()
377 data->bytes_per_pixel[maximum_number_of_surfaces - 1] = 2; in calculate_bandwidth()
378 data->interlace_mode[maximum_number_of_surfaces - 2] = data->interlace_mode[5]; in calculate_bandwidth()
379 data->interlace_mode[maximum_number_of_surfaces - 1] = data->interlace_mode[5]; in calculate_bandwidth()
380 data->h_taps[maximum_number_of_surfaces - 2] = bw_int_to_fixed(1); in calculate_bandwidth()
381 data->h_taps[maximum_number_of_surfaces - 1] = bw_int_to_fixed(1); in calculate_bandwidth()
382 data->v_taps[maximum_number_of_surfaces - 2] = bw_int_to_fixed(1); in calculate_bandwidth()
383 data->v_taps[maximum_number_of_surfaces - 1] = bw_int_to_fixed(1); in calculate_bandwidth()
384 data->rotation_angle[maximum_number_of_surfaces - 2] = bw_int_to_fixed(0); in calculate_bandwidth()
385 data->rotation_angle[maximum_number_of_surfaces - 1] = bw_int_to_fixed(0); in calculate_bandwidth()
388 data->lb_bpc[maximum_number_of_surfaces - 2] = 8; in calculate_bandwidth()
389 data->lb_bpc[maximum_number_of_surfaces - 1] = 8; in calculate_bandwidth()
390 data->compression_rate[maximum_number_of_surfaces - 2] = bw_int_to_fixed(1); in calculate_bandwidth()
391 data->compression_rate[maximum_number_of_surfaces - 1] = bw_int_to_fixed(1); in calculate_bandwidth()
392 data->access_one_channel_only[maximum_number_of_surfaces - 2] = 0; in calculate_bandwidth()
393 data->access_one_channel_only[maximum_number_of_surfaces - 1] = 0; in calculate_bandwidth()
395 data->h_total[maximum_number_of_surfaces - 2] = data->h_total[5]; in calculate_bandwidth()
396 data->h_total[maximum_number_of_surfaces - 1] = data->h_total[5]; in calculate_bandwidth()
397 data->v_total[maximum_number_of_surfaces - 2] = data->v_total[5]; in calculate_bandwidth()
398 data->v_total[maximum_number_of_surfaces - 1] = data->v_total[5]; in calculate_bandwidth()
399 data->pixel_rate[maximum_number_of_surfaces - 2] = data->pixel_rate[5]; in calculate_bandwidth()
400 data->pixel_rate[maximum_number_of_surfaces - 1] = data->pixel_rate[5]; in calculate_bandwidth()
401 data->src_width[maximum_number_of_surfaces - 2] = data->src_width[5]; in calculate_bandwidth()
402 data->src_width[maximum_number_of_surfaces - 1] = data->src_width[5]; in calculate_bandwidth()
403 data->src_height[maximum_number_of_surfaces - 2] = data->src_height[5]; in calculate_bandwidth()
404 data->src_height[maximum_number_of_surfaces - 1] = data->src_height[5]; in calculate_bandwidth()
405 data->pitch_in_pixels[maximum_number_of_surfaces - 2] = data->src_width[5]; in calculate_bandwidth()
406 data->pitch_in_pixels[maximum_number_of_surfaces - 1] = data->src_width[5]; in calculate_bandwidth()
407 data->h_scale_ratio[maximum_number_of_surfaces - 2] = bw_int_to_fixed(1); in calculate_bandwidth()
408 data->h_scale_ratio[maximum_number_of_surfaces - 1] = bw_int_to_fixed(1); in calculate_bandwidth()
409 data->v_scale_ratio[maximum_number_of_surfaces - 2] = bw_int_to_fixed(1); in calculate_bandwidth()
410 data->v_scale_ratio[maximum_number_of_surfaces - 1] = bw_int_to_fixed(1); in calculate_bandwidth()
411 data->stereo_mode[maximum_number_of_surfaces - 2] = bw_def_mono; in calculate_bandwidth()
412 data->stereo_mode[maximum_number_of_surfaces - 1] = bw_def_mono; in calculate_bandwidth()
413 data->cursor_width_pixels[maximum_number_of_surfaces - 2] = bw_int_to_fixed(0); in calculate_bandwidth()
414 data->cursor_width_pixels[maximum_number_of_surfaces - 1] = bw_int_to_fixed(0); in calculate_bandwidth()
415 data->use_alpha[maximum_number_of_surfaces - 2] = 0; in calculate_bandwidth()
416 data->use_alpha[maximum_number_of_surfaces - 1] = 0; in calculate_bandwidth()
432 if (data->enable[i]) { in calculate_bandwidth()
433 …data->h_scale_ratio[i], bw_int_to_fixed(1)) && bw_equ(data->v_scale_ratio[i], bw_int_to_fixed(1)) … in calculate_bandwidth()
434 data->h_taps[i] = bw_int_to_fixed(1); in calculate_bandwidth()
435 data->v_taps[i] = bw_int_to_fixed(1); in calculate_bandwidth()
438 …data->pitch_in_pixels_after_surface_type[i] = bw_div(data->pitch_in_pixels[i], bw_int_to_fixed(2)); in calculate_bandwidth()
439 data->src_width_after_surface_type = bw_div(data->src_width[i], bw_int_to_fixed(2)); in calculate_bandwidth()
440 data->src_height_after_surface_type = bw_div(data->src_height[i], bw_int_to_fixed(2)); in calculate_bandwidth()
441 data->hsr_after_surface_type = bw_div(data->h_scale_ratio[i], bw_int_to_fixed(2)); in calculate_bandwidth()
442 data->vsr_after_surface_type = bw_div(data->v_scale_ratio[i], bw_int_to_fixed(2)); in calculate_bandwidth()
445 data->pitch_in_pixels_after_surface_type[i] = data->pitch_in_pixels[i]; in calculate_bandwidth()
446 data->src_width_after_surface_type = data->src_width[i]; in calculate_bandwidth()
447 data->src_height_after_surface_type = data->src_height[i]; in calculate_bandwidth()
448 data->hsr_after_surface_type = data->h_scale_ratio[i]; in calculate_bandwidth()
449 data->vsr_after_surface_type = data->v_scale_ratio[i]; in calculate_bandwidth()
451 …if ((bw_equ(data->rotation_angle[i], bw_int_to_fixed(90)) || bw_equ(data->rotation_angle[i], bw_in… in calculate_bandwidth()
452 data->src_width_after_rotation = data->src_height_after_surface_type; in calculate_bandwidth()
453 data->src_height_after_rotation = data->src_width_after_surface_type; in calculate_bandwidth()
454 data->hsr_after_rotation = data->vsr_after_surface_type; in calculate_bandwidth()
455 data->vsr_after_rotation = data->hsr_after_surface_type; in calculate_bandwidth()
458 data->src_width_after_rotation = data->src_width_after_surface_type; in calculate_bandwidth()
459 data->src_height_after_rotation = data->src_height_after_surface_type; in calculate_bandwidth()
460 data->hsr_after_rotation = data->hsr_after_surface_type; in calculate_bandwidth()
461 data->vsr_after_rotation = data->vsr_after_surface_type; in calculate_bandwidth()
463 switch (data->stereo_mode[i]) { in calculate_bandwidth()
465 data->source_width_pixels[i] = data->src_width_after_rotation; in calculate_bandwidth()
466 data->source_height_pixels = bw_mul(bw_int_to_fixed(2), data->src_height_after_rotation); in calculate_bandwidth()
467 data->hsr_after_stereo = data->hsr_after_rotation; in calculate_bandwidth()
468 data->vsr_after_stereo = bw_mul(bw_int_to_fixed(1), data->vsr_after_rotation); in calculate_bandwidth()
471 data->source_width_pixels[i] = bw_mul(bw_int_to_fixed(2), data->src_width_after_rotation); in calculate_bandwidth()
472 data->source_height_pixels = data->src_height_after_rotation; in calculate_bandwidth()
473 data->hsr_after_stereo = bw_mul(bw_int_to_fixed(1), data->hsr_after_rotation); in calculate_bandwidth()
474 data->vsr_after_stereo = data->vsr_after_rotation; in calculate_bandwidth()
477 data->source_width_pixels[i] = data->src_width_after_rotation; in calculate_bandwidth()
478 data->source_height_pixels = data->src_height_after_rotation; in calculate_bandwidth()
479 data->hsr_after_stereo = data->hsr_after_rotation; in calculate_bandwidth()
480 data->vsr_after_stereo = data->vsr_after_rotation; in calculate_bandwidth()
483 data->hsr[i] = data->hsr_after_stereo; in calculate_bandwidth()
484 if (data->interlace_mode[i]) { in calculate_bandwidth()
485 data->vsr[i] = bw_mul(data->vsr_after_stereo, bw_int_to_fixed(2)); in calculate_bandwidth()
488 data->vsr[i] = data->vsr_after_stereo; in calculate_bandwidth()
490 if (data->panning_and_bezel_adjustment != bw_def_none) { in calculate_bandwidth()
491 …data->source_width_rounded_up_to_chunks[i] = bw_add(bw_floor2(bw_sub(data->source_width_pixels[i],… in calculate_bandwidth()
494 …data->source_width_rounded_up_to_chunks[i] = bw_ceil2(data->source_width_pixels[i], bw_int_to_fixe… in calculate_bandwidth()
496 data->source_height_rounded_up_to_chunks[i] = data->source_height_pixels; in calculate_bandwidth()
510 … data->number_of_displays && dceip->number_of_underlay_pipes >= data->number_of_underlay_surfaces … in calculate_bandwidth()
518 if (data->enable[i]) { in calculate_bandwidth()
519 if (bw_neq(data->hsr[i], bw_int_to_fixed(1))) { in calculate_bandwidth()
520 if (bw_mtn(data->hsr[i], bw_int_to_fixed(4))) { in calculate_bandwidth()
524 if (bw_mtn(data->hsr[i], data->h_taps[i])) { in calculate_bandwidth()
528 …re_downscaler_enabled == 1 && bw_mtn(data->hsr[i], bw_int_to_fixed(1)) && bw_leq(data->hsr[i], bw_… in calculate_bandwidth()
538 if (data->enable[i]) { in calculate_bandwidth()
539 if (bw_neq(data->vsr[i], bw_int_to_fixed(1))) { in calculate_bandwidth()
540 if (bw_mtn(data->vsr[i], bw_int_to_fixed(4))) { in calculate_bandwidth()
544 if (bw_mtn(data->vsr[i], data->v_taps[i])) { in calculate_bandwidth()
553 if (data->enable[i]) { in calculate_bandwidth()
554 if ((dceip->pre_downscaler_enabled && bw_mtn(data->hsr[i], bw_int_to_fixed(1)))) { in calculate_bandwidth()
555 data->source_width_in_lb = bw_div(data->source_width_pixels[i], data->hsr[i]); in calculate_bandwidth()
558 data->source_width_in_lb = data->source_width_pixels[i]; in calculate_bandwidth()
560 switch (data->lb_bpc[i]) { in calculate_bandwidth()
562 …data->lb_line_pitch = bw_ceil2(bw_mul(bw_div(bw_frc_to_fixed(2401171875ul, 100000000), bw_int_to_f… in calculate_bandwidth()
565 …data->lb_line_pitch = bw_ceil2(bw_mul(bw_div(bw_frc_to_fixed(300234375, 10000000), bw_int_to_fixed… in calculate_bandwidth()
568 …data->lb_line_pitch = bw_ceil2(bw_mul(bw_int_to_fixed(data->lb_bpc[i]), data->source_width_in_lb),… in calculate_bandwidth()
571 …data->lb_partitions[i] = bw_floor2(bw_div(data->lb_size_per_component[i], data->lb_line_pitch), bw… in calculate_bandwidth()
574 data->lb_partitions_max[i] = bw_int_to_fixed(10); in calculate_bandwidth()
577 data->lb_partitions_max[i] = bw_int_to_fixed(7); in calculate_bandwidth()
579 data->lb_partitions[i] = bw_min2(data->lb_partitions_max[i], data->lb_partitions[i]); in calculate_bandwidth()
580 if (bw_mtn(bw_add(data->v_taps[i], bw_int_to_fixed(1)), data->lb_partitions[i])) { in calculate_bandwidth()
587 …data->enable[i] && data->fbc_en[i] == 1 && (bw_equ(data->rotation_angle[i], bw_int_to_fixed(90)) |… in calculate_bandwidth()
593 if (data->enable[i]) { in calculate_bandwidth()
594 …qu(data->rotation_angle[i], bw_int_to_fixed(90)) || bw_equ(data->rotation_angle[i], bw_int_to_fixe… in calculate_bandwidth()
606 data->number_of_dram_wrchannels = vbios->number_of_dram_channels; in calculate_bandwidth()
607 data->number_of_dram_channels = vbios->number_of_dram_channels; in calculate_bandwidth()
615 data->dram_efficiency = bw_frc_to_fixed(5, 10); in calculate_bandwidth()
617 data->dram_efficiency = bw_int_to_fixed(1); in calculate_bandwidth()
621 data->number_of_dram_channels = 1; in calculate_bandwidth()
624 data->number_of_dram_channels = 2; in calculate_bandwidth()
627 data->number_of_dram_channels = 4; in calculate_bandwidth()
630 data->number_of_dram_channels = 1; in calculate_bandwidth()
635 data->dram_efficiency = bw_frc_to_fixed(5, 10); in calculate_bandwidth()
637 data->dram_efficiency = bw_frc_to_fixed(8, 10); in calculate_bandwidth()
645 if (data->enable[i]) { in calculate_bandwidth()
646 …if ((bw_equ(data->rotation_angle[i], bw_int_to_fixed(90)) || bw_equ(data->rotation_angle[i], bw_in… in calculate_bandwidth()
649 data->orthogonal_rotation[i] = 1; in calculate_bandwidth()
653 if (data->graphics_micro_tile_mode == bw_def_rotated_micro_tiling) { in calculate_bandwidth()
654 data->orthogonal_rotation[i] = 0; in calculate_bandwidth()
657 data->orthogonal_rotation[i] = 1; in calculate_bandwidth()
664 if (data->underlay_micro_tile_mode == bw_def_display_micro_tiling) { in calculate_bandwidth()
665 data->orthogonal_rotation[i] = 0; in calculate_bandwidth()
668 data->orthogonal_rotation[i] = 1; in calculate_bandwidth()
673 if (data->graphics_micro_tile_mode == bw_def_display_micro_tiling) { in calculate_bandwidth()
674 data->orthogonal_rotation[i] = 0; in calculate_bandwidth()
677 data->orthogonal_rotation[i] = 1; in calculate_bandwidth()
681 …if (bw_equ(data->rotation_angle[i], bw_int_to_fixed(90)) || bw_equ(data->rotation_angle[i], bw_int… in calculate_bandwidth()
682 …data->underlay_maximum_source_efficient_for_tiling = dceip->underlay_maximum_height_efficient_for_… in calculate_bandwidth()
685 …data->underlay_maximum_source_efficient_for_tiling = dceip->underlay_maximum_width_efficient_for_t… in calculate_bandwidth()
688 data->bytes_per_request[i] = bw_int_to_fixed(64); in calculate_bandwidth()
689 data->useful_bytes_per_request[i] = bw_int_to_fixed(64); in calculate_bandwidth()
690 data->lines_interleaved_in_mem_access[i] = bw_int_to_fixed(1); in calculate_bandwidth()
691 data->latency_hiding_lines[i] = bw_int_to_fixed(1); in calculate_bandwidth()
694 data->bytes_per_request[i] = bw_int_to_fixed(64); in calculate_bandwidth()
695 data->useful_bytes_per_request[i] = bw_int_to_fixed(64); in calculate_bandwidth()
696 data->lines_interleaved_in_mem_access[i] = bw_int_to_fixed(2); in calculate_bandwidth()
697 data->latency_hiding_lines[i] = bw_int_to_fixed(2); in calculate_bandwidth()
700 … (surface_type[i] == bw_def_graphics || (bw_mtn(data->source_width_rounded_up_to_chunks[i], bw_cei… in calculate_bandwidth()
701 switch (data->bytes_per_pixel[i]) { in calculate_bandwidth()
703 data->lines_interleaved_in_mem_access[i] = bw_int_to_fixed(2); in calculate_bandwidth()
704 data->latency_hiding_lines[i] = bw_int_to_fixed(2); in calculate_bandwidth()
705 if (data->orthogonal_rotation[i]) { in calculate_bandwidth()
706 data->bytes_per_request[i] = bw_int_to_fixed(32); in calculate_bandwidth()
707 data->useful_bytes_per_request[i] = bw_int_to_fixed(32); in calculate_bandwidth()
710 data->bytes_per_request[i] = bw_int_to_fixed(64); in calculate_bandwidth()
711 data->useful_bytes_per_request[i] = bw_int_to_fixed(64); in calculate_bandwidth()
715 if (data->orthogonal_rotation[i]) { in calculate_bandwidth()
716 data->lines_interleaved_in_mem_access[i] = bw_int_to_fixed(2); in calculate_bandwidth()
717 data->latency_hiding_lines[i] = bw_int_to_fixed(2); in calculate_bandwidth()
718 data->bytes_per_request[i] = bw_int_to_fixed(32); in calculate_bandwidth()
719 data->useful_bytes_per_request[i] = bw_int_to_fixed(16); in calculate_bandwidth()
722 data->lines_interleaved_in_mem_access[i] = bw_int_to_fixed(2); in calculate_bandwidth()
723 data->latency_hiding_lines[i] = bw_int_to_fixed(2); in calculate_bandwidth()
724 data->bytes_per_request[i] = bw_int_to_fixed(64); in calculate_bandwidth()
725 data->useful_bytes_per_request[i] = bw_int_to_fixed(64); in calculate_bandwidth()
729 data->lines_interleaved_in_mem_access[i] = bw_int_to_fixed(2); in calculate_bandwidth()
730 data->latency_hiding_lines[i] = bw_int_to_fixed(2); in calculate_bandwidth()
731 data->bytes_per_request[i] = bw_int_to_fixed(32); in calculate_bandwidth()
732 data->useful_bytes_per_request[i] = bw_int_to_fixed(32); in calculate_bandwidth()
735 data->lines_interleaved_in_mem_access[i] = bw_int_to_fixed(2); in calculate_bandwidth()
736 data->latency_hiding_lines[i] = bw_int_to_fixed(2); in calculate_bandwidth()
737 data->bytes_per_request[i] = bw_int_to_fixed(32); in calculate_bandwidth()
738 data->useful_bytes_per_request[i] = bw_int_to_fixed(16); in calculate_bandwidth()
743 data->bytes_per_request[i] = bw_int_to_fixed(64); in calculate_bandwidth()
744 data->useful_bytes_per_request[i] = bw_int_to_fixed(64); in calculate_bandwidth()
745 if (data->orthogonal_rotation[i]) { in calculate_bandwidth()
746 data->lines_interleaved_in_mem_access[i] = bw_int_to_fixed(8); in calculate_bandwidth()
747 data->latency_hiding_lines[i] = bw_int_to_fixed(4); in calculate_bandwidth()
750 switch (data->bytes_per_pixel[i]) { in calculate_bandwidth()
752 data->lines_interleaved_in_mem_access[i] = bw_int_to_fixed(2); in calculate_bandwidth()
753 data->latency_hiding_lines[i] = bw_int_to_fixed(2); in calculate_bandwidth()
756 data->lines_interleaved_in_mem_access[i] = bw_int_to_fixed(4); in calculate_bandwidth()
757 data->latency_hiding_lines[i] = bw_int_to_fixed(4); in calculate_bandwidth()
760 data->lines_interleaved_in_mem_access[i] = bw_int_to_fixed(8); in calculate_bandwidth()
761 data->latency_hiding_lines[i] = bw_int_to_fixed(4); in calculate_bandwidth()
802 if (data->enable[i]) { in calculate_bandwidth()
803 …data->v_filter_init[i] = bw_floor2(bw_div((bw_add(bw_add(bw_add(bw_int_to_fixed(1), data->v_taps[i… in calculate_bandwidth()
804 if (data->panning_and_bezel_adjustment == bw_def_any_lines) { in calculate_bandwidth()
805 data->v_filter_init[i] = bw_add(data->v_filter_init[i], bw_int_to_fixed(1)); in calculate_bandwidth()
807 if (data->stereo_mode[i] == bw_def_top_bottom) { in calculate_bandwidth()
808 data->v_filter_init[i] = bw_min2(data->v_filter_init[i], bw_int_to_fixed(4)); in calculate_bandwidth()
810 if (data->stereo_mode[i] == bw_def_top_bottom) { in calculate_bandwidth()
811 data->num_lines_at_frame_start = bw_int_to_fixed(1); in calculate_bandwidth()
814 data->num_lines_at_frame_start = bw_int_to_fixed(3); in calculate_bandwidth()
816 …if ((bw_mtn(data->vsr[i], bw_int_to_fixed(1)) && surface_type[i] == bw_def_graphics) || data->pann… in calculate_bandwidth()
817 data->line_buffer_prefetch[i] = 0; in calculate_bandwidth()
819 …urface_type[i] == bw_def_graphics) && (bw_mtn(data->lb_partitions[i], bw_add(data->v_taps[i], bw_c… in calculate_bandwidth()
820 data->line_buffer_prefetch[i] = 1; in calculate_bandwidth()
823 data->line_buffer_prefetch[i] = 0; in calculate_bandwidth()
825 …data->lb_lines_in_per_line_out_in_beginning_of_frame[i] = bw_div(bw_ceil2(data->v_filter_init[i], … in calculate_bandwidth()
826 if (data->line_buffer_prefetch[i] == 1) { in calculate_bandwidth()
827 … data->lb_lines_in_per_line_out_in_middle_of_frame[i] = bw_max2(bw_int_to_fixed(1), data->vsr[i]); in calculate_bandwidth()
829 else if (bw_leq(data->vsr[i], bw_int_to_fixed(1))) { in calculate_bandwidth()
830 data->lb_lines_in_per_line_out_in_middle_of_frame[i] = bw_int_to_fixed(1); in calculate_bandwidth()
831 } else if (bw_leq(data->vsr[i], in calculate_bandwidth()
833 …data->lb_lines_in_per_line_out_in_middle_of_frame[i] = bw_div(bw_int_to_fixed(4), bw_int_to_fixed(… in calculate_bandwidth()
834 } else if (bw_leq(data->vsr[i], in calculate_bandwidth()
836 …data->lb_lines_in_per_line_out_in_middle_of_frame[i] = bw_div(bw_int_to_fixed(6), bw_int_to_fixed(… in calculate_bandwidth()
838 else if (bw_leq(data->vsr[i], bw_int_to_fixed(2))) { in calculate_bandwidth()
839 data->lb_lines_in_per_line_out_in_middle_of_frame[i] = bw_int_to_fixed(2); in calculate_bandwidth()
841 else if (bw_leq(data->vsr[i], bw_int_to_fixed(3))) { in calculate_bandwidth()
842 data->lb_lines_in_per_line_out_in_middle_of_frame[i] = bw_int_to_fixed(3); in calculate_bandwidth()
845 data->lb_lines_in_per_line_out_in_middle_of_frame[i] = bw_int_to_fixed(4); in calculate_bandwidth()
847 …if (data->line_buffer_prefetch[i] == 1 || bw_equ(data->lb_lines_in_per_line_out_in_middle_of_frame… in calculate_bandwidth()
848 data->horizontal_blank_and_chunk_granularity_factor[i] = bw_int_to_fixed(1); in calculate_bandwidth()
851 …data->horizontal_blank_and_chunk_granularity_factor[i] = bw_div(data->h_total[i], (bw_div((bw_add(… in calculate_bandwidth()
853 …data->request_bandwidth[i] = bw_div(bw_mul(bw_div(bw_mul(bw_div(bw_mul(bw_max2(data->lb_lines_in_p… in calculate_bandwidth()
854 data->display_bandwidth[i] = bw_mul(data->request_bandwidth[i], data->bytes_per_request[i]); in calculate_bandwidth()
873 if (data->enable[i]) { in calculate_bandwidth()
875 data->max_chunks_non_fbc_mode[i] = 128 - dmif_chunk_buff_margin; in calculate_bandwidth()
878 data->max_chunks_non_fbc_mode[i] = 16 - dmif_chunk_buff_margin; in calculate_bandwidth()
881 if (data->fbc_en[i] == 1) { in calculate_bandwidth()
886 if (data->enable[i]) { in calculate_bandwidth()
889 … data->data_buffer_size[i] = bw_int_to_fixed(dceip->display_write_back420_luma_mcifwr_buffer_size); in calculate_bandwidth()
892 …data->data_buffer_size[i] = bw_int_to_fixed(dceip->display_write_back420_chroma_mcifwr_buffer_size… in calculate_bandwidth()
895 data->data_buffer_size[i] = bw_int_to_fixed(dceip->underlay_luma_dmif_size); in calculate_bandwidth()
898 …data->data_buffer_size[i] = bw_div(bw_int_to_fixed(dceip->underlay_chroma_dmif_size), bw_int_to_fi… in calculate_bandwidth()
901 if (data->orthogonal_rotation[i] == 0) { in calculate_bandwidth()
902 data->data_buffer_size[i] = bw_int_to_fixed(dceip->underlay_luma_dmif_size); in calculate_bandwidth()
905 …data->data_buffer_size[i] = bw_add(bw_int_to_fixed(dceip->underlay_luma_dmif_size), bw_int_to_fixe… in calculate_bandwidth()
909 if (data->fbc_en[i] == 1) { in calculate_bandwidth()
911 if (data->number_of_displays == 1) { in calculate_bandwidth()
912 …data->data_buffer_size[i] = bw_min2(bw_mul(bw_mul(bw_int_to_fixed(max_chunks_fbc_mode), bw_int_to_… in calculate_bandwidth()
915 …data->data_buffer_size[i] = bw_min2(bw_mul(bw_mul(bw_int_to_fixed(max_chunks_fbc_mode), bw_int_to_… in calculate_bandwidth()
920 if (data->number_of_displays == 1) { in calculate_bandwidth()
921 …data->data_buffer_size[i] = bw_min2(bw_mul(bw_mul(bw_int_to_fixed(data->max_chunks_non_fbc_mode[i]… in calculate_bandwidth()
924 …data->data_buffer_size[i] = bw_min2(bw_mul(bw_mul(bw_int_to_fixed(data->max_chunks_non_fbc_mode[i]… in calculate_bandwidth()
930 data->memory_chunk_size_in_bytes[i] = bw_int_to_fixed(1024); in calculate_bandwidth()
931 data->pipe_chunk_size_in_bytes[i] = bw_int_to_fixed(1024); in calculate_bandwidth()
934 …data->memory_chunk_size_in_bytes[i] = bw_mul(bw_mul(bw_int_to_fixed(dceip->chunk_width), data->lin… in calculate_bandwidth()
935 …data->pipe_chunk_size_in_bytes[i] = bw_mul(bw_mul(bw_int_to_fixed(dceip->chunk_width), bw_int_to_f… in calculate_bandwidth()
939 data->min_dmif_size_in_time = bw_int_to_fixed(9999); in calculate_bandwidth()
940 data->min_mcifwr_size_in_time = bw_int_to_fixed(9999); in calculate_bandwidth()
942 if (data->enable[i]) { in calculate_bandwidth()
944 …bw_div(bw_mul(data->data_buffer_size[i], data->bytes_per_request[i]), data->useful_bytes_per_reque… in calculate_bandwidth()
945 …data->min_dmif_size_in_time = bw_div(bw_div(bw_mul(data->data_buffer_size[i], data->bytes_per_requ… in calculate_bandwidth()
949 …bw_div(bw_mul(data->data_buffer_size[i], data->bytes_per_request[i]), data->useful_bytes_per_reque… in calculate_bandwidth()
950 …data->min_mcifwr_size_in_time = bw_div(bw_div(bw_mul(data->data_buffer_size[i], data->bytes_per_re… in calculate_bandwidth()
955 data->total_requests_for_dmif_size = bw_int_to_fixed(0); in calculate_bandwidth()
957 …if (data->enable[i] && surface_type[i] != bw_def_display_write_back420_luma && surface_type[i] != … in calculate_bandwidth()
958 …data->total_requests_for_dmif_size = bw_add(data->total_requests_for_dmif_size, bw_div(data->data_… in calculate_bandwidth()
962 if (data->enable[i]) { in calculate_bandwidth()
963 …& dceip->limit_excessive_outstanding_dmif_requests && (data->number_of_displays > 1 || bw_mtn(data… in calculate_bandwidth()
964 …data->adjusted_data_buffer_size[i] = bw_min2(data->data_buffer_size[i], bw_ceil2(bw_mul(data->min_… in calculate_bandwidth()
967 data->adjusted_data_buffer_size[i] = data->data_buffer_size[i]; in calculate_bandwidth()
972 if (data->enable[i]) { in calculate_bandwidth()
973 if (data->number_of_displays == 1 && data->number_of_underlay_surfaces == 0) { in calculate_bandwidth()
975 data->outstanding_chunk_request_limit[i] = bw_int_to_fixed(127); in calculate_bandwidth()
978 …data->outstanding_chunk_request_limit[i] = bw_ceil2(bw_div(data->adjusted_data_buffer_size[i], dat… in calculate_bandwidth()
981 …data->outstanding_chunk_request_limit[i] = bw_max2(bw_int_to_fixed(127), data->outstanding_chunk_r… in calculate_bandwidth()
995 …if (data->number_of_displays > 1 || (bw_neq(data->rotation_angle[4], bw_int_to_fixed(0)) && bw_neq… in calculate_bandwidth()
996 …data->peak_pte_request_to_eviction_ratio_limiting = dceip->peak_pte_request_to_eviction_ratio_limi… in calculate_bandwidth()
999 …data->peak_pte_request_to_eviction_ratio_limiting = dceip->peak_pte_request_to_eviction_ratio_limi… in calculate_bandwidth()
1002 if (data->enable[i] && data->scatter_gather_enable_for_pipe[i] == 1) { in calculate_bandwidth()
1004 data->useful_pte_per_pte_request = bw_int_to_fixed(8); in calculate_bandwidth()
1005 …data->scatter_gather_page_width[i] = bw_div(bw_int_to_fixed(4096), bw_int_to_fixed(data->bytes_per… in calculate_bandwidth()
1006 data->scatter_gather_page_height[i] = bw_int_to_fixed(1); in calculate_bandwidth()
1007 data->scatter_gather_pte_request_rows = bw_int_to_fixed(1); in calculate_bandwidth()
1008 …data->scatter_gather_row_height = bw_int_to_fixed(dceip->scatter_gather_lines_of_pte_prefetching_i… in calculate_bandwidth()
1010 …else if (bw_equ(data->rotation_angle[i], bw_int_to_fixed(0)) || bw_equ(data->rotation_angle[i], bw… in calculate_bandwidth()
1011 data->useful_pte_per_pte_request = bw_int_to_fixed(8); in calculate_bandwidth()
1012 switch (data->bytes_per_pixel[i]) { in calculate_bandwidth()
1014 data->scatter_gather_page_width[i] = bw_int_to_fixed(32); in calculate_bandwidth()
1015 data->scatter_gather_page_height[i] = bw_int_to_fixed(32); in calculate_bandwidth()
1018 data->scatter_gather_page_width[i] = bw_int_to_fixed(64); in calculate_bandwidth()
1019 data->scatter_gather_page_height[i] = bw_int_to_fixed(32); in calculate_bandwidth()
1022 data->scatter_gather_page_width[i] = bw_int_to_fixed(64); in calculate_bandwidth()
1023 data->scatter_gather_page_height[i] = bw_int_to_fixed(64); in calculate_bandwidth()
1026 …data->scatter_gather_pte_request_rows = bw_int_to_fixed(dceip->scatter_gather_pte_request_rows_in_… in calculate_bandwidth()
1027 data->scatter_gather_row_height = data->scatter_gather_page_height[i]; in calculate_bandwidth()
1030 data->useful_pte_per_pte_request = bw_int_to_fixed(1); in calculate_bandwidth()
1031 switch (data->bytes_per_pixel[i]) { in calculate_bandwidth()
1033 data->scatter_gather_page_width[i] = bw_int_to_fixed(32); in calculate_bandwidth()
1034 data->scatter_gather_page_height[i] = bw_int_to_fixed(32); in calculate_bandwidth()
1037 data->scatter_gather_page_width[i] = bw_int_to_fixed(32); in calculate_bandwidth()
1038 data->scatter_gather_page_height[i] = bw_int_to_fixed(64); in calculate_bandwidth()
1041 data->scatter_gather_page_width[i] = bw_int_to_fixed(64); in calculate_bandwidth()
1042 data->scatter_gather_page_height[i] = bw_int_to_fixed(64); in calculate_bandwidth()
1045 …data->scatter_gather_pte_request_rows = bw_int_to_fixed(dceip->scatter_gather_pte_request_rows_in_… in calculate_bandwidth()
1046 data->scatter_gather_row_height = data->scatter_gather_page_height[i]; in calculate_bandwidth()
1048 …data->pte_request_per_chunk[i] = bw_div(bw_div(bw_int_to_fixed(dceip->chunk_width), data->scatter_… in calculate_bandwidth()
1049 …data->scatter_gather_pte_requests_in_row[i] = bw_div(bw_mul(bw_ceil2(bw_mul(bw_div(data->source_wi… in calculate_bandwidth()
1050 …data->scatter_gather_pte_requests_in_vblank = bw_mul(data->scatter_gather_pte_request_rows, data->… in calculate_bandwidth()
1051 if (bw_equ(data->peak_pte_request_to_eviction_ratio_limiting, bw_int_to_fixed(0))) { in calculate_bandwidth()
1052 data->scatter_gather_pte_request_limit[i] = data->scatter_gather_pte_requests_in_vblank; in calculate_bandwidth()
1055 …data->scatter_gather_pte_request_limit[i] = bw_max2(dceip->minimum_outstanding_pte_request_limit, … in calculate_bandwidth()
1062 …data->inefficient_linear_pitch_in_bytes = bw_mul(bw_mul(bw_int_to_fixed(256), bw_int_to_fixed(vbio… in calculate_bandwidth()
1083 data->cursor_total_data = bw_int_to_fixed(0); in calculate_bandwidth()
1084 data->cursor_total_request_groups = bw_int_to_fixed(0); in calculate_bandwidth()
1085 data->scatter_gather_total_pte_requests = bw_int_to_fixed(0); in calculate_bandwidth()
1086 data->scatter_gather_total_pte_request_groups = bw_int_to_fixed(0); in calculate_bandwidth()
1088 if (data->enable[i]) { in calculate_bandwidth()
1089 …data->cursor_total_data = bw_add(data->cursor_total_data, bw_mul(bw_mul(bw_int_to_fixed(2), data->… in calculate_bandwidth()
1091 …data->cursor_total_request_groups = bw_add(data->cursor_total_request_groups, bw_int_to_fixed((dce… in calculate_bandwidth()
1094 …data->cursor_total_request_groups = bw_add(data->cursor_total_request_groups, bw_ceil2(bw_div(data… in calculate_bandwidth()
1096 if (data->scatter_gather_enable_for_pipe[i]) { in calculate_bandwidth()
1097 …data->scatter_gather_total_pte_requests = bw_add(data->scatter_gather_total_pte_requests, data->sc… in calculate_bandwidth()
1098 …data->scatter_gather_total_pte_request_groups = bw_add(data->scatter_gather_total_pte_request_grou… in calculate_bandwidth()
1102 data->tile_width_in_pixels = bw_int_to_fixed(8); in calculate_bandwidth()
1103 data->dmif_total_number_of_data_request_page_close_open = bw_int_to_fixed(0); in calculate_bandwidth()
1104 data->mcifwr_total_number_of_data_request_page_close_open = bw_int_to_fixed(0); in calculate_bandwidth()
1106 if (data->enable[i]) { in calculate_bandwidth()
1107 if (data->scatter_gather_enable_for_pipe[i] == 1 && tiling_mode[i] != bw_def_linear) { in calculate_bandwidth()
1108 …data->bytes_per_page_close_open = bw_mul(data->lines_interleaved_in_mem_access[i], bw_max2(bw_mul(… in calculate_bandwidth()
1110 …data->scatter_gather_enable_for_pipe[i] == 1 && tiling_mode[i] == bw_def_linear && bw_equ(bw_mod((… in calculate_bandwidth()
1111 data->bytes_per_page_close_open = dceip->linear_mode_line_request_alternation_slice; in calculate_bandwidth()
1114 data->bytes_per_page_close_open = data->memory_chunk_size_in_bytes[i]; in calculate_bandwidth()
1117 …data->dmif_total_number_of_data_request_page_close_open = bw_add(data->dmif_total_number_of_data_r… in calculate_bandwidth()
1120 …data->mcifwr_total_number_of_data_request_page_close_open = bw_add(data->mcifwr_total_number_of_da… in calculate_bandwidth()
1124 …data->dmif_total_page_close_open_time = bw_div(bw_mul((bw_add(bw_add(data->dmif_total_number_of_da… in calculate_bandwidth()
1125 …data->mcifwr_total_page_close_open_time = bw_div(bw_mul(data->mcifwr_total_number_of_data_request_… in calculate_bandwidth()
1127 if (data->enable[i]) { in calculate_bandwidth()
1128 …data->adjusted_data_buffer_size_in_memory[i] = bw_div(bw_mul(data->adjusted_data_buffer_size[i], d… in calculate_bandwidth()
1131 data->total_requests_for_adjusted_dmif_size = bw_int_to_fixed(0); in calculate_bandwidth()
1133 if (data->enable[i]) { in calculate_bandwidth()
1135 …data->total_requests_for_adjusted_dmif_size = bw_add(data->total_requests_for_adjusted_dmif_size, … in calculate_bandwidth()
1139 …data->total_dmifmc_urgent_trips = bw_ceil2(bw_div(data->total_requests_for_adjusted_dmif_size, (bw… in calculate_bandwidth()
1140 …data->total_dmifmc_urgent_latency = bw_mul(vbios->dmifmc_urgent_latency, data->total_dmifmc_urgent… in calculate_bandwidth()
1141 data->total_display_reads_required_data = bw_int_to_fixed(0); in calculate_bandwidth()
1142 data->total_display_reads_required_dram_access_data = bw_int_to_fixed(0); in calculate_bandwidth()
1143 data->total_display_writes_required_data = bw_int_to_fixed(0); in calculate_bandwidth()
1144 data->total_display_writes_required_dram_access_data = bw_int_to_fixed(0); in calculate_bandwidth()
1146 if (data->enable[i]) { in calculate_bandwidth()
1148 data->display_reads_required_data = data->adjusted_data_buffer_size_in_memory[i]; in calculate_bandwidth()
1160 data->display_reads_required_dram_access_data = data->adjusted_data_buffer_size_in_memory[i]; in calculate_bandwidth()
1163 …data->display_reads_required_dram_access_data = bw_mul(data->adjusted_data_buffer_size_in_memory[i… in calculate_bandwidth()
1165 …data->total_display_reads_required_data = bw_add(data->total_display_reads_required_data, data->di… in calculate_bandwidth()
1166 …data->total_display_reads_required_dram_access_data = bw_add(data->total_display_reads_required_dr… in calculate_bandwidth()
1169 …data->total_display_writes_required_data = bw_add(data->total_display_writes_required_data, data->… in calculate_bandwidth()
1170 …data->total_display_writes_required_dram_access_data = bw_add(data->total_display_writes_required_… in calculate_bandwidth()
1174 …data->total_display_reads_required_data = bw_add(bw_add(data->total_display_reads_required_data, d… in calculate_bandwidth()
1175 …data->total_display_reads_required_dram_access_data = bw_add(bw_add(data->total_display_reads_requ… in calculate_bandwidth()
1177 if (data->enable[i]) { in calculate_bandwidth()
1178 if (bw_mtn(data->v_filter_init[i], bw_int_to_fixed(4))) { in calculate_bandwidth()
1179 …data->src_pixels_for_first_output_pixel[i] = bw_mul(bw_int_to_fixed(4), data->source_width_rounded… in calculate_bandwidth()
1182 if (bw_mtn(data->v_filter_init[i], bw_int_to_fixed(2))) { in calculate_bandwidth()
1183 data->src_pixels_for_first_output_pixel[i] = bw_int_to_fixed(512); in calculate_bandwidth()
1186 data->src_pixels_for_first_output_pixel[i] = bw_int_to_fixed(0); in calculate_bandwidth()
1189 …data->src_data_for_first_output_pixel[i] = bw_div(bw_mul(bw_mul(data->src_pixels_for_first_output_… in calculate_bandwidth()
1190 …data->src_pixels_for_last_output_pixel[i] = bw_mul(data->source_width_rounded_up_to_chunks[i], bw_… in calculate_bandwidth()
1191 …data->src_data_for_last_output_pixel[i] = bw_div(bw_mul(bw_mul(bw_mul(data->source_width_rounded_u… in calculate_bandwidth()
1192 …data->active_time[i] = bw_div(bw_div(data->source_width_rounded_up_to_chunks[i], data->hsr[i]), da… in calculate_bandwidth()
1197 …data->dmif_burst_time[i][j] = bw_max3(data->dmif_total_page_close_open_time, bw_div(data->total_di… in calculate_bandwidth()
1198 if (data->d1_display_write_back_dwb_enable == 1) { in calculate_bandwidth()
1199 …data->mcifwr_burst_time[i][j] = bw_max3(data->mcifwr_total_page_close_open_time, bw_div(data->tota… in calculate_bandwidth()
1206 if (data->enable[i]) { in calculate_bandwidth()
1210 …data->dmif_buffer_transfer_time[i] = bw_mul(data->source_width_rounded_up_to_chunks[i], (bw_div(dc… in calculate_bandwidth()
1211 …data->line_source_transfer_time[i][j][k] = bw_max2(bw_mul((bw_add(data->total_dmifmc_urgent_latenc… in calculate_bandwidth()
1218 switch (data->lb_bpc[i]) { in calculate_bandwidth()
1220 data->v_scaler_efficiency = dceip->graphics_vscaler_efficiency6_bit_per_component; in calculate_bandwidth()
1223 data->v_scaler_efficiency = dceip->graphics_vscaler_efficiency8_bit_per_component; in calculate_bandwidth()
1226 data->v_scaler_efficiency = dceip->graphics_vscaler_efficiency10_bit_per_component; in calculate_bandwidth()
1229 data->v_scaler_efficiency = dceip->graphics_vscaler_efficiency12_bit_per_component; in calculate_bandwidth()
1232 if (data->use_alpha[i] == 1) { in calculate_bandwidth()
1233 … data->v_scaler_efficiency = bw_min2(data->v_scaler_efficiency, dceip->alpha_vscaler_efficiency); in calculate_bandwidth()
1237 switch (data->lb_bpc[i]) { in calculate_bandwidth()
1239 data->v_scaler_efficiency = dceip->underlay_vscaler_efficiency6_bit_per_component; in calculate_bandwidth()
1242 data->v_scaler_efficiency = dceip->underlay_vscaler_efficiency8_bit_per_component; in calculate_bandwidth()
1245 data->v_scaler_efficiency = dceip->underlay_vscaler_efficiency10_bit_per_component; in calculate_bandwidth()
1248 data->v_scaler_efficiency = bw_int_to_fixed(3); in calculate_bandwidth()
1252 if (dceip->pre_downscaler_enabled && bw_mtn(data->hsr[i], bw_int_to_fixed(1))) { in calculate_bandwidth()
1253 …data->scaler_limits_factor = bw_max2(bw_div(data->v_taps[i], data->v_scaler_efficiency), bw_div(da… in calculate_bandwidth()
1256 …data->scaler_limits_factor = bw_max3(bw_int_to_fixed(1), bw_ceil2(bw_div(data->h_taps[i], bw_int_t… in calculate_bandwidth()
1258 …data->dram_speed_change_line_source_transfer_time[i][j][k] = bw_mul(bw_int_to_fixed(2), bw_max2((b… in calculate_bandwidth()
1261 …data->line_source_transfer_time[i][j][k] = bw_max2(bw_mul((bw_add(vbios->mcifwrmc_urgent_latency, … in calculate_bandwidth()
1267 …data->dram_speed_change_line_source_transfer_time[i][j][k] = bw_max2((bw_add((bw_div(data->src_dat… in calculate_bandwidth()
1289 if (data->enable[k]) { in calculate_bandwidth()
1292 data->display_pstate_change_enable[k] = 0; in calculate_bandwidth()
1295 if (data->enable[i]) { in calculate_bandwidth()
1296 …ram_clock_state_change_gated_before_cursor, bw_int_to_fixed(0)) && bw_mtn(data->cursor_width_pixel… in calculate_bandwidth()
1297 if (bw_ltn(data->vsr[i], bw_int_to_fixed(2))) { in calculate_bandwidth()
1298 …data->cursor_latency_hiding[i] = bw_div(bw_div(bw_mul((bw_sub(dceip->cursor_dcp_buffer_lines, bw_i… in calculate_bandwidth()
1301 …data->cursor_latency_hiding[i] = bw_div(bw_div(bw_mul((bw_sub(dceip->cursor_dcp_buffer_lines, bw_i… in calculate_bandwidth()
1305 data->cursor_latency_hiding[i] = bw_int_to_fixed(9999); in calculate_bandwidth()
1310 if (data->enable[i]) { in calculate_bandwidth()
1311 …(bw_equ(data->vsr[i], bw_int_to_fixed(1)) || (bw_leq(data->vsr[i], bw_frc_to_fixed(8, 10)) && bw_l… in calculate_bandwidth()
1313 …data->minimum_latency_hiding[i] = bw_sub(bw_div(bw_mul((bw_div((bw_add(bw_sub(data->lb_partitions[… in calculate_bandwidth()
1315 …data->minimum_latency_hiding[i] = bw_sub(bw_div(bw_mul((bw_div((bw_add(bw_sub(data->lb_partitions[… in calculate_bandwidth()
1318 …data->minimum_latency_hiding[i] = bw_sub(bw_div(bw_mul((bw_div((bw_add(bw_int_to_fixed(1 + data->l… in calculate_bandwidth()
1320 …data->minimum_latency_hiding_with_cursor[i] = bw_min2(data->minimum_latency_hiding[i], data->curso… in calculate_bandwidth()
1325 data->blackout_duration_margin[i][j] = bw_int_to_fixed(9999); in calculate_bandwidth()
1326 data->dispclk_required_for_blackout_duration[i][j] = bw_int_to_fixed(0); in calculate_bandwidth()
1327 data->dispclk_required_for_blackout_recovery[i][j] = bw_int_to_fixed(0); in calculate_bandwidth()
1329 if (data->enable[k] && bw_mtn(vbios->blackout_duration, bw_int_to_fixed(0))) { in calculate_bandwidth()
1331 …data->blackout_duration_margin[i][j] = bw_min2(data->blackout_duration_margin[i][j], bw_sub(bw_sub… in calculate_bandwidth()
1332 …data->dispclk_required_for_blackout_duration[i][j] = bw_max3(data->dispclk_required_for_blackout_d… in calculate_bandwidth()
1333 …ackout_recovery_time, bw_add(bw_mul(bw_int_to_fixed(2), data->total_dmifmc_urgent_latency), data->… in calculate_bandwidth()
1334 data->dispclk_required_for_blackout_recovery[i][j] = bw_int_to_fixed(9999); in calculate_bandwidth()
1336 …data->adjusted_data_buffer_size[k], bw_mul(bw_div(bw_mul(data->display_bandwidth[k], data->useful_… in calculate_bandwidth()
1337 …data->dispclk_required_for_blackout_recovery[i][j] = bw_max2(data->dispclk_required_for_blackout_r… in calculate_bandwidth()
1341 …data->blackout_duration_margin[i][j] = bw_min2(data->blackout_duration_margin[i][j], bw_sub(bw_sub… in calculate_bandwidth()
1342 …data->dispclk_required_for_blackout_duration[i][j] = bw_max3(data->dispclk_required_for_blackout_d… in calculate_bandwidth()
1343 …w_mul(bw_int_to_fixed(2), vbios->mcifwrmc_urgent_latency), data->dmif_burst_time[i][j]), data->mci… in calculate_bandwidth()
1344 data->dispclk_required_for_blackout_recovery[i][j] = bw_int_to_fixed(9999); in calculate_bandwidth()
1346 …data->adjusted_data_buffer_size[k], bw_mul(bw_div(bw_mul(data->display_bandwidth[k], data->useful_… in calculate_bandwidth()
1347 …data->dispclk_required_for_blackout_recovery[i][j] = bw_max2(data->dispclk_required_for_blackout_r… in calculate_bandwidth()
1354 …if (bw_mtn(data->blackout_duration_margin[high][s_high], bw_int_to_fixed(0)) && bw_ltn(data->dispc… in calculate_bandwidth()
1355 data->cpup_state_change_enable = bw_def_yes; in calculate_bandwidth()
1356 …if (bw_ltn(data->dispclk_required_for_blackout_recovery[high][s_high], vbios->high_voltage_max_dis… in calculate_bandwidth()
1357 data->cpuc_state_change_enable = bw_def_yes; in calculate_bandwidth()
1360 data->cpuc_state_change_enable = bw_def_no; in calculate_bandwidth()
1364 data->cpup_state_change_enable = bw_def_no; in calculate_bandwidth()
1365 data->cpuc_state_change_enable = bw_def_no; in calculate_bandwidth()
1375 if (data->enable[i]) { in calculate_bandwidth()
1378 data->maximum_latency_hiding[i] = bw_add(data->minimum_latency_hiding[i], in calculate_bandwidth()
1379 bw_mul(bw_frc_to_fixed(5, 10), data->total_dmifmc_urgent_latency)); in calculate_bandwidth()
1380 …data->maximum_latency_hiding_with_cursor[i] = bw_min2(data->maximum_latency_hiding[i], data->curso… in calculate_bandwidth()
1385 data->min_dram_speed_change_margin[i][j] = bw_int_to_fixed(9999); in calculate_bandwidth()
1386 data->dram_speed_change_margin = bw_int_to_fixed(9999); in calculate_bandwidth()
1387 data->dispclk_required_for_dram_speed_change[i][j] = bw_int_to_fixed(0); in calculate_bandwidth()
1388 data->num_displays_with_margin[i][j] = 0; in calculate_bandwidth()
1390 if (data->enable[k]) { in calculate_bandwidth()
1392 …data->dram_speed_change_margin = bw_sub(bw_sub(bw_sub(data->maximum_latency_hiding_with_cursor[k],… in calculate_bandwidth()
1393 …if ((bw_mtn(data->dram_speed_change_margin, bw_int_to_fixed(0)) && bw_ltn(data->dram_speed_change_… in calculate_bandwidth()
1395 …data->min_dram_speed_change_margin[i][j] = bw_min2(data->min_dram_speed_change_margin[i][j], data-… in calculate_bandwidth()
1397 …data->dispclk_required_for_dram_speed_change_pipe[i][j] = bw_max2(bw_div(bw_div(bw_mul(data->src_p… in calculate_bandwidth()
1398 …if ((bw_ltn(data->dispclk_required_for_dram_speed_change_pipe[i][j], vbios->high_voltage_max_dispc… in calculate_bandwidth()
1399 data->display_pstate_change_enable[k] = 1; in calculate_bandwidth()
1400 data->num_displays_with_margin[i][j] = data->num_displays_with_margin[i][j] + 1; in calculate_bandwidth()
1401 …data->dispclk_required_for_dram_speed_change[i][j] = bw_max2(data->dispclk_required_for_dram_speed… in calculate_bandwidth()
1406 …data->dram_speed_change_margin = bw_sub(bw_sub(bw_sub(bw_sub(data->maximum_latency_hiding_with_cur… in calculate_bandwidth()
1407 …if ((bw_mtn(data->dram_speed_change_margin, bw_int_to_fixed(0)) && bw_ltn(data->dram_speed_change_… in calculate_bandwidth()
1409 …data->min_dram_speed_change_margin[i][j] = bw_min2(data->min_dram_speed_change_margin[i][j], data-… in calculate_bandwidth()
1411 …data->dispclk_required_for_dram_speed_change_pipe[i][j] = bw_max2(bw_div(bw_div(bw_mul(data->src_p… in calculate_bandwidth()
1412 …if ((bw_ltn(data->dispclk_required_for_dram_speed_change_pipe[i][j], vbios->high_voltage_max_dispc… in calculate_bandwidth()
1413 data->display_pstate_change_enable[k] = 1; in calculate_bandwidth()
1414 data->num_displays_with_margin[i][j] = data->num_displays_with_margin[i][j] + 1; in calculate_bandwidth()
1415 …data->dispclk_required_for_dram_speed_change[i][j] = bw_max2(data->dispclk_required_for_dram_speed… in calculate_bandwidth()
1425 if (data->enable[k] == 1 && data->display_pstate_change_enable[k] == 1) { in calculate_bandwidth()
1432 data->min_vblank_dram_speed_change_margin = bw_int_to_fixed(9999); in calculate_bandwidth()
1434 if (data->enable[k]) { in calculate_bandwidth()
1436 …data->v_blank_dram_speed_change_margin[k] = bw_sub(bw_sub(bw_sub(bw_div(bw_mul((bw_sub(data->v_tot… in calculate_bandwidth()
1437 …data->min_vblank_dram_speed_change_margin = bw_min2(data->min_vblank_dram_speed_change_margin, dat… in calculate_bandwidth()
1440 …data->v_blank_dram_speed_change_margin[k] = bw_sub(bw_sub(bw_sub(bw_sub(bw_div(bw_mul((bw_sub(data… in calculate_bandwidth()
1441 …data->min_vblank_dram_speed_change_margin = bw_min2(data->min_vblank_dram_speed_change_margin, dat… in calculate_bandwidth()
1446 data->displays_with_same_mode[i] = bw_int_to_fixed(0); in calculate_bandwidth()
1447 …if (data->enable[i] == 1 && data->display_pstate_change_enable[i] == 0 && bw_mtn(data->v_blank_dra… in calculate_bandwidth()
1449 …data->display_synchronization_enabled) && (data->enable[j] == 1 && bw_equ(data->source_width_round… in calculate_bandwidth()
1450 … data->displays_with_same_mode[i] = bw_add(data->displays_with_same_mode[i], bw_int_to_fixed(1)); in calculate_bandwidth()
1458 …o_int(bw_max2(bw_int_to_fixed(number_of_aligned_displays_with_no_margin), data->displays_with_same… in calculate_bandwidth()
1464 …data->min_dram_speed_change_margin[high][s_high], bw_int_to_fixed(0)) && bw_ltn(data->min_dram_spe… in calculate_bandwidth()
1465 data->nbp_state_change_enable = bw_def_yes; in calculate_bandwidth()
1468 data->nbp_state_change_enable = bw_def_no; in calculate_bandwidth()
1482 if (data->enable[i]) { in calculate_bandwidth()
1483 …data->average_bandwidth_no_compression[i] = bw_div(bw_mul(bw_mul(bw_div(bw_mul(data->source_width_… in calculate_bandwidth()
1484 …data->average_bandwidth[i] = bw_div(data->average_bandwidth_no_compression[i], data->compression_r… in calculate_bandwidth()
1487 data->total_average_bandwidth_no_compression = bw_int_to_fixed(0); in calculate_bandwidth()
1488 data->total_average_bandwidth = bw_int_to_fixed(0); in calculate_bandwidth()
1490 if (data->enable[i]) { in calculate_bandwidth()
1491 …data->total_average_bandwidth_no_compression = bw_add(data->total_average_bandwidth_no_compression… in calculate_bandwidth()
1492 … data->total_average_bandwidth = bw_add(data->total_average_bandwidth, data->average_bandwidth[i]); in calculate_bandwidth()
1500 data->min_cursor_memory_interface_buffer_size_in_time = bw_int_to_fixed(9999); in calculate_bandwidth()
1504 if (data->enable[i]) { in calculate_bandwidth()
1505 if (bw_mtn(data->cursor_width_pixels[i], bw_int_to_fixed(0))) { in calculate_bandwidth()
1507 if (bw_leq(data->cursor_width_pixels[i], bw_int_to_fixed(64)) && dceip->large_cursor == 1) { in calculate_bandwidth()
1513 …data->min_cursor_memory_interface_buffer_size_in_time = bw_min2(data->min_cursor_memory_interface_… in calculate_bandwidth()
1519 data->chunk_request_delay = 0; in calculate_bandwidth()
1522 …data->chunk_request_delay = bw_fixed_to_int(bw_div(bw_int_to_fixed(512), vbios->high_voltage_max_d… in calculate_bandwidth()
1524 …data->min_read_buffer_size_in_time = bw_min2(data->min_cursor_memory_interface_buffer_size_in_time… in calculate_bandwidth()
1525 …data->display_reads_time_for_data_transfer = bw_sub(bw_sub(data->min_read_buffer_size_in_time, dat… in calculate_bandwidth()
1526 …data->display_writes_time_for_data_transfer = bw_sub(data->min_mcifwr_size_in_time, vbios->mcifwrm… in calculate_bandwidth()
1527 …data->dmif_required_dram_bandwidth = bw_div(data->total_display_reads_required_dram_access_data, d… in calculate_bandwidth()
1528 …data->mcifwr_required_dram_bandwidth = bw_div(data->total_display_writes_required_dram_access_data… in calculate_bandwidth()
1529 …data->required_dmifmc_urgent_latency_for_page_close_open = bw_div((bw_sub(data->min_read_buffer_si… in calculate_bandwidth()
1530 …data->required_mcifmcwr_urgent_latency = bw_sub(data->min_mcifwr_size_in_time, data->mcifwr_total_… in calculate_bandwidth()
1531 …if (bw_mtn(data->scatter_gather_total_pte_requests, dceip->maximum_total_outstanding_pte_requests_… in calculate_bandwidth()
1532 data->required_dram_bandwidth_gbyte_per_second = bw_int_to_fixed(9999); in calculate_bandwidth()
1534 data->y_clk_level = high; in calculate_bandwidth()
1535 …data->dram_bandwidth = bw_mul(bw_div(bw_mul(bw_mul(data->dram_efficiency, yclk[high]), bw_int_to_f… in calculate_bandwidth()
1537 …>dmifmc_urgent_latency, data->required_dmifmc_urgent_latency_for_page_close_open) || bw_mtn(vbios-… in calculate_bandwidth()
1538 data->required_dram_bandwidth_gbyte_per_second = bw_int_to_fixed(9999); in calculate_bandwidth()
1540 data->y_clk_level = high; in calculate_bandwidth()
1541 …data->dram_bandwidth = bw_mul(bw_div(bw_mul(bw_mul(data->dram_efficiency, yclk[high]), bw_int_to_f… in calculate_bandwidth()
1544 …data->required_dram_bandwidth_gbyte_per_second = bw_div(bw_max2(data->dmif_required_dram_bandwidth… in calculate_bandwidth()
1545 …if (bw_ltn(data->total_average_bandwidth_no_compression, bw_mul(bw_mul(bw_mul(bw_frc_to_fixed(dcei… in calculate_bandwidth()
1546 …data->required_dram_bandwidth_gbyte_per_second, bw_int_to_fixed(1000)), bw_mul(bw_div(bw_mul(bw_mu… in calculate_bandwidth()
1548 data->y_clk_level = low; in calculate_bandwidth()
1549 …data->dram_bandwidth = bw_mul(bw_div(bw_mul(bw_mul(data->dram_efficiency, yclk[low]), bw_int_to_fi… in calculate_bandwidth()
1551 …else if (bw_ltn(data->total_average_bandwidth_no_compression, bw_mul(bw_mul(bw_mul(bw_frc_to_fixed… in calculate_bandwidth()
1552 …data->required_dram_bandwidth_gbyte_per_second, bw_int_to_fixed(1000)), bw_mul(bw_div(bw_mul(bw_mu… in calculate_bandwidth()
1554 data->y_clk_level = mid; in calculate_bandwidth()
1555 …data->dram_bandwidth = bw_mul(bw_div(bw_mul(bw_mul(data->dram_efficiency, yclk[mid]), bw_int_to_fi… in calculate_bandwidth()
1557 …else if (bw_ltn(data->total_average_bandwidth_no_compression, bw_mul(bw_mul(bw_mul(bw_frc_to_fixed… in calculate_bandwidth()
1558 …data->required_dram_bandwidth_gbyte_per_second, bw_int_to_fixed(1000)), bw_mul(bw_div(bw_mul(bw_mu… in calculate_bandwidth()
1560 data->y_clk_level = high; in calculate_bandwidth()
1561 …data->dram_bandwidth = bw_mul(bw_div(bw_mul(bw_mul(data->dram_efficiency, yclk[high]), bw_int_to_f… in calculate_bandwidth()
1565 data->y_clk_level = high; in calculate_bandwidth()
1566 …data->dram_bandwidth = bw_mul(bw_div(bw_mul(bw_mul(data->dram_efficiency, yclk[high]), bw_int_to_f… in calculate_bandwidth()
1574 …data->dmif_required_sclk = bw_div(bw_div(data->total_display_reads_required_data, data->display_re… in calculate_bandwidth()
1575 …data->mcifwr_required_sclk = bw_div(bw_div(data->total_display_writes_required_data, data->display… in calculate_bandwidth()
1576 …if (bw_mtn(data->scatter_gather_total_pte_requests, dceip->maximum_total_outstanding_pte_requests_… in calculate_bandwidth()
1577 data->required_sclk = bw_int_to_fixed(9999); in calculate_bandwidth()
1579 data->sclk_level = s_high; in calculate_bandwidth()
1581 …>dmifmc_urgent_latency, data->required_dmifmc_urgent_latency_for_page_close_open) || bw_mtn(vbios-… in calculate_bandwidth()
1582 data->required_sclk = bw_int_to_fixed(9999); in calculate_bandwidth()
1584 data->sclk_level = s_high; in calculate_bandwidth()
1587 data->required_sclk = bw_max2(data->dmif_required_sclk, data->mcifwr_required_sclk); in calculate_bandwidth()
1588 …if (bw_ltn(data->total_average_bandwidth_no_compression, bw_mul(bw_mul(bw_frc_to_fixed(dceip->max_… in calculate_bandwidth()
1589 …data->required_sclk, sclk[s_low]) && (data->cpup_state_change_enable == bw_def_no || (bw_mtn(data-… in calculate_bandwidth()
1591 data->sclk_level = s_low; in calculate_bandwidth()
1592 data->required_sclk = vbios->low_sclk; in calculate_bandwidth()
1594 …else if (bw_ltn(data->total_average_bandwidth_no_compression, bw_mul(bw_mul(bw_frc_to_fixed(dceip-… in calculate_bandwidth()
1595 …data->required_sclk, sclk[s_mid1]) && (data->cpup_state_change_enable == bw_def_no || (bw_mtn(data… in calculate_bandwidth()
1597 data->sclk_level = s_mid1; in calculate_bandwidth()
1598 data->required_sclk = vbios->mid1_sclk; in calculate_bandwidth()
1600 …else if (bw_ltn(data->total_average_bandwidth_no_compression, bw_mul(bw_mul(bw_frc_to_fixed(dceip-… in calculate_bandwidth()
1601 …data->required_sclk, sclk[s_mid2]) && (data->cpup_state_change_enable == bw_def_no || (bw_mtn(data… in calculate_bandwidth()
1603 data->sclk_level = s_mid2; in calculate_bandwidth()
1604 data->required_sclk = vbios->mid2_sclk; in calculate_bandwidth()
1606 …else if (bw_ltn(data->total_average_bandwidth_no_compression, bw_mul(bw_mul(bw_frc_to_fixed(dceip-… in calculate_bandwidth()
1607 …data->required_sclk, sclk[s_mid3]) && (data->cpup_state_change_enable == bw_def_no || (bw_mtn(data… in calculate_bandwidth()
1609 data->sclk_level = s_mid3; in calculate_bandwidth()
1610 data->required_sclk = vbios->mid3_sclk; in calculate_bandwidth()
1612 …else if (bw_ltn(data->total_average_bandwidth_no_compression, bw_mul(bw_mul(bw_frc_to_fixed(dceip-… in calculate_bandwidth()
1613 …data->required_sclk, sclk[s_mid4]) && (data->cpup_state_change_enable == bw_def_no || (bw_mtn(data… in calculate_bandwidth()
1615 data->sclk_level = s_mid4; in calculate_bandwidth()
1616 data->required_sclk = vbios->mid4_sclk; in calculate_bandwidth()
1618 …else if (bw_ltn(data->total_average_bandwidth_no_compression, bw_mul(bw_mul(bw_frc_to_fixed(dceip-… in calculate_bandwidth()
1619 …data->required_sclk, sclk[s_mid5]) && (data->cpup_state_change_enable == bw_def_no || (bw_mtn(data… in calculate_bandwidth()
1621 data->sclk_level = s_mid5; in calculate_bandwidth()
1622 data->required_sclk = vbios->mid5_sclk; in calculate_bandwidth()
1624 …else if (bw_ltn(data->total_average_bandwidth_no_compression, bw_mul(bw_mul(bw_frc_to_fixed(dceip-… in calculate_bandwidth()
1625 …data->required_sclk, sclk[s_mid6]) && (data->cpup_state_change_enable == bw_def_no || (bw_mtn(data… in calculate_bandwidth()
1627 data->sclk_level = s_mid6; in calculate_bandwidth()
1628 data->required_sclk = vbios->mid6_sclk; in calculate_bandwidth()
1630 …else if (bw_ltn(data->total_average_bandwidth_no_compression, bw_mul(bw_mul(bw_frc_to_fixed(dceip-… in calculate_bandwidth()
1631 && bw_ltn(data->required_sclk, sclk[s_high])) { in calculate_bandwidth()
1633 data->sclk_level = s_high; in calculate_bandwidth()
1634 data->required_sclk = vbios->high_sclk; in calculate_bandwidth()
1636 …else if (bw_meq(data->total_average_bandwidth_no_compression, bw_mul(bw_mul(bw_frc_to_fixed(dceip-… in calculate_bandwidth()
1637 && bw_ltn(data->required_sclk, sclk[s_high])) { in calculate_bandwidth()
1639 data->sclk_level = s_high; in calculate_bandwidth()
1640 data->required_sclk = vbios->high_sclk; in calculate_bandwidth()
1644 data->sclk_level = s_high; in calculate_bandwidth()
1662 …data->downspread_factor = bw_add(bw_int_to_fixed(1), bw_div(vbios->down_spread_percentage, bw_int_… in calculate_bandwidth()
1664 if (data->enable[i]) { in calculate_bandwidth()
1666 switch (data->lb_bpc[i]) { in calculate_bandwidth()
1668 data->v_scaler_efficiency = dceip->graphics_vscaler_efficiency6_bit_per_component; in calculate_bandwidth()
1671 data->v_scaler_efficiency = dceip->graphics_vscaler_efficiency8_bit_per_component; in calculate_bandwidth()
1674 data->v_scaler_efficiency = dceip->graphics_vscaler_efficiency10_bit_per_component; in calculate_bandwidth()
1677 data->v_scaler_efficiency = dceip->graphics_vscaler_efficiency12_bit_per_component; in calculate_bandwidth()
1680 if (data->use_alpha[i] == 1) { in calculate_bandwidth()
1681 … data->v_scaler_efficiency = bw_min2(data->v_scaler_efficiency, dceip->alpha_vscaler_efficiency); in calculate_bandwidth()
1685 switch (data->lb_bpc[i]) { in calculate_bandwidth()
1687 data->v_scaler_efficiency = dceip->underlay_vscaler_efficiency6_bit_per_component; in calculate_bandwidth()
1690 data->v_scaler_efficiency = dceip->underlay_vscaler_efficiency8_bit_per_component; in calculate_bandwidth()
1693 data->v_scaler_efficiency = dceip->underlay_vscaler_efficiency10_bit_per_component; in calculate_bandwidth()
1696 data->v_scaler_efficiency = dceip->underlay_vscaler_efficiency12_bit_per_component; in calculate_bandwidth()
1700 if (dceip->pre_downscaler_enabled && bw_mtn(data->hsr[i], bw_int_to_fixed(1))) { in calculate_bandwidth()
1701 …data->scaler_limits_factor = bw_max2(bw_div(data->v_taps[i], data->v_scaler_efficiency), bw_div(da… in calculate_bandwidth()
1704 …data->scaler_limits_factor = bw_max3(bw_int_to_fixed(1), bw_ceil2(bw_div(data->h_taps[i], bw_int_t… in calculate_bandwidth()
1706 …data->display_pipe_pixel_throughput = bw_div(bw_div(bw_mul(bw_max2(data->lb_lines_in_per_line_out_… in calculate_bandwidth()
1707 …data->dispclk_required_without_ramping[i] = bw_mul(data->downspread_factor, bw_max2(bw_mul(data->p… in calculate_bandwidth()
1708 …data->dispclk_required_with_ramping[i] = bw_mul(dceip->dispclk_ramping_factor, bw_max2(bw_mul(data… in calculate_bandwidth()
1711 data->total_dispclk_required_with_ramping = bw_int_to_fixed(0); in calculate_bandwidth()
1712 data->total_dispclk_required_without_ramping = bw_int_to_fixed(0); in calculate_bandwidth()
1714 if (data->enable[i]) { in calculate_bandwidth()
1715 if (bw_ltn(data->total_dispclk_required_with_ramping, data->dispclk_required_with_ramping[i])) { in calculate_bandwidth()
1716 data->total_dispclk_required_with_ramping = data->dispclk_required_with_ramping[i]; in calculate_bandwidth()
1718 …if (bw_ltn(data->total_dispclk_required_without_ramping, data->dispclk_required_without_ramping[i]… in calculate_bandwidth()
1719 data->total_dispclk_required_without_ramping = data->dispclk_required_without_ramping[i]; in calculate_bandwidth()
1723 data->total_read_request_bandwidth = bw_int_to_fixed(0); in calculate_bandwidth()
1724 data->total_write_request_bandwidth = bw_int_to_fixed(0); in calculate_bandwidth()
1726 if (data->enable[i]) { in calculate_bandwidth()
1728 …data->total_read_request_bandwidth = bw_add(data->total_read_request_bandwidth, data->request_band… in calculate_bandwidth()
1731 …data->total_write_request_bandwidth = bw_add(data->total_write_request_bandwidth, data->request_ba… in calculate_bandwidth()
1735 …data->dispclk_required_for_total_read_request_bandwidth = bw_div(bw_mul(data->total_read_request_b… in calculate_bandwidth()
1736 …data->total_dispclk_required_with_ramping_with_request_bandwidth = bw_max2(data->total_dispclk_req… in calculate_bandwidth()
1737 …data->total_dispclk_required_without_ramping_with_request_bandwidth = bw_max2(data->total_dispclk_… in calculate_bandwidth()
1738 if (data->cpuc_state_change_enable == bw_def_yes) { in calculate_bandwidth()
1739 …data->total_dispclk_required_with_ramping_with_request_bandwidth = bw_max3(data->total_dispclk_req… in calculate_bandwidth()
1740 …data->total_dispclk_required_without_ramping_with_request_bandwidth = bw_max3(data->total_dispclk_… in calculate_bandwidth()
1742 if (data->cpup_state_change_enable == bw_def_yes) { in calculate_bandwidth()
1743 …data->total_dispclk_required_with_ramping_with_request_bandwidth = bw_max2(data->total_dispclk_req… in calculate_bandwidth()
1744 …data->total_dispclk_required_without_ramping_with_request_bandwidth = bw_max2(data->total_dispclk_… in calculate_bandwidth()
1746 if (data->nbp_state_change_enable == bw_def_yes && data->increase_voltage_to_support_mclk_switch) { in calculate_bandwidth()
1747 …data->total_dispclk_required_with_ramping_with_request_bandwidth = bw_max2(data->total_dispclk_req… in calculate_bandwidth()
1748 …data->total_dispclk_required_without_ramping_with_request_bandwidth = bw_max2(data->total_dispclk_… in calculate_bandwidth()
1750 …if (bw_ltn(data->total_dispclk_required_with_ramping_with_request_bandwidth, vbios->high_voltage_m… in calculate_bandwidth()
1751 data->dispclk = data->total_dispclk_required_with_ramping_with_request_bandwidth; in calculate_bandwidth()
1753 …else if (bw_ltn(data->total_dispclk_required_without_ramping_with_request_bandwidth, vbios->high_v… in calculate_bandwidth()
1754 data->dispclk = vbios->high_voltage_max_dispclk; in calculate_bandwidth()
1757 data->dispclk = data->total_dispclk_required_without_ramping_with_request_bandwidth; in calculate_bandwidth()
1770 …d(yclk_message), vbios->low_yclk) && sclk_message == bw_def_low && bw_ltn(data->dispclk, vbios->lo… in calculate_bandwidth()
1773 …) && (sclk_message == bw_def_low || sclk_message == bw_def_mid) && bw_ltn(data->dispclk, vbios->mi… in calculate_bandwidth()
1776 …w || sclk_message == bw_def_mid || sclk_message == bw_def_high) && bw_leq(data->dispclk, vbios->hi… in calculate_bandwidth()
1777 if ((data->nbp_state_change_enable == bw_def_no && nbp_state_change_enable_blank == bw_def_no)) { in calculate_bandwidth()
1788 data->max_phyclk = vbios->low_voltage_max_phyclk; in calculate_bandwidth()
1791 data->max_phyclk = vbios->mid_voltage_max_phyclk; in calculate_bandwidth()
1794 data->max_phyclk = vbios->high_voltage_max_phyclk; in calculate_bandwidth()
1797 data->blackout_recovery_time = bw_int_to_fixed(0); in calculate_bandwidth()
1799 …if (data->enable[k] && bw_mtn(vbios->blackout_duration, bw_int_to_fixed(0)) && data->cpup_state_ch… in calculate_bandwidth()
1801 …data->blackout_recovery_time = bw_max2(data->blackout_recovery_time, bw_add(bw_mul(bw_int_to_fixed… in calculate_bandwidth()
1802 …data->adjusted_data_buffer_size[k], bw_mul(bw_div(bw_mul(data->display_bandwidth[k], data->useful_… in calculate_bandwidth()
1803 …data->blackout_recovery_time = bw_max2(data->blackout_recovery_time, bw_div((bw_add(bw_mul(bw_div(… in calculate_bandwidth()
1807 …data->blackout_recovery_time = bw_max2(data->blackout_recovery_time, bw_add(bw_mul(bw_int_to_fixed… in calculate_bandwidth()
1808 …data->adjusted_data_buffer_size[k], bw_mul(bw_div(bw_mul(data->display_bandwidth[k], data->useful_… in calculate_bandwidth()
1809 …data->blackout_recovery_time = bw_max2(data->blackout_recovery_time, bw_div((bw_add(bw_mul(bw_div(… in calculate_bandwidth()
1821 if (data->enable[i]) { in calculate_bandwidth()
1823 data->pixels_per_data_fifo_entry[i] = bw_int_to_fixed(16); in calculate_bandwidth()
1826 …data->pixels_per_data_fifo_entry[i] = bw_div(bw_int_to_fixed(64), bw_int_to_fixed(data->bytes_per_… in calculate_bandwidth()
1828 else if (data->orthogonal_rotation[i] == 0) { in calculate_bandwidth()
1829 data->pixels_per_data_fifo_entry[i] = bw_int_to_fixed(16); in calculate_bandwidth()
1832 …data->pixels_per_data_fifo_entry[i] = bw_div(bw_int_to_fixed(16), bw_int_to_fixed(data->bytes_per_… in calculate_bandwidth()
1836 data->min_pixels_per_data_fifo_entry = bw_int_to_fixed(9999); in calculate_bandwidth()
1838 if (data->enable[i]) { in calculate_bandwidth()
1839 if (bw_mtn(data->min_pixels_per_data_fifo_entry, data->pixels_per_data_fifo_entry[i])) { in calculate_bandwidth()
1840 data->min_pixels_per_data_fifo_entry = data->pixels_per_data_fifo_entry[i]; in calculate_bandwidth()
1844 …data->sclk_deep_sleep = bw_max2(bw_div(bw_mul(data->dispclk, bw_frc_to_fixed(115, 100)), data->min… in calculate_bandwidth()
1851 data->chunk_request_time = bw_int_to_fixed(0); in calculate_bandwidth()
1852 data->cursor_request_time = bw_int_to_fixed(0); in calculate_bandwidth()
1855 if (data->enable[i]) { in calculate_bandwidth()
1856 …data->chunk_request_time = bw_add(data->chunk_request_time, (bw_div((bw_div(bw_int_to_fixed(pixels… in calculate_bandwidth()
1860 …data->cursor_request_time = (bw_div(data->cursor_total_data, (bw_mul(bw_int_to_fixed(32), sclk[dat… in calculate_bandwidth()
1862 if (data->enable[i]) { in calculate_bandwidth()
1863 …data->line_source_pixels_transfer_time = bw_max2(bw_div(bw_div(data->src_pixels_for_first_output_p… in calculate_bandwidth()
1865 …data->urgent_watermark[i] = bw_add(bw_add(bw_add(bw_add(bw_add(data->total_dmifmc_urgent_latency, … in calculate_bandwidth()
1866 …data->stutter_exit_watermark[i] = bw_add(bw_sub(vbios->stutter_self_refresh_exit_latency, data->to… in calculate_bandwidth()
1867 …data->stutter_entry_watermark[i] = bw_add(bw_sub(bw_add(vbios->stutter_self_refresh_exit_latency, … in calculate_bandwidth()
1869 if (data->display_pstate_change_enable[i] == 1) { in calculate_bandwidth()
1870 …data->nbp_state_change_watermark[i] = bw_add(bw_add(vbios->nbp_state_change_latency, data->dmif_bu… in calculate_bandwidth()
1874 data->nbp_state_change_watermark[i] = bw_int_to_fixed(131000); in calculate_bandwidth()
1878 …data->urgent_watermark[i] = bw_add(bw_add(bw_add(bw_add(bw_add(vbios->mcifwrmc_urgent_latency, dat… in calculate_bandwidth()
1879 data->stutter_exit_watermark[i] = bw_int_to_fixed(0); in calculate_bandwidth()
1880 data->stutter_entry_watermark[i] = bw_int_to_fixed(0); in calculate_bandwidth()
1881 if (data->display_pstate_change_enable[i] == 1) { in calculate_bandwidth()
1882 …data->nbp_state_change_watermark[i] = bw_add(bw_add(vbios->nbp_state_change_latency, data->mcifwr_… in calculate_bandwidth()
1886 data->nbp_state_change_watermark[i] = bw_int_to_fixed(131000); in calculate_bandwidth()
1894 data->stutter_mode_enable = data->cpuc_state_change_enable; in calculate_bandwidth()
1895 if (data->number_of_displays > 1) { in calculate_bandwidth()
1897 if (data->enable[i]) { in calculate_bandwidth()
1898 …if ((bw_mtn(data->stutter_exit_watermark[i], data->minimum_latency_hiding[i]) || bw_mtn(data->stut… in calculate_bandwidth()
1899 data->stutter_mode_enable = bw_def_no; in calculate_bandwidth()
1919 …data->dmifdram_access_efficiency = bw_min2(bw_div(bw_div(data->total_display_reads_required_dram_a… in calculate_bandwidth()
1920 if (bw_mtn(data->total_display_writes_required_dram_access_data, bw_int_to_fixed(0))) { in calculate_bandwidth()
1921 …data->mcifwrdram_access_efficiency = bw_min2(bw_div(bw_div(data->total_display_writes_required_dra… in calculate_bandwidth()
1924 data->mcifwrdram_access_efficiency = bw_int_to_fixed(0); in calculate_bandwidth()
1934 if (data->enable[i]) { in calculate_bandwidth()
1935 …data->stutter_refresh_duration[i] = bw_sub(bw_mul(bw_div(bw_div(bw_mul(bw_div(bw_div(data->adjuste… in calculate_bandwidth()
1936 …data->stutter_dmif_buffer_size[i] = bw_div(bw_mul(bw_mul(bw_div(bw_mul(bw_mul(data->stutter_refres… in calculate_bandwidth()
1939 data->min_stutter_refresh_duration = bw_int_to_fixed(9999); in calculate_bandwidth()
1940 data->total_stutter_dmif_buffer_size = 0; in calculate_bandwidth()
1941 data->total_bytes_requested = 0; in calculate_bandwidth()
1942 data->min_stutter_dmif_buffer_size = 9999; in calculate_bandwidth()
1944 if (data->enable[i]) { in calculate_bandwidth()
1945 if (bw_mtn(data->min_stutter_refresh_duration, data->stutter_refresh_duration[i])) { in calculate_bandwidth()
1946 data->min_stutter_refresh_duration = data->stutter_refresh_duration[i]; in calculate_bandwidth()
1947 …data->total_bytes_requested = bw_fixed_to_int(bw_add(bw_int_to_fixed(data->total_bytes_requested),… in calculate_bandwidth()
1948 data->min_stutter_dmif_buffer_size = bw_fixed_to_int(data->stutter_dmif_buffer_size[i]); in calculate_bandwidth()
1950 …data->total_stutter_dmif_buffer_size = bw_fixed_to_int(bw_add(data->stutter_dmif_buffer_size[i], b… in calculate_bandwidth()
1953 …data->stutter_burst_time = bw_div(bw_int_to_fixed(data->total_stutter_dmif_buffer_size), bw_mul(sc… in calculate_bandwidth()
1954 data->num_stutter_bursts = data->total_bytes_requested / data->min_stutter_dmif_buffer_size; in calculate_bandwidth()
1955 …data->total_stutter_cycle_duration = bw_add(bw_add(data->min_stutter_refresh_duration, vbios->stut… in calculate_bandwidth()
1956 data->time_in_self_refresh = data->min_stutter_refresh_duration; in calculate_bandwidth()
1957 if (data->d1_display_write_back_dwb_enable == 1) { in calculate_bandwidth()
1958 data->stutter_efficiency = bw_int_to_fixed(0); in calculate_bandwidth()
1960 else if (bw_ltn(data->time_in_self_refresh, bw_int_to_fixed(0))) { in calculate_bandwidth()
1961 data->stutter_efficiency = bw_int_to_fixed(0); in calculate_bandwidth()
1965 …data->stutter_efficiency = bw_max2(bw_int_to_fixed(0), bw_mul((bw_sub(bw_int_to_fixed(1), (bw_div(… in calculate_bandwidth()
1970 data->worst_number_of_trips_to_memory = bw_int_to_fixed(1); in calculate_bandwidth()
1972 if (data->enable[i] && data->scatter_gather_enable_for_pipe[i] == 1) { in calculate_bandwidth()
1973 …data->number_of_trips_to_memory_for_getting_apte_row[i] = bw_ceil2(bw_div(data->scatter_gather_pte… in calculate_bandwidth()
1974 …if (bw_ltn(data->worst_number_of_trips_to_memory, data->number_of_trips_to_memory_for_getting_apte… in calculate_bandwidth()
1975 data->worst_number_of_trips_to_memory = data->number_of_trips_to_memory_for_getting_apte_row[i]; in calculate_bandwidth()
1979 …data->immediate_flip_time = bw_mul(data->worst_number_of_trips_to_memory, data->total_dmifmc_urgen… in calculate_bandwidth()
1982 …data->latency_for_non_dmif_clients = bw_add(data->total_dmifmc_urgent_latency, data->dmif_burst_ti… in calculate_bandwidth()
1983 if (data->d1_display_write_back_dwb_enable == 1) { in calculate_bandwidth()
1984 …data->latency_for_non_mcifwr_clients = bw_add(vbios->mcifwrmc_urgent_latency, dceip->mcifwr_all_su… in calculate_bandwidth()
1987 data->latency_for_non_mcifwr_clients = bw_int_to_fixed(0); in calculate_bandwidth()
1990 …data->dmifmc_urgent_latency_supported_in_high_sclk_and_yclk = bw_div((bw_sub(data->min_read_buffer… in calculate_bandwidth()
1993 data->v_blank_nbp_state_dram_speed_change_latency_supported = bw_int_to_fixed(99999); in calculate_bandwidth()
1994 data->nbp_state_dram_speed_change_latency_supported = bw_int_to_fixed(99999); in calculate_bandwidth()
1996 if (data->enable[i]) { in calculate_bandwidth()
1997 …data->nbp_state_dram_speed_change_latency_supported = bw_min2(data->nbp_state_dram_speed_change_la… in calculate_bandwidth()
1998 …data->v_blank_nbp_state_dram_speed_change_latency_supported = bw_min2(data->v_blank_nbp_state_dram… in calculate_bandwidth()
2003 …data->display_reads_time_for_data_transfer_and_urgent_latency = bw_sub(data->min_read_buffer_size_… in calculate_bandwidth()
2004 …if (pipe_check == bw_def_ok && (bw_mtn(data->display_reads_time_for_data_transfer_and_urgent_laten… in calculate_bandwidth()
2005 …data->dmif_required_sclk_for_urgent_latency[i] = bw_div(bw_div(data->total_display_reads_required_… in calculate_bandwidth()
2008 data->dmif_required_sclk_for_urgent_latency[i] = bw_int_to_fixed(bw_def_na); in calculate_bandwidth()
2013 data->output_bpphdmi[k] = bw_def_na; in calculate_bandwidth()
2014 data->output_bppdp4_lane_hbr[k] = bw_def_na; in calculate_bandwidth()
2015 data->output_bppdp4_lane_hbr2[k] = bw_def_na; in calculate_bandwidth()
2016 data->output_bppdp4_lane_hbr3[k] = bw_def_na; in calculate_bandwidth()
2017 if (data->enable[k]) { in calculate_bandwidth()
2018 …data->output_bpphdmi[k] = bw_fixed_to_int(bw_mul(bw_div(bw_min2(bw_int_to_fixed(600), data->max_ph… in calculate_bandwidth()
2019 if (bw_meq(data->max_phyclk, bw_int_to_fixed(270))) { in calculate_bandwidth()
2020 …data->output_bppdp4_lane_hbr[k] = bw_fixed_to_int(bw_mul(bw_div(bw_mul(bw_int_to_fixed(270), bw_in… in calculate_bandwidth()
2022 if (bw_meq(data->max_phyclk, bw_int_to_fixed(540))) { in calculate_bandwidth()
2023 …data->output_bppdp4_lane_hbr2[k] = bw_fixed_to_int(bw_mul(bw_div(bw_mul(bw_int_to_fixed(540), bw_i… in calculate_bandwidth()
2025 if (bw_meq(data->max_phyclk, bw_int_to_fixed(810))) { in calculate_bandwidth()
2026 …data->output_bppdp4_lane_hbr3[k] = bw_fixed_to_int(bw_mul(bw_div(bw_mul(bw_int_to_fixed(810), bw_i… in calculate_bandwidth()
2786 const struct pipe_ctx pipe[], int pipe_count, struct bw_calcs_data *data) in populate_initial_data() argument
2791 data->underlay_surface_type = bw_def_420; in populate_initial_data()
2792 data->panning_and_bezel_adjustment = bw_def_none; in populate_initial_data()
2793 data->graphics_lb_bpc = 10; in populate_initial_data()
2794 data->underlay_lb_bpc = 8; in populate_initial_data()
2795 data->underlay_tiling_mode = bw_def_tiled; in populate_initial_data()
2796 data->graphics_tiling_mode = bw_def_tiled; in populate_initial_data()
2797 data->underlay_micro_tile_mode = bw_def_display_micro_tiling; in populate_initial_data()
2798 data->graphics_micro_tile_mode = bw_def_display_micro_tiling; in populate_initial_data()
2799 data->increase_voltage_to_support_mclk_switch = true; in populate_initial_data()
2810 data->d0_underlay_mode = bw_def_underlay_only; in populate_initial_data()
2812 data->d0_underlay_mode = bw_def_blend; in populate_initial_data()
2815 data->d1_underlay_mode = bw_def_underlay_only; in populate_initial_data()
2817 data->d1_underlay_mode = bw_def_blend; in populate_initial_data()
2820 data->fbc_en[num_displays + 4] = false; in populate_initial_data()
2821 data->lpt_en[num_displays + 4] = false; in populate_initial_data()
2822 data->h_total[num_displays + 4] = bw_int_to_fixed(pipe[i].stream->timing.h_total); in populate_initial_data()
2823 data->v_total[num_displays + 4] = bw_int_to_fixed(pipe[i].stream->timing.v_total); in populate_initial_data()
2824 data->pixel_rate[num_displays + 4] = bw_frc_to_fixed(pipe[i].stream->timing.pix_clk_100hz, 10000); in populate_initial_data()
2825 data->src_width[num_displays + 4] = bw_int_to_fixed(pipe[i].plane_res.scl_data.viewport.width); in populate_initial_data()
2826 data->pitch_in_pixels[num_displays + 4] = data->src_width[num_displays + 4]; in populate_initial_data()
2827 data->src_height[num_displays + 4] = bw_int_to_fixed(pipe[i].plane_res.scl_data.viewport.height); in populate_initial_data()
2828 data->h_taps[num_displays + 4] = bw_int_to_fixed(pipe[i].plane_res.scl_data.taps.h_taps); in populate_initial_data()
2829 data->v_taps[num_displays + 4] = bw_int_to_fixed(pipe[i].plane_res.scl_data.taps.v_taps); in populate_initial_data()
2830 …data->h_scale_ratio[num_displays + 4] = fixed31_32_to_bw_fixed(pipe[i].plane_res.scl_data.ratios.h… in populate_initial_data()
2831 …data->v_scale_ratio[num_displays + 4] = fixed31_32_to_bw_fixed(pipe[i].plane_res.scl_data.ratios.v… in populate_initial_data()
2834 data->rotation_angle[num_displays + 4] = bw_int_to_fixed(0); in populate_initial_data()
2837 data->rotation_angle[num_displays + 4] = bw_int_to_fixed(90); in populate_initial_data()
2840 data->rotation_angle[num_displays + 4] = bw_int_to_fixed(180); in populate_initial_data()
2843 data->rotation_angle[num_displays + 4] = bw_int_to_fixed(270); in populate_initial_data()
2852 data->bytes_per_pixel[num_displays + 4] = 2; in populate_initial_data()
2861 data->bytes_per_pixel[num_displays + 4] = 4; in populate_initial_data()
2866 data->bytes_per_pixel[num_displays + 4] = 8; in populate_initial_data()
2869 data->bytes_per_pixel[num_displays + 4] = 4; in populate_initial_data()
2872 data->interlace_mode[num_displays + 4] = false; in populate_initial_data()
2873 data->stereo_mode[num_displays + 4] = bw_def_mono; in populate_initial_data()
2877 data->fbc_en[num_displays * 2 + j] = false; in populate_initial_data()
2878 data->lpt_en[num_displays * 2 + j] = false; in populate_initial_data()
2880 …data->src_height[num_displays * 2 + j] = bw_int_to_fixed(pipe[i].bottom_pipe->plane_res.scl_data.v… in populate_initial_data()
2881 …data->src_width[num_displays * 2 + j] = bw_int_to_fixed(pipe[i].bottom_pipe->plane_res.scl_data.vi… in populate_initial_data()
2882 data->pitch_in_pixels[num_displays * 2 + j] = bw_int_to_fixed( in populate_initial_data()
2884 …data->h_taps[num_displays * 2 + j] = bw_int_to_fixed(pipe[i].bottom_pipe->plane_res.scl_data.taps.… in populate_initial_data()
2885 …data->v_taps[num_displays * 2 + j] = bw_int_to_fixed(pipe[i].bottom_pipe->plane_res.scl_data.taps.… in populate_initial_data()
2886 data->h_scale_ratio[num_displays * 2 + j] = fixed31_32_to_bw_fixed( in populate_initial_data()
2888 data->v_scale_ratio[num_displays * 2 + j] = fixed31_32_to_bw_fixed( in populate_initial_data()
2892 data->rotation_angle[num_displays * 2 + j] = bw_int_to_fixed(0); in populate_initial_data()
2895 data->rotation_angle[num_displays * 2 + j] = bw_int_to_fixed(90); in populate_initial_data()
2898 data->rotation_angle[num_displays * 2 + j] = bw_int_to_fixed(180); in populate_initial_data()
2901 data->rotation_angle[num_displays * 2 + j] = bw_int_to_fixed(270); in populate_initial_data()
2906 data->stereo_mode[num_displays * 2 + j] = bw_def_mono; in populate_initial_data()
2919 data->fbc_en[num_displays + 4] = false; in populate_initial_data()
2920 data->lpt_en[num_displays + 4] = false; in populate_initial_data()
2921 data->h_total[num_displays + 4] = bw_int_to_fixed(pipe[i].stream->timing.h_total); in populate_initial_data()
2922 data->v_total[num_displays + 4] = bw_int_to_fixed(pipe[i].stream->timing.v_total); in populate_initial_data()
2926 data->pixel_rate[num_displays + 4] = bw_frc_to_fixed(pixel_clock_100hz, 10000); in populate_initial_data()
2928 data->src_width[num_displays + 4] = bw_int_to_fixed(pipe[i].plane_res.scl_data.viewport.width); in populate_initial_data()
2929 data->pitch_in_pixels[num_displays + 4] = data->src_width[num_displays + 4]; in populate_initial_data()
2930 data->src_height[num_displays + 4] = bw_int_to_fixed(pipe[i].plane_res.scl_data.viewport.height); in populate_initial_data()
2931 data->h_taps[num_displays + 4] = bw_int_to_fixed(pipe[i].plane_res.scl_data.taps.h_taps); in populate_initial_data()
2932 data->v_taps[num_displays + 4] = bw_int_to_fixed(pipe[i].plane_res.scl_data.taps.v_taps); in populate_initial_data()
2933 …data->h_scale_ratio[num_displays + 4] = fixed31_32_to_bw_fixed(pipe[i].plane_res.scl_data.ratios.h… in populate_initial_data()
2934 …data->v_scale_ratio[num_displays + 4] = fixed31_32_to_bw_fixed(pipe[i].plane_res.scl_data.ratios.v… in populate_initial_data()
2937 data->rotation_angle[num_displays + 4] = bw_int_to_fixed(0); in populate_initial_data()
2940 data->rotation_angle[num_displays + 4] = bw_int_to_fixed(90); in populate_initial_data()
2943 data->rotation_angle[num_displays + 4] = bw_int_to_fixed(180); in populate_initial_data()
2946 data->rotation_angle[num_displays + 4] = bw_int_to_fixed(270); in populate_initial_data()
2956 data->bytes_per_pixel[num_displays + 4] = 2; in populate_initial_data()
2965 data->bytes_per_pixel[num_displays + 4] = 4; in populate_initial_data()
2970 data->bytes_per_pixel[num_displays + 4] = 8; in populate_initial_data()
2973 data->bytes_per_pixel[num_displays + 4] = 4; in populate_initial_data()
2980 data->src_width[num_displays + 4] = bw_int_to_fixed(pipe[i].stream->src.width); in populate_initial_data()
2981 data->pitch_in_pixels[num_displays + 4] = data->src_width[num_displays + 4]; in populate_initial_data()
2982 data->src_height[num_displays + 4] = bw_int_to_fixed(pipe[i].stream->src.height); in populate_initial_data()
2983 …data->h_taps[num_displays + 4] = pipe[i].stream->src.width == pipe[i].stream->dst.width ? bw_int_t… in populate_initial_data()
2984 …data->v_taps[num_displays + 4] = pipe[i].stream->src.height == pipe[i].stream->dst.height ? bw_int… in populate_initial_data()
2985 …data->h_scale_ratio[num_displays + 4] = bw_frc_to_fixed(pipe[i].stream->src.width, pipe[i].stream-… in populate_initial_data()
2986 …data->v_scale_ratio[num_displays + 4] = bw_frc_to_fixed(pipe[i].stream->src.height, pipe[i].stream… in populate_initial_data()
2987 data->rotation_angle[num_displays + 4] = bw_int_to_fixed(0); in populate_initial_data()
2988 data->bytes_per_pixel[num_displays + 4] = 4; in populate_initial_data()
2990 data->src_width[num_displays + 4] = bw_int_to_fixed(pipe[i].stream->timing.h_addressable); in populate_initial_data()
2991 data->pitch_in_pixels[num_displays + 4] = data->src_width[num_displays + 4]; in populate_initial_data()
2992 data->src_height[num_displays + 4] = bw_int_to_fixed(pipe[i].stream->timing.v_addressable); in populate_initial_data()
2993 data->h_taps[num_displays + 4] = bw_int_to_fixed(1); in populate_initial_data()
2994 data->v_taps[num_displays + 4] = bw_int_to_fixed(1); in populate_initial_data()
2995 data->h_scale_ratio[num_displays + 4] = bw_int_to_fixed(1); in populate_initial_data()
2996 data->v_scale_ratio[num_displays + 4] = bw_int_to_fixed(1); in populate_initial_data()
2997 data->rotation_angle[num_displays + 4] = bw_int_to_fixed(0); in populate_initial_data()
2998 data->bytes_per_pixel[num_displays + 4] = 4; in populate_initial_data()
3001 data->interlace_mode[num_displays + 4] = false; in populate_initial_data()
3002 data->stereo_mode[num_displays + 4] = bw_def_mono; in populate_initial_data()
3006 data->number_of_displays = num_displays; in populate_initial_data()
3048 struct bw_calcs_data *data = kzalloc(sizeof(struct bw_calcs_data), in bw_calcs() local
3050 if (!data) in bw_calcs()
3053 populate_initial_data(pipe, pipe_count, data); in bw_calcs()
3060 if (data->number_of_displays != 0) { in bw_calcs()
3077 print_bw_calcs_data(ctx, data); in bw_calcs()
3079 calculate_bandwidth(dceip, vbios, data); in bw_calcs()
3081 yclk_lvl = data->y_clk_level; in bw_calcs()
3084 data->nbp_state_change_enable; in bw_calcs()
3086 data->cpuc_state_change_enable; in bw_calcs()
3088 data->cpup_state_change_enable; in bw_calcs()
3090 data->stutter_mode_enable; in bw_calcs()
3092 bw_fixed_to_int(bw_mul(data->dispclk, in bw_calcs()
3095 bw_fixed_to_int(data->blackout_recovery_time); in bw_calcs()
3097 bw_fixed_to_int(bw_mul(data->required_sclk, in bw_calcs()
3100 bw_fixed_to_int(bw_mul(data->sclk_deep_sleep, in bw_calcs()
3115 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3118 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3121 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3126 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3129 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3133 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3136 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3140 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3146 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3149 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3152 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3156 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3159 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3163 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3166 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3170 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3174 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3177 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3180 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3184 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3187 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3191 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3194 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3198 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3202 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3205 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3208 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3212 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3215 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3219 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3222 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3226 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3233 calculate_bandwidth(dceip, vbios, data); in bw_calcs()
3236 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3239 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3242 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3247 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3250 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3254 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3257 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3261 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3267 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3270 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3273 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3277 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3280 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3284 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3287 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3291 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3295 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3298 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3301 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3305 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3308 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3312 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3315 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3319 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3323 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3326 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3329 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3333 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3336 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3340 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3343 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3347 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3354 calculate_bandwidth(dceip, vbios, data); in bw_calcs()
3357 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3360 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3363 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3367 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3370 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3374 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3377 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3381 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3386 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3389 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3392 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3396 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3399 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3403 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3406 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3410 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3413 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3416 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3419 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3423 bw_fixed_to_int(bw_mul(data->stutter_entry_watermark[0], in bw_calcs()
3426 bw_fixed_to_int(bw_mul(data->stutter_entry_watermark[1], in bw_calcs()
3430 bw_fixed_to_int(bw_mul(data->stutter_entry_watermark[7], in bw_calcs()
3433 bw_fixed_to_int(bw_mul(data->stutter_entry_watermark[8], in bw_calcs()
3437 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3440 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3443 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3446 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3450 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3453 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3457 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3460 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3464 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3485 calculate_bandwidth(dceip, vbios, data); in bw_calcs()
3488 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3491 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3494 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3498 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3501 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3505 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3508 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3512 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3516 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3519 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3522 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3526 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3529 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3533 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3536 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3540 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3544 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3547 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3550 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3554 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3557 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3561 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3564 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3568 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3572 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3575 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3578 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3582 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3585 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3589 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3592 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3596 bw_fixed_to_int(bw_mul(data-> in bw_calcs()
3618 kfree(data); in bw_calcs()