Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/msm/dsi: Document DSC related pclk_rate and hdisplay calculations

Provide actual documentation for the pclk and hdisplay calculations in
the case of DSC compression being used.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/577534/
Link: https://lore.kernel.org/r/20240208-fd_document_dsc_pclk_rate-v4-1-56fe59d0a2e0@linaro.org

+31 -2
+31 -2
drivers/gpu/drm/msm/dsi/dsi_host.c
··· 519 519 clk_disable_unprepare(msm_host->byte_clk); 520 520 } 521 521 522 + /** 523 + * dsi_adjust_pclk_for_compression() - Adjust the pclk rate for compression case 524 + * @mode: The selected mode for the DSI output 525 + * @dsc: DRM DSC configuration for this DSI output 526 + * 527 + * Adjust the pclk rate by calculating a new hdisplay proportional to 528 + * the compression ratio such that: 529 + * new_hdisplay = old_hdisplay * compressed_bpp / uncompressed_bpp 530 + * 531 + * Porches do not need to be adjusted: 532 + * - For VIDEO mode they are not compressed by DSC and are passed as is. 533 + * - For CMD mode there are no actual porches. Instead these fields 534 + * currently represent the overhead to the image data transfer. As such, they 535 + * are calculated for the final mode parameters (after the compression) and 536 + * are not to be adjusted too. 537 + * 538 + * FIXME: Reconsider this if/when CMD mode handling is rewritten to use 539 + * transfer time and data overhead as a starting point of the calculations. 540 + */ 522 541 static unsigned long dsi_adjust_pclk_for_compression(const struct drm_display_mode *mode, 523 542 const struct drm_dsc_config *dsc) 524 543 { ··· 960 941 if (ret) 961 942 return; 962 943 963 - /* Divide the display by 3 but keep back/font porch and 964 - * pulse width same 944 + /* 945 + * DPU sends 3 bytes per pclk cycle to DSI. If widebus is 946 + * enabled, bus width is extended to 6 bytes. 947 + * 948 + * Calculate the number of pclks needed to transmit one line of 949 + * the compressed data. 950 + 951 + * The back/font porch and pulse width are kept intact. For 952 + * VIDEO mode they represent timing parameters rather than 953 + * actual data transfer, see the documentation for 954 + * dsi_adjust_pclk_for_compression(). For CMD mode they are 955 + * unused anyway. 965 956 */ 966 957 h_total -= hdisplay; 967 958 if (wide_bus_enabled && !(msm_host->mode_flags & MIPI_DSI_MODE_VIDEO))