@@ -561,12 +561,27 @@ void dsi_link_clk_disable_v2(struct msm_dsi_host *msm_host)
561561 clk_disable_unprepare (msm_host -> byte_clk );
562562}
563563
564- static unsigned long dsi_get_pclk_rate (const struct drm_display_mode * mode , bool is_bonded_dsi )
564+ static unsigned long dsi_adjust_pclk_for_compression (const struct drm_display_mode * mode ,
565+ const struct drm_dsc_config * dsc )
566+ {
567+ int new_hdisplay = DIV_ROUND_UP (mode -> hdisplay * drm_dsc_get_bpp_int (dsc ),
568+ dsc -> bits_per_component * 3 );
569+
570+ int new_htotal = mode -> htotal - mode -> hdisplay + new_hdisplay ;
571+
572+ return new_htotal * mode -> vtotal * drm_mode_vrefresh (mode );
573+ }
574+
575+ static unsigned long dsi_get_pclk_rate (const struct drm_display_mode * mode ,
576+ const struct drm_dsc_config * dsc , bool is_bonded_dsi )
565577{
566578 unsigned long pclk_rate ;
567579
568580 pclk_rate = mode -> clock * 1000 ;
569581
582+ if (dsc )
583+ pclk_rate = dsi_adjust_pclk_for_compression (mode , dsc );
584+
570585 /*
571586 * For bonded DSI mode, the current DRM mode has the complete width of the
572587 * panel. Since, the complete panel is driven by two DSI controllers,
@@ -585,7 +600,7 @@ unsigned long dsi_byte_clk_get_rate(struct mipi_dsi_host *host, bool is_bonded_d
585600 struct msm_dsi_host * msm_host = to_msm_dsi_host (host );
586601 u8 lanes = msm_host -> lanes ;
587602 u32 bpp = dsi_get_bpp (msm_host -> format );
588- unsigned long pclk_rate = dsi_get_pclk_rate (mode , is_bonded_dsi );
603+ unsigned long pclk_rate = dsi_get_pclk_rate (mode , msm_host -> dsc , is_bonded_dsi );
589604 unsigned long pclk_bpp ;
590605
591606 if (lanes == 0 ) {
@@ -604,7 +619,7 @@ unsigned long dsi_byte_clk_get_rate(struct mipi_dsi_host *host, bool is_bonded_d
604619
605620static void dsi_calc_pclk (struct msm_dsi_host * msm_host , bool is_bonded_dsi )
606621{
607- msm_host -> pixel_clk_rate = dsi_get_pclk_rate (msm_host -> mode , is_bonded_dsi );
622+ msm_host -> pixel_clk_rate = dsi_get_pclk_rate (msm_host -> mode , msm_host -> dsc , is_bonded_dsi );
608623 msm_host -> byte_clk_rate = dsi_byte_clk_get_rate (& msm_host -> base , is_bonded_dsi ,
609624 msm_host -> mode );
610625
0 commit comments