drm/mediatek: change the dsi phytiming calculate method
authorJitao Shi <jitao.shi@mediatek.com>
Thu, 19 Sep 2019 06:58:04 +0000 (14:58 +0800)
committerCK Hu <ck.hu@mediatek.com>
Mon, 7 Oct 2019 04:29:38 +0000 (12:29 +0800)
commit7a5bc4e22ecfd74dc3662342beaa909770a3b786
treee96c0d7d11dd5c134f22f2dc5558a9dcbedd6f70
parente249e3e86b33386738e1ce4a37374aaea019a7e0
drm/mediatek: change the dsi phytiming calculate method

Change the method of frame rate calc which can get more accurate
frame rate.

data rate = pixel_clock * bit_per_pixel / lanes
Adjust hfp_wc to adapt the additional phy_data

if MIPI_DSI_MODE_VIDEO_BURST
hfp_wc = hfp * bpp - data_phy_cycles * lanes - 12 - 6;
else
hfp_wc = hfp * bpp - data_phy_cycles * lanes - 12;

Note:
//(2: 1 for sync, 1 for phy idle)
data_phy_cycles = T_hs_exit + T_lpx + T_hs_prepare + T_hs_zero + 2;

bpp: bit per pixel

Signed-off-by: Jitao Shi <jitao.shi@mediatek.com>
Tested-by: Ryan Case <ryandcase@chromium.org>
Signed-off-by: CK Hu <ck.hu@mediatek.com>
drivers/gpu/drm/mediatek/mtk_dsi.c