From 51973ccc412b23bf51533858003e3c7e0dd07ae9 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 3 Feb 2020 07:35:48 -0700 Subject: video: Support truetype fonts on a 32-bit display At present only a 16bpp display is supported for Truetype fonts. Add support for 32bpp also since this is quite common. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- drivers/video/console_truetype.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'drivers/video') diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c index 3008660..0a725c5 100644 --- a/drivers/video/console_truetype.c +++ b/drivers/video/console_truetype.c @@ -287,6 +287,27 @@ static int console_truetype_putc_xy(struct udevice *dev, uint x, uint y, break; } #endif +#ifdef CONFIG_VIDEO_BPP32 + case VIDEO_BPP32: { + u32 *dst = (u32 *)line + xoff; + int i; + + for (i = 0; i < width; i++) { + int val = *bits; + int out; + + if (vid_priv->colour_bg) + val = 255 - val; + out = val | val << 8 | val << 16; + if (vid_priv->colour_fg) + *dst++ |= out; + else + *dst++ &= out; + bits++; + } + break; + } +#endif default: free(data); return -ENOSYS; -- cgit v1.1 From 3b85ce8ec32910b7576e816243cde7c6740fd68a Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 3 Feb 2020 07:35:49 -0700 Subject: video: sandbox: Enable all colour depths For sandbox we want to have the maximum possible build coverage, so enable all colour depths for video. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- drivers/video/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/video') diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 50ab365..d7e62be 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -38,6 +38,7 @@ config BACKLIGHT_GPIO config VIDEO_BPP8 bool "Support 8-bit-per-pixel displays" depends on DM_VIDEO + default y if SANDBOX || X86 help Support drawing text and bitmaps onto a 8-bit-per-pixel display. Enabling this will include code to support this display. Without @@ -47,6 +48,7 @@ config VIDEO_BPP8 config VIDEO_BPP16 bool "Support 16-bit-per-pixel displays" depends on DM_VIDEO + default y if SANDBOX || X86 help Support drawing text and bitmaps onto a 16-bit-per-pixel display. Enabling this will include code to support this display. Without @@ -56,7 +58,7 @@ config VIDEO_BPP16 config VIDEO_BPP32 bool "Support 32-bit-per-pixel displays" depends on DM_VIDEO - default y if X86 + default y if SANDBOX || X86 help Support drawing text and bitmaps onto a 32-bit-per-pixel display. Enabling this will include code to support this display. Without -- cgit v1.1 From 6be88c72828923f2df8c441ee12f5829e0d06f32 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 3 Feb 2020 07:36:13 -0700 Subject: sandbox: sdl: Add an option to double the screen size On high-DPI displays U-Boot's LCD window can look very small. Add a -K flag to expand it to make things easier to read, while still using the existing resolution internally. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- drivers/video/sandbox_sdl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/video') diff --git a/drivers/video/sandbox_sdl.c b/drivers/video/sandbox_sdl.c index 913651c..d1272d0 100644 --- a/drivers/video/sandbox_sdl.c +++ b/drivers/video/sandbox_sdl.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -23,9 +24,11 @@ static int sandbox_sdl_probe(struct udevice *dev) { struct sandbox_sdl_plat *plat = dev_get_platdata(dev); struct video_priv *uc_priv = dev_get_uclass_priv(dev); + struct sandbox_state *state = state_get_current(); int ret; - ret = sandbox_sdl_init_display(plat->xres, plat->yres, plat->bpix); + ret = sandbox_sdl_init_display(plat->xres, plat->yres, plat->bpix, + state->double_lcd); if (ret) { puts("LCD init failed\n"); return ret; -- cgit v1.1 From a466db5adb58e486fbd8ae63536b03a70d69f68d Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 3 Feb 2020 07:36:14 -0700 Subject: sandbox: Support changing the LCD colour depth Add a new device-tree property to control the colour depth. At present we support 16bpp and 32bpp. While we are here, update the code to use livetree. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- drivers/video/sandbox_sdl.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/sandbox_sdl.c b/drivers/video/sandbox_sdl.c index d1272d0..1196e6c 100644 --- a/drivers/video/sandbox_sdl.c +++ b/drivers/video/sandbox_sdl.c @@ -47,13 +47,11 @@ static int sandbox_sdl_bind(struct udevice *dev) { struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev); struct sandbox_sdl_plat *plat = dev_get_platdata(dev); - const void *blob = gd->fdt_blob; - int node = dev_of_offset(dev); int ret = 0; - plat->xres = fdtdec_get_int(blob, node, "xres", LCD_MAX_WIDTH); - plat->yres = fdtdec_get_int(blob, node, "yres", LCD_MAX_HEIGHT); - plat->bpix = VIDEO_BPP16; + plat->xres = dev_read_u32_default(dev, "xres", LCD_MAX_WIDTH); + plat->yres = dev_read_u32_default(dev, "yres", LCD_MAX_HEIGHT); + plat->bpix = dev_read_u32_default(dev, "log2-depth", VIDEO_BPP16); uc_plat->size = plat->xres * plat->yres * (1 << plat->bpix) / 8; debug("%s: Frame buffer size %x\n", __func__, uc_plat->size); -- cgit v1.1 From 61b29b82683863a970fd4609a7c58512872616bc Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 3 Feb 2020 07:36:15 -0700 Subject: dm: core: Require users of devres to include the header At present devres.h is included in all files that include dm.h but few make use of it. Also this pulls in linux/compat which adds several more headers. Drop the automatic inclusion and require files to include devres themselves. This provides a good indication of which files use devres. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- drivers/video/exynos/exynos_mipi_dsi.c | 1 + drivers/video/mipi_dsi.c | 1 + drivers/video/rockchip/rk3288_mipi.c | 1 + drivers/video/rockchip/rk3399_mipi.c | 1 + drivers/video/rockchip/rk_vop.c | 1 + drivers/video/tegra124/sor.c | 1 + 6 files changed, 6 insertions(+) (limited to 'drivers/video') diff --git a/drivers/video/exynos/exynos_mipi_dsi.c b/drivers/video/exynos/exynos_mipi_dsi.c index 74a66e8..ad5ef93 100644 --- a/drivers/video/exynos/exynos_mipi_dsi.c +++ b/drivers/video/exynos/exynos_mipi_dsi.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/video/mipi_dsi.c b/drivers/video/mipi_dsi.c index cdc3ef5..ecacea1 100644 --- a/drivers/video/mipi_dsi.c +++ b/drivers/video/mipi_dsi.c @@ -38,6 +38,7 @@ #include #include #include +#include /** * DOC: dsi helpers diff --git a/drivers/video/rockchip/rk3288_mipi.c b/drivers/video/rockchip/rk3288_mipi.c index 65891ce..f4444b9 100644 --- a/drivers/video/rockchip/rk3288_mipi.c +++ b/drivers/video/rockchip/rk3288_mipi.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/video/rockchip/rk3399_mipi.c b/drivers/video/rockchip/rk3399_mipi.c index a5b7ba6..74ebe77 100644 --- a/drivers/video/rockchip/rk3399_mipi.c +++ b/drivers/video/rockchip/rk3399_mipi.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/video/rockchip/rk_vop.c b/drivers/video/rockchip/rk_vop.c index b56c3f3..e91d4df 100644 --- a/drivers/video/rockchip/rk_vop.c +++ b/drivers/video/rockchip/rk_vop.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include "rk_vop.h" diff --git a/drivers/video/tegra124/sor.c b/drivers/video/tegra124/sor.c index 172bb14..8dc3df6 100644 --- a/drivers/video/tegra124/sor.c +++ b/drivers/video/tegra124/sor.c @@ -15,6 +15,7 @@ #include #include "displayport.h" #include "sor.h" +#include #define DEBUG_SOR 0 -- cgit v1.1 From 336d4615f8fa774557d14f9b3245daa9e5fe3dbc Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 3 Feb 2020 07:36:16 -0700 Subject: dm: core: Create a new header file for 'compat' features At present dm/device.h includes the linux-compatible features. This requires including linux/compat.h which in turn includes a lot of headers. One of these is malloc.h which we thus end up including in every file in U-Boot. Apart from the inefficiency of this, it is problematic for sandbox which needs to use the system malloc() in some files. Move the compatibility features into a separate header file. Signed-off-by: Simon Glass --- drivers/video/atmel_hlcdfb.c | 1 + drivers/video/console_truetype.c | 1 + drivers/video/da8xx-fb.c | 1 + drivers/video/dw_mipi_dsi.c | 1 + drivers/video/hitachi_tx18d42vm_lcd.c | 1 + drivers/video/mali_dp.c | 2 ++ drivers/video/mvebu_lcd.c | 1 + drivers/video/mxsfb.c | 1 + drivers/video/orisetech_otm8009a.c | 1 + drivers/video/pwm_backlight.c | 1 + drivers/video/raydium-rm68200.c | 1 + drivers/video/rockchip/rk3288_hdmi.c | 1 + drivers/video/rockchip/rk_edp.c | 1 + drivers/video/sandbox_osd.c | 1 + drivers/video/scf0403_lcd.c | 1 + drivers/video/ssd2828.c | 1 + drivers/video/stm32/stm32_dsi.c | 1 + drivers/video/stm32/stm32_ltdc.c | 1 + drivers/video/video-uclass.c | 1 + 19 files changed, 20 insertions(+) (limited to 'drivers/video') diff --git a/drivers/video/atmel_hlcdfb.c b/drivers/video/atmel_hlcdfb.c index 734bc12..62accce 100644 --- a/drivers/video/atmel_hlcdfb.c +++ b/drivers/video/atmel_hlcdfb.c @@ -7,6 +7,7 @@ #include #include +#include #include #include #include diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c index 0a725c5..6d7661d 100644 --- a/drivers/video/console_truetype.c +++ b/drivers/video/console_truetype.c @@ -5,6 +5,7 @@ #include #include +#include #include #include diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c index 285633b..5fb6886 100644 --- a/drivers/video/da8xx-fb.c +++ b/drivers/video/da8xx-fb.c @@ -13,6 +13,7 @@ */ #include +#include #include #include #include diff --git a/drivers/video/dw_mipi_dsi.c b/drivers/video/dw_mipi_dsi.c index 83d7c7b..5dd75e7 100644 --- a/drivers/video/dw_mipi_dsi.c +++ b/drivers/video/dw_mipi_dsi.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include diff --git a/drivers/video/hitachi_tx18d42vm_lcd.c b/drivers/video/hitachi_tx18d42vm_lcd.c index 1629f55..a57abd2 100644 --- a/drivers/video/hitachi_tx18d42vm_lcd.c +++ b/drivers/video/hitachi_tx18d42vm_lcd.c @@ -6,6 +6,7 @@ */ #include +#include #include #include diff --git a/drivers/video/mali_dp.c b/drivers/video/mali_dp.c index 71151a8..87a75a9 100644 --- a/drivers/video/mali_dp.c +++ b/drivers/video/mali_dp.c @@ -6,6 +6,7 @@ */ #define DEBUG #include +#include #include #include #ifdef CONFIG_DISPLAY @@ -16,6 +17,7 @@ #include #include #include +#include #include #define MALIDP_CORE_ID 0x0018 diff --git a/drivers/video/mvebu_lcd.c b/drivers/video/mvebu_lcd.c index dc62545..3ff5b28 100644 --- a/drivers/video/mvebu_lcd.c +++ b/drivers/video/mvebu_lcd.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c index c529810..6f80fba 100644 --- a/drivers/video/mxsfb.c +++ b/drivers/video/mxsfb.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/video/orisetech_otm8009a.c b/drivers/video/orisetech_otm8009a.c index 89d9cfd..650ed07 100644 --- a/drivers/video/orisetech_otm8009a.c +++ b/drivers/video/orisetech_otm8009a.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #define OTM8009A_BACKLIGHT_DEFAULT 240 diff --git a/drivers/video/pwm_backlight.c b/drivers/video/pwm_backlight.c index ad20bf2..742579a 100644 --- a/drivers/video/pwm_backlight.c +++ b/drivers/video/pwm_backlight.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/video/raydium-rm68200.c b/drivers/video/raydium-rm68200.c index 91555e2..853dbc5 100644 --- a/drivers/video/raydium-rm68200.c +++ b/drivers/video/raydium-rm68200.c @@ -13,6 +13,7 @@ #include #include #include +#include #include /*** Manufacturer Command Set ***/ diff --git a/drivers/video/rockchip/rk3288_hdmi.c b/drivers/video/rockchip/rk3288_hdmi.c index 3d25ce9..51eb415 100644 --- a/drivers/video/rockchip/rk3288_hdmi.c +++ b/drivers/video/rockchip/rk3288_hdmi.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/video/rockchip/rk_edp.c b/drivers/video/rockchip/rk_edp.c index 4330725..8703df0 100644 --- a/drivers/video/rockchip/rk_edp.c +++ b/drivers/video/rockchip/rk_edp.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/video/sandbox_osd.c b/drivers/video/sandbox_osd.c index dd84489..7e72232 100644 --- a/drivers/video/sandbox_osd.c +++ b/drivers/video/sandbox_osd.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "sandbox_osd.h" diff --git a/drivers/video/scf0403_lcd.c b/drivers/video/scf0403_lcd.c index 58564e8..60075a6 100644 --- a/drivers/video/scf0403_lcd.c +++ b/drivers/video/scf0403_lcd.c @@ -14,6 +14,7 @@ */ #include +#include #include #include diff --git a/drivers/video/ssd2828.c b/drivers/video/ssd2828.c index 4d40dca..83566bc 100644 --- a/drivers/video/ssd2828.c +++ b/drivers/video/ssd2828.c @@ -10,6 +10,7 @@ */ #include +#include #include #include #include diff --git a/drivers/video/stm32/stm32_dsi.c b/drivers/video/stm32/stm32_dsi.c index 12895a8..ded03b1 100644 --- a/drivers/video/stm32/stm32_dsi.c +++ b/drivers/video/stm32/stm32_dsi.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/video/stm32/stm32_ltdc.c b/drivers/video/stm32/stm32_ltdc.c index 59ff692..be7e9bf 100644 --- a/drivers/video/stm32/stm32_ltdc.c +++ b/drivers/video/stm32/stm32_ltdc.c @@ -16,6 +16,7 @@ #include #include #include +#include struct stm32_ltdc_priv { void __iomem *regs; diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index 12057c8..3d658e6 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include -- cgit v1.1