From: Johann Klammer <klammerj@a1.net>
To: FlorianSchandinat@gmx.de, linux-kernel@vger.kernel.org,
linux-fbdev@vger.kernel.org
Subject: [PATCH 06/08] viafb: fix and expand list of display modes
Date: Sat, 5 Dec 2026 23:24:42 +0100 [thread overview]
Message-ID: <ad6f0df9-2f29-45ca-a6ce-106f6d580d10@a1.net> (raw)
this adds several lo-resolution modes.
the lo-re modes only work on IGA1. IGA2 lacks the necessary. clock
divider and doublescan. also fixes some modes that failed to modeset
because dimensions weren't multiples of eight (1366x768), one that was
mismatched between fb.modes and the table(1440x1050) and thus failed to
set. 1024x600 had excessive line jitter. GPT6 changed the margins to.
center it on the display and modified the clock. The chatbot's suspicion
was that the pll running with rdiv==0 {99, 99, 29, 0} (48.88 MHz) has a
bad duty cycle or oscillates, or that the hblank calculation was off by
one. What originally fixed it was flipping the hsync bit via
''
python3 -c 'f=open("/dev/port","wb",buffering=0); f.seek(0x3c2); f.write(b"\x0f")'
''
chatbot says that's not valid by the VESA standard, so dropped.
Anyway, there was a bug. now it's gone. The fudged timing seems to have
fixed it. After I got X working, I get snow at 1920x1080 60 Hz@32bpp on
ME6000. Likely a bandwidth problem as the clock is over 133MHz. Reducing
the frequency helped, so there's a 1920x1080 50Hz mode in there now. I had
tried a reduced blanking too, but those. seem not to work ok on a vga
output. Reducing bpp helps, too.
Co-developed-by: [GPT-6]
Signed-off-by: Johann Klammer <klammerj@a1.net>
---
diff '--color=auto' -uprN -x '*.o' -x '*.ko' -x '*.mod*' -x '*.a' -x '*.cmd' -x modules.order -x Module.symvers -x .tmp_versions linux-7.3.0-gentoo.orig/drivers/video/fbdev/via/viamode.c linux-7.3.0-gentoo.work/drivers/video/fbdev/via/viamode.c
--- linux-7.3.0-gentoo.orig/drivers/video/fbdev/via/viamode.c 2026-11-04 08:38:55.000000000 +0100
+++ linux-7.3.0-gentoo.work/drivers/video/fbdev/via/viamode.c 2026-12-05 21:33:03.392382585 +0100
@@ -255,6 +255,33 @@ struct VPITTable VPIT = {
/********************/
static const struct fb_videomode viafb_modes[] = {
+ /* 320x200 @ 70 Hz, 31.5 kHz hsync, 8:5 aspect ratio */
+ { NULL, 70, 320, 200, 79440, 24, 8, 20, 4, 48, 1, 0,FB_VMODE_DOUBLE,0 },
+ /* 320x240 @ 60 Hz, 31.5 kHz hsync, 4:3 aspect ratio */
+ { NULL, 60, 320, 240, 79440, 24, 8, 16, 5, 48, 1, 0, FB_VMODE_DOUBLE,0 },
+ /* 320x240 @ 72 Hz, 36.5 kHz hsync */
+ { NULL, 72, 320, 240, 63492, 24, 8, 16, 4, 48, 2, 0, FB_VMODE_DOUBLE,0 },
+ /* 400x300 @ 56 Hz, 35.2 kHz hsync, 4:3 aspect ratio */
+ { NULL, 56, 400, 300, 55555, 64, 16, 10, 1, 32, 1, 0,FB_VMODE_DOUBLE,0 },
+ /* 400x300 @ 60 Hz, 37.8 kHz hsync */
+ { NULL, 60, 400, 300, 50000, 48, 16, 11, 1, 64, 2, 0, FB_VMODE_DOUBLE,0 },
+ /* 400x300 @ 72 Hz, 48.0 kHz hsync */
+ { NULL, 72, 400, 300, 40000, 32, 24, 11, 19, 64, 3, 0, FB_VMODE_DOUBLE,0 },
+ /* 480x300 @ 56 Hz, 35.2 kHz hsync, 8:5 aspect ratio */
+ {NULL, 56, 480, 300, 46176, 80, 16, 10, 1, 40, 1, 0, FB_VMODE_DOUBLE,0 },
+ /* 480x300 @ 60 Hz, 37.8 kHz hsync */
+ {NULL, 60, 480, 300, 41858, 56, 16, 11, 1, 80, 2, 0, FB_VMODE_DOUBLE,0 },
+ /* 480x300 @ 63 Hz, 39.6 kHz hsync */
+ {NULL, 63, 480, 300, 40000, 56, 16, 11, 1, 80, 2, 0,FB_VMODE_DOUBLE,0 },
+ /* 480x300 @ 72 Hz, 48.0 kHz hsync */
+ {NULL, 72, 480, 300, 33386, 40, 24, 11, 19, 80, 3, 0,FB_VMODE_DOUBLE, 0 },
+ /* 512x384 @ 60 Hz, 48.4 kHz hsync, 4:3 aspect ratio */
+ { NULL, 60, 512, 384, 30769, 80, 16, 15, 1, 64, 3, 0, FB_VMODE_DOUBLE, 0 },
+ /* 512x384 @ 78 Hz, 31.50 kHz hsync */
+ { NULL, 78, 512, 384, 49603, 48, 16, 16, 1, 64, 3, 0, FB_VMODE_NONINTERLACED,0 },
+ /* 512x384 @ 85 Hz, 34.38 kHz hsync */
+ { NULL, 85, 512, 384, 45454, 48, 16, 16, 1, 64, 3, 0,FB_VMODE_NONINTERLACED,0 },
+ {NULL, 60, 640, 240, 39682, 48, 16, 16, 5, 96, 1, 0, FB_VMODE_DOUBLE, 0},
{NULL, 60, 480, 640, 40285, 72, 24, 19, 1, 48, 3, FB_SYNC_VERT_HIGH_ACT, 0, 0},
{NULL, 60, 640, 480, 39682, 48, 16, 33, 10, 96, 2, 0, 0, 0},
{NULL, 75, 640, 480, 31746, 120, 16, 16, 1, 64, 3, 0, 0, 0},
@@ -272,7 +299,7 @@ static const struct fb_videomode viafb_m
{NULL, 60, 848, 480, 31565, 104, 24, 12, 3, 80, 5, FB_SYNC_VERT_HIGH_ACT, 0, 0},
{NULL, 60, 856, 480, 31517, 104, 16, 13, 1, 88, 3, FB_SYNC_VERT_HIGH_ACT, 0, 0},
{NULL, 60, 1024, 512, 24218, 136, 32, 15, 1, 104, 3, FB_SYNC_VERT_HIGH_ACT, 0, 0},
- {NULL, 60, 1024, 600, 20423, 144, 40, 18, 1, 104, 3, FB_SYNC_VERT_HIGH_ACT, 0, 0},
+ {NULL, 60, 1024, 600, 20202, 112, 88, 10, 1, 120, 3, FB_SYNC_VERT_HIGH_ACT, 0, 0},
{NULL, 60, 1024, 768, 15385, 160, 24, 29, 3, 136, 6, 0, 0, 0},
{NULL, 75, 1024, 768, 12703, 176, 16, 28, 1, 96, 3, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 0, 0},
{NULL, 85, 1024, 768, 10581, 208, 48, 36, 1, 96, 3, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 0, 0},
@@ -294,12 +321,11 @@ static const struct fb_videomode viafb_m
{NULL, 75, 1280, 1024, 7409, 248, 16, 38, 1, 144, 3, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 0, 0},
{NULL, 85, 1280, 1024, 6351, 224, 64, 44, 1, 160, 3, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 0, 0},
{NULL, 60, 1360, 768, 11759, 208, 72, 22, 3, 136, 5, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 0, 0},
- {NULL, 60, 1368, 768, 11646, 216, 72, 23, 1, 144, 3, FB_SYNC_VERT_HIGH_ACT, 0, 0},
{NULL, 50, 1368, 768, 14301, 200, 56, 19, 1, 144, 3, FB_SYNC_VERT_HIGH_ACT, 0, 0},
{NULL, 60, 1368, 768, 11646, 216, 72, 23, 1, 144, 3, FB_SYNC_VERT_HIGH_ACT, 0, 0},
{NULL, 60, 1440, 900, 9372, 232, 80, 25, 3, 152, 6, FB_SYNC_VERT_HIGH_ACT, 0, 0},
{NULL, 75, 1440, 900, 7311, 248, 96, 33, 3, 152, 6, FB_SYNC_VERT_HIGH_ACT, 0, 0},
- {NULL, 60, 1440, 1040, 7993, 248, 96, 33, 1, 152, 3, FB_SYNC_VERT_HIGH_ACT, 0, 0},
+ {NULL, 60, 1440, 1050, 7993, 248, 96, 33, 1, 152, 3, FB_SYNC_VERT_HIGH_ACT, 0, 0},
{NULL, 60, 1600, 900, 8449, 256, 88, 26, 3, 168, 5, FB_SYNC_VERT_HIGH_ACT, 0, 0},
{NULL, 60, 1600, 1024, 7333, 272, 104, 32, 1, 168, 3, FB_SYNC_VERT_HIGH_ACT, 0, 0},
{NULL, 60, 1600, 1200, 6172, 304, 64, 46, 1, 192, 3, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 0, 0},
@@ -314,6 +340,7 @@ static const struct fb_videomode viafb_m
{NULL, 60, 1280, 720, 13484, 216, 112, 20, 5, 40, 5, FB_SYNC_VERT_HIGH_ACT, 0, 0},
{NULL, 50, 1280, 720, 16538, 176, 48, 17, 1, 128, 3, FB_SYNC_VERT_HIGH_ACT, 0, 0},
{NULL, 60, 1920, 1080, 5776, 328, 128, 32, 3, 200, 5, FB_SYNC_VERT_HIGH_ACT, 0, 0},
+ {NULL, 50, 1920, 1080, 7067, 312, 112, 26, 3, 200, 5, FB_SYNC_VERT_HIGH_ACT, 0, 0},
{NULL, 60, 1920, 1200, 5164, 336, 136, 36, 3, 200, 6, FB_SYNC_VERT_HIGH_ACT, 0, 0},
{NULL, 60, 1400, 1050, 8210, 232, 88, 32, 3, 144, 4, FB_SYNC_VERT_HIGH_ACT, 0, 0},
{NULL, 75, 1400, 1050, 6398, 248, 104, 42, 3, 144, 4, FB_SYNC_VERT_HIGH_ACT, 0, 0} };
reply other threads:[~2026-12-05 22:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=ad6f0df9-2f29-45ca-a6ce-106f6d580d10@a1.net \
--to=klammerj@a1.net \
--cc=FlorianSchandinat@gmx.de \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®