Yu-Ping Wu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38827 )
Change subject: dsi: Fix data rate ......................................................................
dsi: Fix data rate
Change-Id: I23220d446833b956431006027bbc8cb20fc696a5 --- M src/soc/mediatek/common/dsi.c 1 file changed, 5 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/27/38827/1
diff --git a/src/soc/mediatek/common/dsi.c b/src/soc/mediatek/common/dsi.c index 238b1eb..618a2d4 100644 --- a/src/soc/mediatek/common/dsi.c +++ b/src/soc/mediatek/common/dsi.c @@ -48,9 +48,11 @@ * for older platforms which do not have complete implementation in HFP. * Newer platforms should just set that to 1.0 (100 / 100). */ - int data_rate = (u64)edid->mode.pixel_clock * bits_per_pixel * - MTK_DSI_MIPI_RATIO_NUMERATOR / - (1000 * lanes * MTK_DSI_MIPI_RATIO_DENOMINATOR); + int data_rate = DIV_ROUND_UP((u64)edid->mode.pixel_clock * + bits_per_pixel * + MTK_DSI_MIPI_RATIO_NUMERATOR, + 1000ULL * lanes * + MTK_DSI_MIPI_RATIO_DENOMINATOR); printk(BIOS_INFO, "DSI data_rate: %d Mbps\n", data_rate);
if (data_rate < MTK_DSI_DATA_RATE_MIN_MHZ) {