lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250527-dsi-vsync-flush-v1-0-9b4ea4578729@pengutronix.de>
Date: Tue, 27 May 2025 16:14:30 +0200
From: Philipp Zabel <p.zabel@...gutronix.de>
To: Inki Dae <inki.dae@...sung.com>, 
 Jagan Teki <jagan@...rulasolutions.com>, 
 Marek Szyprowski <m.szyprowski@...sung.com>, 
 Andrzej Hajda <andrzej.hajda@...el.com>, 
 Neil Armstrong <neil.armstrong@...aro.org>, Robert Foss <rfoss@...nel.org>, 
 Laurent Pinchart <Laurent.pinchart@...asonboard.com>, 
 Jonas Karlman <jonas@...boo.se>, Jernej Skrabec <jernej.skrabec@...il.com>, 
 Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, 
 Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>, 
 David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>, 
 Artur Weber <aweber.kernel@...il.com>, 
 Jessica Zhang <quic_jesszhan@...cinc.com>
Cc: dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org, 
 kernel@...gutronix.de, Philipp Zabel <p.zabel@...gutronix.de>
Subject: [PATCH RFC 0/4] drm/bridge: samsung-dsim: Stop controlling vsync
 display FIFO flush in panels

This series enables the vsync flush feature in the samsung-dsim driver
unconditionally and removes the MIPI_DSI_MODE_VSYNC_FLUSH flag.

Background: I've recently seen shifted display issues on two different
i.MX8MM boards (mxsfb + samsung-dsim) with different DSI panels.
The symptoms were horizonally shifted display contents, with a stable
offset, in about 0.1 to 0.6 percent of modesets.
Enabling the MIPI_DSI_MODE_VSYNC_FLUSH flag in the panels' mode_flags
fixed the issue in both cases.

The samsung-dsim driver is the only DSI bridge driver that uses this
flag: If the flag is absent, the driver sets the DSIM_MFLUSH_VS bit in
the DSIM_CONFIG_REG register, which disables the vsync flush feature.
The reset value of this bit is cleared (vsync flush is default-enabled).
According to the i.MX8MM reference manual,

    "It needs that Main display FIFO should be flushed for deleting
     garbage data."

This appears to match the comment in mxsfb_reset_block() in mxsfb_kms.c:

    /*
     * It seems, you can't re-program the controller if it is still
     * running. This may lead to shifted pictures (FIFO issue?), so
     * first stop the controller and drain its FIFOs.
     */

Now I wonder why the bit is controlled by a flag in the panel drivers.
Whether the display controller pushes up to a FIFO worth of garbage data
into the DSI bridge during initialization seems to be a property of the
display controller / DSI bridge integration (whether this is due to
hardware or driver bugs), not a specific requirement of the panel.
Surely no panel needs to receive a partial line of garbage data in front
of the first frame?

Instead of adding the flag to every panel connected to affected SoCs,
the vsync flush feature could just be enabled unconditionally.
Clearing an already-empty display FIFO should have no effect, unless
I'm missing something? With that, the MIPI_DSI_MODE_VSYNC_FLUSH flag
would not be used anymore and could be removed.

regards
Philipp

Signed-off-by: Philipp Zabel <p.zabel@...gutronix.de>
---
Philipp Zabel (4):
      drm/bridge: samsung-dsim: Always flush display FIFO on vsync pulse
      drm/panel: samsung-s6d7aa0: Drop MIPI_DSI_MODE_VSYNC_FLUSH flag
      drm/panel: samsung-s6e8aa0: Drop MIPI_DSI_MODE_VSYNC_FLUSH flag
      drm/mipi-dsi: Drop MIPI_DSI_MODE_VSYNC_FLUSH flag

 drivers/gpu/drm/bridge/samsung-dsim.c         | 2 --
 drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c | 2 +-
 drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c | 2 +-
 include/drm/drm_mipi_dsi.h                    | 2 --
 4 files changed, 2 insertions(+), 6 deletions(-)
---
base-commit: 99764593528f9e0ee9509f9e4a4eb21db99d0681
change-id: 20250527-dsi-vsync-flush-8f8cc91a6f04

Best regards,
-- 
Philipp Zabel <p.zabel@...gutronix.de>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ