From 01c76f1a64ba8cb3da9b26be481e289ee16960f0 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Thu, 3 Aug 2023 17:32:41 +0800 Subject: video: vidconsole: Fix null dereference of ops->measure At present vidconsole_measure() tests ops->select_font before calling ops->measure, which would result in a null dereference when the console driver provides no ops for measure. Fixes: b828ed7d7929 ("console: Allow measuring the bounding box of text") Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- drivers/video/vidconsole-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 05f9304780..b5b3b66259 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -603,7 +603,7 @@ int vidconsole_measure(struct udevice *dev, const char *name, uint size, struct vidconsole_ops *ops = vidconsole_get_ops(dev); int ret; - if (ops->select_font) { + if (ops->measure) { ret = ops->measure(dev, name, size, text, bbox); if (ret != -ENOSYS) return ret; -- cgit v1.2.3 From aba6776a71d3ccbbaf9452271c440364a5640ce3 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Thu, 3 Aug 2023 18:40:08 +0800 Subject: video: kconfig: Fix a typo in SPL_VIDEO_REMOVE Add one space between 'before' and 'loading'. Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- drivers/video/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 2a37d026bc..69f4809cf4 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -1115,7 +1115,7 @@ config SPL_VIDEO_REMOVE bool "Remove video driver after SPL stage" help if this option is enabled video driver will be removed at the end of - SPL stage, beforeloading the next stage. + SPL stage, before loading the next stage. if SPL_SPLASH_SCREEN -- cgit v1.2.3 From 28cd244e847c9a3becc954b5d911a7e67f34b14a Mon Sep 17 00:00:00 2001 From: Jason Wessel Date: Wed, 26 Jul 2023 10:42:34 +0800 Subject: bcm2835: Add simiple-framebuffer for use with fkms When the fkms dtb overlay is used only the simple-framebuffer is presented as a usable video display. So, add "simple-framebuffer" compatible to enable video driver bcm2835. Signed-off-by: Jason Wessel Signed-off-by: Meng Li --- drivers/video/bcm2835.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/video/bcm2835.c b/drivers/video/bcm2835.c index c2962932c9..14942526f1 100644 --- a/drivers/video/bcm2835.c +++ b/drivers/video/bcm2835.c @@ -54,6 +54,9 @@ static const struct udevice_id bcm2835_video_ids[] = { { .compatible = "brcm,bcm2835-hdmi" }, { .compatible = "brcm,bcm2711-hdmi0" }, { .compatible = "brcm,bcm2708-fb" }, +#if !IS_ENABLED(CONFIG_VIDEO_DT_SIMPLEFB) + { .compatible = "simple-framebuffer" }, +#endif { } }; -- cgit v1.2.3 From 04cc66c047d959dc1b22a625b7949a26793ac52b Mon Sep 17 00:00:00 2001 From: Meng Li Date: Wed, 26 Jul 2023 10:42:35 +0800 Subject: rpi: set the correct parameter for simple framebuffer node When raspberrpi-4b platform boots up, there are 2 sets of same bootup log displayed on HDMI monitor screen, it looks like the screen is split into 2 parts. The root cause is that video format of u-boot is different from kernel. The fixing "a8r8g8b8" video format is used in u-boot, but "r5g6b5" video format from framebuffer node is used in kernel image. In order to avoid weird display status on screen, it needs to set the correct parameter for simple framebuffer node even if it has existed. Signed-off-by: Meng Li --- board/raspberrypi/rpi/rpi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index 1057ebb994..38bcab15cf 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -561,6 +561,8 @@ int ft_board_setup(void *blob, struct bd_info *bd) node = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer"); if (node < 0) fdt_simplefb_add_node(blob); + else + fdt_simplefb_enable_and_mem_rsv(blob); #ifdef CONFIG_EFI_LOADER /* Reserve the spin table */ -- cgit v1.2.3