* [PATCH master] video: ssd1307fb: set default mode
@ 2025-03-20 20:30 Ahmad Fatoum
2025-03-24 8:29 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2025-03-20 20:30 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
The framebuffer support will refuse modification of the fbX.enable
parameter if there are no modes. The ssd1307fb is the only driver
that has no provisions for populating modes and thus always runs
into this case.
The display is normally used as a small framebuffer console and the
frame buffer console support will call fb_enable sidestepping the check
in the device parameter, which caused the issue to fly under the radar
so far. If used without framebuffer console, however, the problem
becomes quickly apparent.
Reported-by: @jakthree:matrix.org
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/video/ssd1307fb.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/video/ssd1307fb.c b/drivers/video/ssd1307fb.c
index fb50e895c59a..5880f2b4a57a 100644
--- a/drivers/video/ssd1307fb.c
+++ b/drivers/video/ssd1307fb.c
@@ -77,6 +77,7 @@ struct ssd1307fb_par {
struct spi_device *spi;
u32 height;
struct fb_info *info;
+ struct fb_videomode mode;
u32 page_offset;
u32 prechargep1;
u32 prechargep2;
@@ -594,6 +595,11 @@ static int ssd1307fb_probe(struct device *dev)
if (ret)
goto reset_oled_error;
+ par->mode.xres = par->width;
+ par->mode.yres = par->height;
+ par->mode.name = "default";
+
+ info->mode = &par->mode;
info->dev.parent = dev;
ret = register_framebuffer(info);
if (ret) {
--
2.39.5
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH master] video: ssd1307fb: set default mode
2025-03-20 20:30 [PATCH master] video: ssd1307fb: set default mode Ahmad Fatoum
@ 2025-03-24 8:29 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2025-03-24 8:29 UTC (permalink / raw)
To: barebox, Ahmad Fatoum
On Thu, 20 Mar 2025 21:30:57 +0100, Ahmad Fatoum wrote:
> The framebuffer support will refuse modification of the fbX.enable
> parameter if there are no modes. The ssd1307fb is the only driver
> that has no provisions for populating modes and thus always runs
> into this case.
>
> The display is normally used as a small framebuffer console and the
> frame buffer console support will call fb_enable sidestepping the check
> in the device parameter, which caused the issue to fly under the radar
> so far. If used without framebuffer console, however, the problem
> becomes quickly apparent.
>
> [...]
Applied, thanks!
[1/1] video: ssd1307fb: set default mode
https://git.pengutronix.de/cgit/barebox/commit/?id=1f39c0443fb2 (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-03-24 8:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-20 20:30 [PATCH master] video: ssd1307fb: set default mode Ahmad Fatoum
2025-03-24 8:29 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox