[PATCH] video: simplefb: Add stride handling

Igor Belwon igor.belwon at mentallysanemainliners.org
Tue Nov 4 15:50:36 CET 2025


Some framebuffers (i.e MediaTek) do not have regular stride - its line
length is more than the display width by 8 pixels (on MT6878). As such,
introduce the optional stride property, which fixes these framebuffers.

Signed-off-by: Igor Belwon <igor.belwon at mentallysanemainliners.org>
---
 drivers/video/simplefb.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/video/simplefb.c b/drivers/video/simplefb.c
index 239b006744d8deed758da95f9c41c0d59dbb48d1..8d0772d4e51ebba3d8a66cd35ae2660d3ac859c1 100644
--- a/drivers/video/simplefb.c
+++ b/drivers/video/simplefb.c
@@ -19,7 +19,7 @@ static int simple_video_probe(struct udevice *dev)
 	int ret;
 	fdt_addr_t base;
 	fdt_size_t size;
-	u32 width, height, rot;
+	u32 width, height, stride, rot;
 
 	base = dev_read_addr_size(dev, &size);
 	if (base == FDT_ADDR_T_NONE) {
@@ -52,6 +52,11 @@ static int simple_video_probe(struct udevice *dev)
 	uc_priv->xsize = width;
 	uc_priv->ysize = height;
 
+	/* Optional - in most cases, auto-calculation works */
+	ret = ofnode_read_u32(node, "stride", &stride);
+	if (!ret || stride)
+		uc_priv->line_length = stride;
+
 	format = ofnode_read_string(node, "format");
 	debug("%s: %dx%d@%s\n", __func__, uc_priv->xsize, uc_priv->ysize, format);
 

---
base-commit: c9fdb9ac4d5234953ffaaef0cfc9d4ccb03f0ce5
change-id: 20251104-sfb-stride-397926b1069d

Best regards,
-- 
Igor Belwon <igor.belwon at mentallysanemainliners.org>



More information about the U-Boot mailing list