From 7600d62eafb2a0083f827a843fb277e3a561a237 Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Wed, 18 Sep 2019 16:47:33 +0200 Subject: [PATCH 1/9] splash: fix logo drawing if CONFIG_VIDEO_LOGO enabled After mxc_ipuv3 DM_VIDEO conversion board configs with enabled CONFIG_VIDEO_LOGO do not show splash screen (previosly drawing splash screen worked via cfb_console driver with CONFIG_VIDEO_LOGO enabled). Use splash_source library for loading splash images when CONFIG_SPLASH_SOURCE is selected, otherwise prepare built-in video logo for drawing. Signed-off-by: Anatolij Gustschin --- common/splash.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/common/splash.c b/common/splash.c index e15cc847b6..1a5db69a7e 100644 --- a/common/splash.c +++ b/common/splash.c @@ -52,10 +52,41 @@ static struct splash_location default_splash_locations[] = { }, }; +#if defined(CONFIG_DM_VIDEO) && defined(CONFIG_VIDEO_LOGO) + +#include + +static int splash_video_logo_load(void) +{ + char *splashimage; + u32 bmp_load_addr; + + splashimage = env_get("splashimage"); + if (!splashimage) + return -ENOENT; + + bmp_load_addr = simple_strtoul(splashimage, 0, 16); + if (!bmp_load_addr) { + printf("Error: bad 'splashimage' address\n"); + return -EFAULT; + } + + memcpy((void *)bmp_load_addr, bmp_logo_bitmap, + ARRAY_SIZE(bmp_logo_bitmap)); + + return 0; +} +#else +static inline int splash_video_logo_load(void) { return -ENOSYS; } +#endif + __weak int splash_screen_prepare(void) { - return splash_source_load(default_splash_locations, - ARRAY_SIZE(default_splash_locations)); + if (CONFIG_IS_ENABLED(SPLASH_SOURCE)) + return splash_source_load(default_splash_locations, + ARRAY_SIZE(default_splash_locations)); + + return splash_video_logo_load(); } #ifdef CONFIG_SPLASH_SCREEN_ALIGN From b2ec22b52d6c1541cabf7103a098e6c80f27637b Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Wed, 18 Sep 2019 16:55:49 +0200 Subject: [PATCH 2/9] imx: wandboard: fix splash logo drawing After mxc_ipuv3 DM_VIDEO conversion showing splash image doesn't work. Fix this. Also enable white on black console configuration as it used to be with cfb_console driver. Signed-off-by: Anatolij Gustschin --- configs/wandboard_defconfig | 2 ++ include/configs/wandboard.h | 1 + 2 files changed, 3 insertions(+) diff --git a/configs/wandboard_defconfig b/configs/wandboard_defconfig index f07ec5f651..421f80697e 100644 --- a/configs/wandboard_defconfig +++ b/configs/wandboard_defconfig @@ -37,6 +37,7 @@ CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_SATA=y CONFIG_CMD_USB=y +CONFIG_CMD_BMP=y CONFIG_CMD_CACHE=y CONFIG_CMD_EXT4_WRITE=y CONFIG_OF_CONTROL=y @@ -66,4 +67,5 @@ CONFIG_DM_THERMAL=y CONFIG_USB=y CONFIG_DM_USB=y CONFIG_DM_VIDEO=y +CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_VIDEO_IPUV3=y diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h index bdcd5e9db3..8faf5f0f78 100644 --- a/include/configs/wandboard.h +++ b/include/configs/wandboard.h @@ -61,6 +61,7 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "console=ttymxc0\0" \ "splashpos=m,m\0" \ + "splashimage=" __stringify(CONFIG_LOADADDR) "\0" \ "fdtfile=undefined\0" \ "fdt_high=0xffffffff\0" \ "initrd_high=0xffffffff\0" \ From b0413fc14b183842687bddb2d8f907bfdce9aa23 Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Wed, 18 Sep 2019 17:05:31 +0200 Subject: [PATCH 3/9] imx: mx6sabresd: fix splash logo drawing After mxc_ipuv3 DM_VIDEO conversion showing splash image doesn't work. Fix this. Also enable white on black console configuration as it used to be with cfb_console driver. Signed-off-by: Anatolij Gustschin Reported-by: Fabio Estevam Tested-by: Fabio Estevam --- configs/mx6sabresd_defconfig | 2 ++ include/configs/mx6sabre_common.h | 1 + 2 files changed, 3 insertions(+) diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig index 2c88fe67c2..a0a6f40583 100644 --- a/configs/mx6sabresd_defconfig +++ b/configs/mx6sabresd_defconfig @@ -47,6 +47,7 @@ CONFIG_CMD_USB_MASS_STORAGE=y CONFIG_CMD_DHCP=y CONFIG_CMD_MII=y CONFIG_CMD_PING=y +CONFIG_CMD_BMP=y CONFIG_CMD_CACHE=y CONFIG_CMD_EXT2=y CONFIG_CMD_EXT4=y @@ -99,4 +100,5 @@ CONFIG_CI_UDC=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y CONFIG_DM_VIDEO=y +CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_VIDEO_IPUV3=y diff --git a/include/configs/mx6sabre_common.h b/include/configs/mx6sabre_common.h index c137612b01..d704cda2a6 100644 --- a/include/configs/mx6sabre_common.h +++ b/include/configs/mx6sabre_common.h @@ -62,6 +62,7 @@ "dfu_alt_info=spl raw 0x400\0" \ "fdt_high=0xffffffff\0" \ "initrd_high=0xffffffff\0" \ + "splashimage=" __stringify(CONFIG_LOADADDR) "\0" \ "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \ "mmcpart=1\0" \ "finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \ From 666973320ecab8fc5fd592ed6eab331b7f697ed6 Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Thu, 19 Sep 2019 17:19:01 +0200 Subject: [PATCH 4/9] imx: apalis_imx6: fix splash logo drawing Define "splashimage" variable in the default environment to enable splash screen drawing. Signed-off-by: Anatolij Gustschin --- include/configs/apalis_imx6.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/configs/apalis_imx6.h b/include/configs/apalis_imx6.h index 4eceb10e8f..c3bc3943f4 100644 --- a/include/configs/apalis_imx6.h +++ b/include/configs/apalis_imx6.h @@ -213,6 +213,7 @@ "load ${interface} ${drive}:1 ${loadaddr} flash_blk.img && " \ "source ${loadaddr}\0" \ "splashpos=m,m\0" \ + "splashimage=" __stringify(CONFIG_LOADADDR) "\0" \ "vidargs=mxc_hdmi.only_cea=1 " \ "video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24 " \ "video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off " \ From e80aa8b0293c3569f4f9980040a9b70f0cb9cbff Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Wed, 18 Sep 2019 17:23:45 +0200 Subject: [PATCH 5/9] imx: icore: fix splash logo drawing Define "splashimage" variable in the default environment and enable BMP code. Also configure white on black for video console. Signed-off-by: Anatolij Gustschin --- configs/imx6dl_icore_nand_defconfig | 2 ++ configs/imx6q_icore_nand_defconfig | 2 ++ configs/imx6qdl_icore_mmc_defconfig | 2 ++ configs/imx6qdl_icore_nand_defconfig | 2 ++ include/configs/imx6-engicam.h | 1 + 5 files changed, 9 insertions(+) diff --git a/configs/imx6dl_icore_nand_defconfig b/configs/imx6dl_icore_nand_defconfig index 6eb7c7ab3a..65c540275b 100644 --- a/configs/imx6dl_icore_nand_defconfig +++ b/configs/imx6dl_icore_nand_defconfig @@ -27,6 +27,7 @@ CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_MII=y CONFIG_CMD_PING=y +CONFIG_CMD_BMP=y CONFIG_CMD_CACHE=y CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y @@ -51,4 +52,5 @@ CONFIG_PINCTRL_IMX6=y CONFIG_MXC_UART=y CONFIG_IMX_THERMAL=y CONFIG_DM_VIDEO=y +CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_VIDEO_IPUV3=y diff --git a/configs/imx6q_icore_nand_defconfig b/configs/imx6q_icore_nand_defconfig index fc990a8add..5671b9a518 100644 --- a/configs/imx6q_icore_nand_defconfig +++ b/configs/imx6q_icore_nand_defconfig @@ -28,6 +28,7 @@ CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_MII=y CONFIG_CMD_PING=y +CONFIG_CMD_BMP=y CONFIG_CMD_CACHE=y CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y @@ -52,4 +53,5 @@ CONFIG_PINCTRL_IMX6=y CONFIG_MXC_UART=y CONFIG_IMX_THERMAL=y CONFIG_DM_VIDEO=y +CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_VIDEO_IPUV3=y diff --git a/configs/imx6qdl_icore_mmc_defconfig b/configs/imx6qdl_icore_mmc_defconfig index c7544c68c8..f7e2a7e0fb 100644 --- a/configs/imx6qdl_icore_mmc_defconfig +++ b/configs/imx6qdl_icore_mmc_defconfig @@ -37,6 +37,7 @@ CONFIG_CMD_MMC=y CONFIG_CMD_MII=y CONFIG_CMD_PING=y CONFIG_CMD_BOOTCOUNT=y +CONFIG_CMD_BMP=y CONFIG_CMD_CACHE=y CONFIG_CMD_EXT2=y CONFIG_CMD_EXT4=y @@ -67,5 +68,6 @@ CONFIG_DEBUG_UART_MXC=y CONFIG_MXC_UART=y CONFIG_IMX_THERMAL=y CONFIG_DM_VIDEO=y +CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_VIDEO_IPUV3=y CONFIG_IMX_WATCHDOG=y diff --git a/configs/imx6qdl_icore_nand_defconfig b/configs/imx6qdl_icore_nand_defconfig index fc990a8add..5671b9a518 100644 --- a/configs/imx6qdl_icore_nand_defconfig +++ b/configs/imx6qdl_icore_nand_defconfig @@ -28,6 +28,7 @@ CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_MII=y CONFIG_CMD_PING=y +CONFIG_CMD_BMP=y CONFIG_CMD_CACHE=y CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y @@ -52,4 +53,5 @@ CONFIG_PINCTRL_IMX6=y CONFIG_MXC_UART=y CONFIG_IMX_THERMAL=y CONFIG_DM_VIDEO=y +CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_VIDEO_IPUV3=y diff --git a/include/configs/imx6-engicam.h b/include/configs/imx6-engicam.h index 56b3c7503e..0826195f48 100644 --- a/include/configs/imx6-engicam.h +++ b/include/configs/imx6-engicam.h @@ -37,6 +37,7 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "script=boot.scr\0" \ "splashpos=m,m\0" \ + "splashimage=" __stringify(CONFIG_LOADADDR) "\0" \ "image=uImage\0" \ "fit_image=fit.itb\0" \ "fdt_high=0xffffffff\0" \ From ea2458c54bc9a075f1c2abd6b03f5e97c6aebe33 Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Wed, 18 Sep 2019 17:31:52 +0200 Subject: [PATCH 6/9] imx: colibri_imx6: fix splash logo drawing Define "splashimage" variable in the default environment to enable splash screen drawing. Signed-off-by: Anatolij Gustschin --- include/configs/colibri_imx6.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/configs/colibri_imx6.h b/include/configs/colibri_imx6.h index aee9f2f1d0..fa4dc498f5 100644 --- a/include/configs/colibri_imx6.h +++ b/include/configs/colibri_imx6.h @@ -195,6 +195,7 @@ "load ${interface} ${drive}:1 ${loadaddr} flash_blk.img && " \ "source ${loadaddr}\0" \ "splashpos=m,m\0" \ + "splashimage=" __stringify(CONFIG_LOADADDR) "\0" \ "vidargs=video=mxcfb0:dev=lcd,640x480M@60,if=RGB666 " \ "video=mxcfb1:off fbmem=8M\0 " From 8eba7397169aba5e84474ab45cf284d936b86e0a Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Wed, 18 Sep 2019 17:40:21 +0200 Subject: [PATCH 7/9] imx: mx6sabreauto: fix splash logo drawing Enable BMP code. Also configure white on black for video console. Signed-off-by: Anatolij Gustschin --- configs/mx6sabreauto_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig index 516aac1f14..aabba4de14 100644 --- a/configs/mx6sabreauto_defconfig +++ b/configs/mx6sabreauto_defconfig @@ -44,6 +44,7 @@ CONFIG_CMD_USB=y CONFIG_CMD_DHCP=y CONFIG_CMD_MII=y CONFIG_CMD_PING=y +CONFIG_CMD_BMP=y CONFIG_CMD_CACHE=y CONFIG_CMD_EXT2=y CONFIG_CMD_EXT4=y @@ -90,4 +91,5 @@ CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y CONFIG_DM_VIDEO=y +CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_VIDEO_IPUV3=y From d2a8271c88514f30c2fe00d2584401348f39c3d4 Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Fri, 20 Sep 2019 17:23:41 +0200 Subject: [PATCH 8/9] splash: fix splash banner output Old splash code in cfb_console driver displayed U-Boot version string by default. Restore this behaviour for DM_VIDEO enabled configurations. Signed-off-by: Anatolij Gustschin Reported-by: Fabio Estevam --- common/splash.c | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/common/splash.c b/common/splash.c index 1a5db69a7e..0bcedbb0ba 100644 --- a/common/splash.c +++ b/common/splash.c @@ -112,6 +112,42 @@ void splash_get_pos(int *x, int *y) } #endif /* CONFIG_SPLASH_SCREEN_ALIGN */ +#if defined(CONFIG_DM_VIDEO) && !defined(CONFIG_HIDE_LOGO_VERSION) + +#ifdef CONFIG_VIDEO_LOGO +#include +#endif +#include +#include +#include + +void splash_display_banner(void) +{ + struct udevice *dev; + char buf[DISPLAY_OPTIONS_BANNER_LENGTH]; + int col, row, ret; + + ret = uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &dev); + if (ret) + return; + +#ifdef CONFIG_VIDEO_LOGO + col = BMP_LOGO_WIDTH / VIDEO_FONT_WIDTH + 1; + row = BMP_LOGO_HEIGHT / VIDEO_FONT_HEIGHT + 1; +#else + col = 0; + row = 0; +#endif + + display_options_get_banner(false, buf, sizeof(buf)); + vidconsole_position_cursor(dev, col, 1); + vidconsole_put_string(dev, buf); + vidconsole_position_cursor(dev, 0, row); +} +#else +static inline void splash_display_banner(void) { } +#endif /* CONFIG_DM_VIDEO && !CONFIG_HIDE_LOGO_VERSION */ + /* * Common function to show a splash image if env("splashimage") is set. * Is used for both dm_video and lcd video stacks. For additional @@ -135,6 +171,14 @@ int splash_display(void) splash_get_pos(&x, &y); - return bmp_display(addr, x, y); + ret = bmp_display(addr, x, y); + + /* Skip banner output on video console if the logo is not at 0,0 */ + if (x || y) + goto end; + + splash_display_banner(); +end: + return ret; } #endif From f34e7fc29b32066a8af6c4d22a1f6e0fbfd8e6db Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Fri, 9 Aug 2019 22:30:26 +0200 Subject: [PATCH 9/9] sunxi: video: HDMI: Fix LCD clock divider Currently we may end up with an LCD clock divider that differs from the HDMI PHY clock divider if we can't exactly match the pixel clock. Fix this by using DIV_ROUND_UP to calculate the divider. This works since the PLL is chosen such that the resulting pixel clock is never higher than the requested pixel clock. Fixes: 1feed358ed15 ("sunxi: video: HDMI: Fix clock setup") Signed-off-by: Mark Kettenis --- drivers/video/sunxi/sunxi_dw_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/sunxi/sunxi_dw_hdmi.c b/drivers/video/sunxi/sunxi_dw_hdmi.c index cec23295b5..66a319187c 100644 --- a/drivers/video/sunxi/sunxi_dw_hdmi.c +++ b/drivers/video/sunxi/sunxi_dw_hdmi.c @@ -254,7 +254,7 @@ static void sunxi_dw_hdmi_lcdc_init(int mux, const struct display_timing *edid, { struct sunxi_ccm_reg * const ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE; - int div = clock_get_pll3() / edid->pixelclock.typ; + int div = DIV_ROUND_UP(clock_get_pll3(), edid->pixelclock.typ); struct sunxi_lcdc_reg *lcdc; if (mux == 0) {