From: Ahmad Fatoum <a.fatoum@barebox.org>
To: barebox@lists.infradead.org
Cc: "Claude Opus 4.6" <noreply@anthropic.com>,
Ahmad Fatoum <a.fatoum@barebox.org>
Subject: [PATCH master 1/2] video: mode-helpers: preserve sync polarity in fb_videomode conversion
Date: Fri, 13 Feb 2026 10:28:08 +0100 [thread overview]
Message-ID: <20260213092906.3960051-1-a.fatoum@barebox.org> (raw)
The FB_SYNC_*_HIGH_ACT flags indicate that the respective sync signal is
active high when set and active low when unset.
The DISPLAY_FLAGS_*SYNC_* flags on the other hands have separate
non-zero _HIGH and _LOW flags, which fb_videomode_to_videomode() failed
to account for.
This causes a DPI sync polarity mismatch for MIPI-DSI panels with
negative sync polarity, which was hackily worked around by enabling the
video pattern generator intermittently.
Fix by explicitly setting the LOW polarity flags, which restores
DRM_MODE_FLAG_NHSYNC/NVSYNC after the fb_videomode round-trip.
Reported-by: Claude Opus 4.6 <noreply@anthropic.com>
Fixes: 7fc6f7b5daa0 ("video: add videomode helpers")
Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
drivers/video/mode-helpers.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/video/mode-helpers.c b/drivers/video/mode-helpers.c
index 4a1d31813e79..89abd8342bf4 100644
--- a/drivers/video/mode-helpers.c
+++ b/drivers/video/mode-helpers.c
@@ -143,8 +143,12 @@ void fb_videomode_to_videomode(const struct fb_videomode *fbmode,
if (fbmode->sync & FB_SYNC_HOR_HIGH_ACT)
vm->flags |= DISPLAY_FLAGS_HSYNC_HIGH;
+ else
+ vm->flags |= DISPLAY_FLAGS_HSYNC_LOW;
if (fbmode->sync & FB_SYNC_VERT_HIGH_ACT)
vm->flags |= DISPLAY_FLAGS_VSYNC_HIGH;
+ else
+ vm->flags |= DISPLAY_FLAGS_VSYNC_LOW;
if (fbmode->vmode & FB_VMODE_INTERLACED)
vm->flags |= DISPLAY_FLAGS_INTERLACED;
if (fbmode->vmode & FB_VMODE_DOUBLE)
--
2.47.3
next reply other threads:[~2026-02-13 9:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-13 9:28 Ahmad Fatoum [this message]
2026-02-13 9:28 ` [PATCH master 2/2] video: dw_mipi_dsi: remove VPG workaround for panel initialization Ahmad Fatoum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260213092906.3960051-1-a.fatoum@barebox.org \
--to=a.fatoum@barebox.org \
--cc=barebox@lists.infradead.org \
--cc=noreply@anthropic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox