From b34849c5ac6dfbcd1493bf07956f738bfffdbf02 Mon Sep 17 00:00:00 2001 From: Miquel Raynal Date: Tue, 10 Sep 2024 11:11:59 +0200 Subject: video: Fix VNBYTES() macro comment The VNBYTES() macro has been updated to silence possible warnings regarding authorized (but unusual) uses of this macro, but the comment was kept unchanged. A year has passed so let's fix the comment now to avoid confusions. Fixes: cc05d352fbc ("video: Add parentheses around VNBYTES() macro") Suggested-by: Tom Rini Link: https://lore.kernel.org/u-boot/20240906183432.GG3879073@bill-the-cat/ Signed-off-by: Miquel Raynal Reviewed-by: Simon Glass --- include/video.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/include/video.h b/include/video.h index c7afe22d823..4ec71ab16da 100644 --- a/include/video.h +++ b/include/video.h @@ -57,12 +57,8 @@ enum video_log2_bpp { VIDEO_BPP32, }; -/* - * Convert enum video_log2_bpp to bytes and bits. Note we omit the outer - * brackets to allow multiplication by fractional pixels. - */ +/* Convert enum video_log2_bpp to bytes and bits */ #define VNBYTES(bpix) ((1 << (bpix)) / 8) - #define VNBITS(bpix) (1 << (bpix)) enum video_format { -- cgit v1.2.3 From c525423e5cd66f88237d67071f169ed16df4d1a8 Mon Sep 17 00:00:00 2001 From: Devarsh Thakkar Date: Wed, 25 Sep 2024 20:43:52 +0530 Subject: boot/Kconfig: Add Video Kconfig as dependency for FDT_SIMPLEFB The fdt_simplefb.c APIs rely on video-uclass APIs and structures to fill/update framebuffer information, so compile it only when VIDEO Kconfig is enabled, as otherwise below warning can be seen if VIDEO Kconfig is disabled: "boot/fdt_simplefb.c:96:12: warning: fdt_simplefb_enable_existing_node defined but not used [-Wunused-function] 96 | static int fdt_simplefb_enable_existing_node(void *blob)" Reported-by: Mattijs Korpershoek Signed-off-by: Devarsh Thakkar Reviewed-by: Mattijs Korpershoek --- boot/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/boot/Kconfig b/boot/Kconfig index 1ce1da6020c..fe2919f18c4 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -1683,6 +1683,7 @@ config FDT_FIXUP_PARTITIONS config FDT_SIMPLEFB bool "FDT tools for simplefb support" + depends on VIDEO help Enable the fdt tools to manage the simple fb nodes in device tree. These functions can be used by board to indicate to the OS -- cgit v1.2.3 From 944e515e759db4f9660245bd09e2df9051dd0b27 Mon Sep 17 00:00:00 2001 From: Devarsh Thakkar Date: Wed, 25 Sep 2024 20:43:53 +0530 Subject: boot: fdt_simplefb: Remove conditional compilation checks for VIDEO Kconfig CONFIG_VIDEO conditional compilation checks are no longer needed since FDT_SIMPLEFB Kconfig now depends on VIDEO Kconfig. Signed-off-by: Devarsh Thakkar Reviewed-by: Mattijs Korpershoek --- boot/fdt_simplefb.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/boot/fdt_simplefb.c b/boot/fdt_simplefb.c index 71b833eb9bd..5822131767d 100644 --- a/boot/fdt_simplefb.c +++ b/boot/fdt_simplefb.c @@ -103,7 +103,6 @@ static int fdt_simplefb_enable_existing_node(void *blob) return fdt_simplefb_configure_node(blob, off); } -#if IS_ENABLED(CONFIG_VIDEO) int fdt_simplefb_enable_and_mem_rsv(void *blob) { int ret; @@ -118,4 +117,3 @@ int fdt_simplefb_enable_and_mem_rsv(void *blob) return fdt_add_fb_mem_rsv(blob); } -#endif -- cgit v1.2.3 From 7aa6906dda0d0936c91f14684df7c011b31b6435 Mon Sep 17 00:00:00 2001 From: Devarsh Thakkar Date: Wed, 25 Sep 2024 20:43:54 +0530 Subject: board: ti: am62x: evm: Update simple-framebuffer node in device-tree Update simple-framebuffer device-tree node by enumerating framebuffer related information in existing simple-framebuffer node in Linux device-tree file and enabling it. In case there is no simple-framebuffer stub detected in Linux kernel device-tree and video is still active, then update the device-tree to reserve the framebuffer region for the active splash screen. This helps preserve the splash screen till the display server takes over after OS is booted. Signed-off-by: Devarsh Thakkar --- board/ti/am62x/evm.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c index 1166c9b8e09..9075df01cac 100644 --- a/board/ti/am62x/evm.c +++ b/board/ti/am62x/evm.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -162,3 +163,23 @@ void spl_perform_fixups(struct spl_image_info *spl_image) #endif } #endif + +#if defined(CONFIG_OF_BOARD_SETUP) +int ft_board_setup(void *blob, struct bd_info *bd) +{ + int ret = -1; + + if (IS_ENABLED(CONFIG_FDT_SIMPLEFB)) + ret = fdt_simplefb_enable_and_mem_rsv(blob); + + /* If simplefb is not enabled and video is active, then at least reserve + * the framebuffer region to preserve the splash screen while OS is booting + */ + if (IS_ENABLED(CONFIG_VIDEO) && IS_ENABLED(CONFIG_OF_LIBFDT)) { + if (ret && video_is_active()) + return fdt_add_fb_mem_rsv(blob); + } + + return 0; +} +#endif -- cgit v1.2.3 From 722073a0653dd18d0148dd435f067be4e82f9129 Mon Sep 17 00:00:00 2001 From: Eva Kurchatova Date: Wed, 9 Oct 2024 16:48:28 +0800 Subject: video: simplefb: Fix build warn with CONFIG_FDT_64BIT=n Fix compile warning with !CONFIG_FDT_64BIT by casting the variable in the debug print. Signed-off-by: Eva Kurchatova Reported-by: Leo Yu-Chi Liang --- drivers/video/simplefb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/video/simplefb.c b/drivers/video/simplefb.c index cb518b149cb..239b006744d 100644 --- a/drivers/video/simplefb.c +++ b/drivers/video/simplefb.c @@ -27,7 +27,8 @@ static int simple_video_probe(struct udevice *dev) return -EINVAL; } - debug("%s: base=%llx, size=%llu\n", __func__, base, size); + debug("%s: base=%llx, size=%llu\n", + __func__, (unsigned long long)base, (unsigned long long)size); /* * TODO is there some way to reserve the framebuffer -- cgit v1.2.3