WSL2-Linux-Kernel/drivers/gpu/drm/sun4i
Samuel Holland 98e28de472 drm/sun4i: dsi: Prevent underflow when computing packet sizes
[ Upstream commit 82a1356a93 ]

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:40:29 +02:00
..
Kconfig drm/sun4i: fix unmet dependency on RESET_CONTROLLER for PHY_SUN6I_MIPI_DPHY 2021-12-08 09:04:37 +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 09:03:22 +02:00
sun4i_drv.h
sun4i_framebuffer.c
sun4i_framebuffer.h
sun4i_frontend.c drm/sun4i: Remove obsolete references to PHYS_OFFSET 2022-05-09 09:14:37 +02:00
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 drm/<driver>: drm_gem_plane_helper_prepare_fb is now the default 2021-06-24 15:35:24 +02:00
sun4i_layer.h
sun4i_lvds.c drm/bridge: Centralize error message when bridge attach fails 2021-07-28 16:33:12 +03:00
sun4i_lvds.h
sun4i_rgb.c drm/bridge: Centralize error message when bridge attach fails 2021-07-28 16:33:12 +03:00
sun4i_rgb.h
sun4i_tcon.c
sun4i_tcon.h
sun4i_tv.c
sun6i_drc.c
sun6i_mipi_dsi.c drm/sun4i: dsi: Prevent underflow when computing packet sizes 2022-08-25 11:40:29 +02:00
sun6i_mipi_dsi.h
sun8i_csc.c
sun8i_csc.h drm/sun4i: Fix macros in sun8i_csc.h 2021-11-18 19:17:20 +01:00
sun8i_dw_hdmi.c drm/sun4i: dw-hdmi: Fix HDMI PHY clock setup 2021-10-06 11:05:44 +02:00
sun8i_dw_hdmi.h drm/sun4i: dw-hdmi: Fix HDMI PHY clock setup 2021-10-06 11:05:44 +02:00
sun8i_hdmi_phy.c drm/sun4i: dw-hdmi: Fix missing put_device() call in sun8i_hdmi_phy_get 2022-03-08 19:12:37 +01: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:23:37 +01:00
sun8i_tcon_top.c
sun8i_tcon_top.h
sun8i_ui_layer.c drm/<driver>: drm_gem_plane_helper_prepare_fb is now the default 2021-06-24 15:35:24 +02:00
sun8i_ui_layer.h
sun8i_ui_scaler.c
sun8i_ui_scaler.h
sun8i_vi_layer.c drm/<driver>: drm_gem_plane_helper_prepare_fb is now the default 2021-06-24 15:35:24 +02:00
sun8i_vi_layer.h
sun8i_vi_scaler.c
sun8i_vi_scaler.h
sunxi_engine.h