drm/bridge: samsung-dsim: calculate porches in Hz
authorMichael Tretter <m.tretter@pengutronix.de>
Fri, 6 Oct 2023 15:07:07 +0000 (17:07 +0200)
committerNeil Armstrong <neil.armstrong@linaro.org>
Mon, 9 Oct 2023 09:06:23 +0000 (11:06 +0200)
commit6acb691824933535219dfd94d9d97c922f5593d2
tree18a1b8f8235a1bda1e1f25d184334c5dd0fcee9f
parent198e54282ae560958e64328fe8f72893661b9e8b
drm/bridge: samsung-dsim: calculate porches in Hz

Calculating the byte_clk in kHz is imprecise for a hs_clock of 55687500
Hz, which may be used with a pixel clock of 74.25 MHz with mode
1920x1080-30.

Fix the calculation by using HZ instead of kHZ.

This requires to change the type to u64 to prevent overflows of the
integer type.

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-5-846603df0e0a@pengutronix.de
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230818-samsung-dsim-v2-5-846603df0e0a@pengutronix.de
drivers/gpu/drm/bridge/samsung-dsim.c