[PATCH v2 08/11] video: lcdif: register simplefb fixup and enable framebuffer at probe

Johannes Schneider <[email protected]>
Newsgroups org.infradead.lists.barebox
Message-ID <[email protected]>
From: Thomas Haemmerle <[email protected]>

Two changes are needed to use lcdif_drv as the primary barebox boot
framebuffer:

  - register_framebuffer() leaves the cdev disabled; the splash command
    opens fb0 via the fb API and never goes through the cdev open path
    that triggers fb_enable lazily, so it bails on
    "fb_open: No such file or directory".  fb_enable() at the end of
    register_fb so the controller is up by the time anything blits.

  - Set info->register_simplefb and call fb_register_simplefb() so
    DRM_SIMPLEDRM in Linux sees the boot framebuffer as a
    simple-framebuffer DT node and keeps the splash visible until its
    native LCDIF driver binds.

Signed-off-by: Thomas Haemmerle <[email protected]>
---
 drivers/video/lcdif_kms.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/video/lcdif_kms.c b/drivers/video/lcdif_kms.c
index 5487d1298c..e3d1985dc9 100644
--- a/drivers/video/lcdif_kms.c
+++ b/drivers/video/lcdif_kms.c
@@ -459,6 +459,16 @@ static int lcdif_register_fb(struct lcdif_drm_private *lcdif)
 	if (ret)
 		return ret;
 
+	/* expose as simple-framebuffer for Linux DRM_SIMPLEDRM handoff */
+	info->register_simplefb = 1;
+	fb_register_simplefb(info);
+
+	/* enable now so the splash command can blit into a live fb */
+	ret = fb_enable(info);
+	if (ret)
+		dev_warn(lcdif->dev, "failed to enable framebuffer: %pe\n",
+			 ERR_PTR(ret));
+
 	dev_info(lcdif->dev, "Registered %s on LCDIF%d, type primary\n",
 		 info->cdev.name, lcdif->id);
 
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.