drm/bridge: samsung-dsim: Fix porch calcalcuation rounding
authorAdam Ford <aford173@gmail.com>
Sat, 1 Jun 2024 14:41:02 +0000 (09:41 -0500)
committerRobert Foss <rfoss@kernel.org>
Mon, 10 Jun 2024 14:30:56 +0000 (16:30 +0200)
commit9a8ac1ec9efddce525c94822028fb6140c523be0
tree8bb9a6dbd1ea05662d95f8eef6998956fb2ccbf9
parent78c4c0011bb577a29906d8ca135795af2293c49e
drm/bridge: samsung-dsim: Fix porch calcalcuation rounding

The VFP, HBP, and HSA are divided between the available lanes if
there is more than one lane.  For certain timings and lane
configurations, the HFP may not be evenly divisible. If the HFP
is rounded down, it ends up being too small which can cause some
monitors to not sync properly. In these instances, adjust htotal
and hsync to round the HFP up, and recalculate the htotal.

This allows 720P-60 to operation on an i.MX8MP with a four-lane
configuration.

Tested-by: Frieder Schrempf <frieder.schrempf@kontron.de> # Kontron BL i.MX8MM with HDMI monitor
Signed-off-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240601144103.198299-2-aford173@gmail.com
drivers/gpu/drm/bridge/samsung-dsim.c