From ac56c61332e6386881f750441e366d029b8dda4f Mon Sep 17 00:00:00 2001 From: Igor Belwon Date: Tue, 4 Nov 2025 15:50:36 +0100 Subject: [PATCH] video: simplefb: Add stride handling 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 --- 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 239b006744d..8d0772d4e51 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);