* [PATCH] fbdev: macmodes: compare the pixel clock of each candidate mode
@ 2026-11-18 1:25 Tim Douglas
0 siblings, 0 replies; only message in thread
From: Tim Douglas @ 2026-11-18 1:25 UTC (permalink / raw)
To: deller; +Cc: linux-fbdev, dri-devel, linux-kernel
In the second pass through the mode table in mac_var_to_vmode(),
the requested pixel clock period was compared with the first mode's
period at every step. The last mode at that resolution was therefore
returned even when its period was too short. Compare against the
current candidate's period.
Tested on a Performa 6200CD using a kernel with local platform
support. With video=valkyriefb:vmode:10 (800x600 at 60 Hz), the
measured refresh rate was about 72 Hz before the fix and 60 Hz
afterward. At 640x480, 67 Hz was also selected for a 60 Hz request
before the fix.
AI assistance was used to investigate the mode-table walk and draft
the fix.
Signed-off-by: Tim Douglas <me@timdoug.com>
---
drivers/video/fbdev/macmodes.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/macmodes.c b/drivers/video/fbdev/macmodes.c
index b16a9d9be..7ea40fd34 100644
--- a/drivers/video/fbdev/macmodes.c
+++ b/drivers/video/fbdev/macmodes.c
@@ -342,7 +342,7 @@ int mac_var_to_vmode(const struct fb_var_screeninfo *var, int *vmode,
if (mode->xres != clk_mode->xres || mode->yres != clk_mode->yres)
break;
- if (var->pixclock > mode->pixclock)
+ if (var->pixclock > clk_mode->pixclock)
break;
if (mode->vmode != clk_mode->vmode)
continue;
base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
--
2.39.5
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-18 1:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18 1:25 [PATCH] fbdev: macmodes: compare the pixel clock of each candidate mode Tim Douglas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox