OrangePi_CM5/drivers/gpu/drm/sun4i
Samuel Holland a1e7908f78 drm/sun4i: dsi: Prevent underflow when computing packet sizes
[ Upstream commit 82a1356a933d8443139f8886f11b63c974a09a67 ]

Currently, the packet overhead is subtracted using unsigned arithmetic.
With a short sync pulse, this could underflow and wrap around to near
the maximal u16 value. Fix this by using signed subtraction. The call to
max() will correctly handle any negative numbers that are produced.

Apply the same fix to the other timings, even though those subtractions
are less likely to underflow.

Fixes: 133add5b5a ("drm/sun4i: Add Allwinner A31 MIPI-DSI controller support")
Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20220812031623.34057-1-samuel@sholland.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-08-25 11:38:11 +02:00
..
Kconfig drm/sun4i: fix unmet dependency on RESET_CONTROLLER for PHY_SUN6I_MIPI_DPHY 2021-12-08 09:03:18 +01:00
Makefile
sun4i_backend.c
sun4i_backend.h
sun4i_crtc.c
sun4i_crtc.h
sun4i_dotclock.c
sun4i_dotclock.h
sun4i_drv.c drm/sun4i: Fix crash during suspend after component bind failure 2022-06-29 08:59:47 +02:00
sun4i_drv.h
sun4i_framebuffer.c
sun4i_framebuffer.h
sun4i_frontend.c
sun4i_frontend.h
sun4i_hdmi.h
sun4i_hdmi_ddc_clk.c
sun4i_hdmi_enc.c
sun4i_hdmi_i2c.c
sun4i_hdmi_tmds_clk.c
sun4i_layer.c
sun4i_layer.h
sun4i_lvds.c
sun4i_lvds.h
sun4i_rgb.c
sun4i_rgb.h
sun4i_tcon.c drm/sun4i: tcon: fix inverted DCLK polarity 2021-03-04 11:37:41 +01:00
sun4i_tcon.h drm/sun4i: tcon: fix inverted DCLK polarity 2021-03-04 11:37:41 +01:00
sun4i_tv.c
sun6i_drc.c
sun6i_mipi_dsi.c drm/sun4i: dsi: Prevent underflow when computing packet sizes 2022-08-25 11:38:11 +02:00
sun6i_mipi_dsi.h
sun8i_csc.c
sun8i_csc.h drm/sun4i: Fix macros in sun8i_csc.h 2021-11-18 14:04:32 +01:00
sun8i_dw_hdmi.c drm/sun4i: dw-hdmi: Fix HDMI PHY clock setup 2021-10-13 10:04:28 +02:00
sun8i_dw_hdmi.h drm/sun4i: dw-hdmi: Fix HDMI PHY clock setup 2021-10-13 10:04:28 +02:00
sun8i_hdmi_phy.c drm/sun4i: dw-hdmi: Fix HDMI PHY clock setup 2021-10-13 10:04:28 +02:00
sun8i_hdmi_phy_clk.c
sun8i_mixer.c
sun8i_mixer.h drm/sun4i: mixer: Fix P010 and P210 format numbers 2022-03-16 14:15:57 +01:00
sun8i_tcon_top.c
sun8i_tcon_top.h
sun8i_ui_layer.c
sun8i_ui_layer.h
sun8i_ui_scaler.c
sun8i_ui_scaler.h
sun8i_vi_layer.c
sun8i_vi_layer.h
sun8i_vi_scaler.c
sun8i_vi_scaler.h
sunxi_engine.h