summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/bridge
diff options
context:
space:
mode:
authorMichael Tretter <m.tretter@pengutronix.de>2023-10-06 18:07:06 +0300
committerNeil Armstrong <neil.armstrong@linaro.org>2023-10-09 12:06:23 +0300
commit198e54282ae560958e64328fe8f72893661b9e8b (patch)
treed8454b35eadeadf634c7a89e6f36f12d01c4d141 /drivers/gpu/drm/bridge
parent846307185f0ffbbe6b34d53b97c31c0fc392cff0 (diff)
downloadlinux-198e54282ae560958e64328fe8f72893661b9e8b.tar.xz
drm/bridge: samsung-dsim: adjust porches by rounding up
Rounding the porches up instead of down fixes the samsung-dsim at some more resolutions and refresh rates: The following resolutions are working with rounded-up porches, but don't work when the porches are rounded down: 1920x1080-59.94 1920x1080-30.00 1920x1080-29.97 1920x1080-25.00 1680x1050-59.88 1280x1024-75.02 1200x960-59.99 1280x720-50.00 1024x768-75.03 1024x768-60.00 640x480-60.00 640x480-59.94 Reviewed-by: Adam Ford <aford173@gmail.com> #imx8mm-beacon Tested-by: Adam Ford <aford173@gmail.com> #imx8mm-beacon Tested-by: Frieder Schrempf <frieder.schrempf@kontron.de> # Kontron BL i.MX8MM + Waveshare 10.1inch HDMI LCD (E) Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Link: https://lore.kernel.org/r/20230818-samsung-dsim-v2-4-846603df0e0a@pengutronix.de Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20230818-samsung-dsim-v2-4-846603df0e0a@pengutronix.de
Diffstat (limited to 'drivers/gpu/drm/bridge')
-rw-r--r--drivers/gpu/drm/bridge/samsung-dsim.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c
index 60d5ab2e0989..a0310f050693 100644
--- a/drivers/gpu/drm/bridge/samsung-dsim.c
+++ b/drivers/gpu/drm/bridge/samsung-dsim.c
@@ -989,9 +989,9 @@ static void samsung_dsim_set_display_mode(struct samsung_dsim *dsi)
if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO) {
int byte_clk_khz = dsi->hs_clock / 1000 / 8;
- int hfp = (m->hsync_start - m->hdisplay) * byte_clk_khz / m->clock;
- int hbp = (m->htotal - m->hsync_end) * byte_clk_khz / m->clock;
- int hsa = (m->hsync_end - m->hsync_start) * byte_clk_khz / m->clock;
+ int hfp = DIV_ROUND_UP((m->hsync_start - m->hdisplay) * byte_clk_khz, m->clock);
+ int hbp = DIV_ROUND_UP((m->htotal - m->hsync_end) * byte_clk_khz, m->clock);
+ int hsa = DIV_ROUND_UP((m->hsync_end - m->hsync_start) * byte_clk_khz, m->clock);
/* remove packet overhead when possible */
hfp = max(hfp - 6, 0);