Lines Matching refs:wm
521 static u32 dce_v6_0_dram_bandwidth(struct dce6_wm_params *wm) in dce_v6_0_dram_bandwidth() argument
529 yclk.full = dfixed_const(wm->yclk); in dce_v6_0_dram_bandwidth()
531 dram_channels.full = dfixed_const(wm->dram_channels * 4); in dce_v6_0_dram_bandwidth()
550 static u32 dce_v6_0_dram_bandwidth_for_display(struct dce6_wm_params *wm) in dce_v6_0_dram_bandwidth_for_display() argument
558 yclk.full = dfixed_const(wm->yclk); in dce_v6_0_dram_bandwidth_for_display()
560 dram_channels.full = dfixed_const(wm->dram_channels * 4); in dce_v6_0_dram_bandwidth_for_display()
579 static u32 dce_v6_0_data_return_bandwidth(struct dce6_wm_params *wm) in dce_v6_0_data_return_bandwidth() argument
587 sclk.full = dfixed_const(wm->sclk); in dce_v6_0_data_return_bandwidth()
608 static u32 dce_v6_0_dmif_request_bandwidth(struct dce6_wm_params *wm) in dce_v6_0_dmif_request_bandwidth() argument
616 disp_clk.full = dfixed_const(wm->disp_clk); in dce_v6_0_dmif_request_bandwidth()
639 static u32 dce_v6_0_available_bandwidth(struct dce6_wm_params *wm) in dce_v6_0_available_bandwidth() argument
642 u32 dram_bandwidth = dce_v6_0_dram_bandwidth(wm); in dce_v6_0_available_bandwidth()
643 u32 data_return_bandwidth = dce_v6_0_data_return_bandwidth(wm); in dce_v6_0_available_bandwidth()
644 u32 dmif_req_bandwidth = dce_v6_0_dmif_request_bandwidth(wm); in dce_v6_0_available_bandwidth()
658 static u32 dce_v6_0_average_bandwidth(struct dce6_wm_params *wm) in dce_v6_0_average_bandwidth() argument
671 line_time.full = dfixed_const(wm->active_time + wm->blank_time); in dce_v6_0_average_bandwidth()
673 bpp.full = dfixed_const(wm->bytes_per_pixel); in dce_v6_0_average_bandwidth()
674 src_width.full = dfixed_const(wm->src_width); in dce_v6_0_average_bandwidth()
676 bandwidth.full = dfixed_mul(bandwidth, wm->vsc); in dce_v6_0_average_bandwidth()
691 static u32 dce_v6_0_latency_watermark(struct dce6_wm_params *wm) in dce_v6_0_latency_watermark() argument
695 u32 available_bandwidth = dce_v6_0_available_bandwidth(wm); in dce_v6_0_latency_watermark()
698 u32 dc_latency = 40000000 / wm->disp_clk; /* dc pipe latency */ in dce_v6_0_latency_watermark()
699 u32 other_heads_data_return_time = ((wm->num_heads + 1) * worst_chunk_return_time) + in dce_v6_0_latency_watermark()
700 (wm->num_heads * cursor_line_pair_return_time); in dce_v6_0_latency_watermark()
706 if (wm->num_heads == 0) in dce_v6_0_latency_watermark()
711 if ((wm->vsc.full > a.full) || in dce_v6_0_latency_watermark()
712 ((wm->vsc.full > b.full) && (wm->vtaps >= 3)) || in dce_v6_0_latency_watermark()
713 (wm->vtaps >= 5) || in dce_v6_0_latency_watermark()
714 ((wm->vsc.full >= a.full) && wm->interlaced)) in dce_v6_0_latency_watermark()
720 b.full = dfixed_const(wm->num_heads); in dce_v6_0_latency_watermark()
722 tmp = div_u64((u64) dmif_size * (u64) wm->disp_clk, mc_latency + 512); in dce_v6_0_latency_watermark()
725 lb_fill_bw = min(tmp, wm->disp_clk * wm->bytes_per_pixel / 1000); in dce_v6_0_latency_watermark()
727 a.full = dfixed_const(max_src_lines_per_dst_line * wm->src_width * wm->bytes_per_pixel); in dce_v6_0_latency_watermark()
734 if (line_fill_time < wm->active_time) in dce_v6_0_latency_watermark()
737 return latency + (line_fill_time - wm->active_time); in dce_v6_0_latency_watermark()
752 static bool dce_v6_0_average_bandwidth_vs_dram_bandwidth_for_display(struct dce6_wm_params *wm) in dce_v6_0_average_bandwidth_vs_dram_bandwidth_for_display() argument
754 if (dce_v6_0_average_bandwidth(wm) <= in dce_v6_0_average_bandwidth_vs_dram_bandwidth_for_display()
755 (dce_v6_0_dram_bandwidth_for_display(wm) / wm->num_heads)) in dce_v6_0_average_bandwidth_vs_dram_bandwidth_for_display()
772 static bool dce_v6_0_average_bandwidth_vs_available_bandwidth(struct dce6_wm_params *wm) in dce_v6_0_average_bandwidth_vs_available_bandwidth() argument
774 if (dce_v6_0_average_bandwidth(wm) <= in dce_v6_0_average_bandwidth_vs_available_bandwidth()
775 (dce_v6_0_available_bandwidth(wm) / wm->num_heads)) in dce_v6_0_average_bandwidth_vs_available_bandwidth()
790 static bool dce_v6_0_check_latency_hiding(struct dce6_wm_params *wm) in dce_v6_0_check_latency_hiding() argument
792 u32 lb_partitions = wm->lb_size / wm->src_width; in dce_v6_0_check_latency_hiding()
793 u32 line_time = wm->active_time + wm->blank_time; in dce_v6_0_check_latency_hiding()
799 if (wm->vsc.full > a.full) in dce_v6_0_check_latency_hiding()
802 if (lb_partitions <= (wm->vtaps + 1)) in dce_v6_0_check_latency_hiding()
808 latency_hiding = (latency_tolerant_lines * line_time + wm->blank_time); in dce_v6_0_check_latency_hiding()
810 if (dce_v6_0_latency_watermark(wm) <= latency_hiding) in dce_v6_0_check_latency_hiding()