]> git.baikalelectronics.ru Git - kernel.git/commit
drm/vc4: dsi: Correct DSI divider calculations
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Mon, 13 Jun 2022 14:47:39 +0000 (16:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:17:40 +0000 (11:17 +0200)
commit72088f22329ec22b2a8191fafe82a1f835c2449a
treea5fa6b0ddce22d1219e7884b76a8293b9c858a1a
parent4c3c05c98f93956740e39d887f9065b67adc2107
drm/vc4: dsi: Correct DSI divider calculations

[ Upstream commit c676dded153787b54a37da05b813eac9abdc09f1 ]

The divider calculations tried to find the divider just faster than the
clock requested. However if it required a divider of 7 then the for loop
aborted without handling the "error" case, and could end up with a clock
lower than requested.

The integer divider from parent PLL to DSI clock is also capable of
going up to /255, not just /7 that the driver was trying.  This allows
for slower link frequencies on the DSI bus where the resolution permits.

Correct the loop so that we always have a clock greater than requested,
and covering the whole range of dividers.

Fixes: 98772f8ef2f2 ("drm/vc4: Adjust modes in DSI to work around the integer PLL divider.")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-13-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/vc4/vc4_dsi.c