]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 17 Oct 2022 09:56:12 +0000 (11:56 +0200)
commita5927aa505cd7756db31887058b0b08e2b350b50
treec8123141a3369c7ca603e844ab2dd1b7f43a0fa7
parent17de70194406d20cfef593e5ad9e3910e9f0a2af
drm/vc4: dsi: Correct DSI divider calculations

BugLink: https://bugs.launchpad.net/bugs/1990162
[ Upstream commit 3b45eee87da171caa28f61240ddb5c21170cda53 ]

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: 86c1b9eff3f2 ("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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/gpu/drm/vc4/vc4_dsi.c