u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH V9 00/14] Add splash screen support at u-boot SPL
@ 2023-04-20 12:10 Nikhil M Jain
  2023-04-20 12:10 ` [PATCH V9 01/14] drivers: video: Kconfig: Add configs for enabling video at SPL Nikhil M Jain
                   ` (14 more replies)
  0 siblings, 15 replies; 19+ messages in thread
From: Nikhil M Jain @ 2023-04-20 12:10 UTC (permalink / raw)
  To: n-jain1, u-boot, sjg; +Cc: trini, devarsht, vigneshr, nsekhar

To enable splash screen at SPL stage move video driver and splash screen
framework at SPL, which will bring up image on display very quickly and
thus have early display support in SPL.

Changes in V9
- Update as per review comments.
- Add Reviewed-by tag in appropriate patch.

Changes in V8
- Update as per review comments.

Changes in V7
- Replace #ifdefs' and #ifs' with if in common/splash and common/bmp.
- Add Reviewed-by and Tested-by tag in apprpriate patch.

Changes in V6
- Fix commit messages.
- Fix compile rules for video related files in patch
  drivers: video: Makefile: Rule to compile necessary video driver
  files.

Changes in V5
- Drop patch cmd: Makefile: Rule to compile bmp_cmd.
- Squash common: splash: Replace CONFIG_CMD_BMP patch into patches
  common: Enable splash functions at SPL
  include: Enable video related global data variable and splash at SPL
- Fix merge issue for next branch.
- Replace cmd/bmp_cmd with cmd/bmp.
- Use CONFIG_$(SPL_TPL_) to compile files in
  drivers: video: Makefile: Rule to compile necessary video driver files.
- Add Reviewed-by tag in appropriate patch.

Changes in V4
- Add Reviewed-by tag in appropriate patch.

Changes in V3
- Add separate video configs for SPL splash screen.
- Add rule to compile video driver in drivers/Makefile at SPL.
- Add rule to compile splash.c and splash_source.c.
- Squash drivers: video: video-uclass: Disable u-boot logo at SPL into
  drivers: video: Use CONFIG_IS_ENABLED and CONFIG_VAL.
- Split cmd/bmp.c to separate bmp functions and commands.
- Add CONFIG_BMP and CONFIG_SPL_BMP.
- Add rule to compile necessary files required for video driver.
- Add rule to compile common/bmp.c.

Changes in V2
- Removed artifacts from bad patch apply.

Nikhil M Jain (14):
  drivers: video: Kconfig: Add configs for enabling video at SPL
  drivers: video: tidss: Kconfig: Configs to enable TIDSS at SPL
  drivers: Makefile: Add rule to compile video driver
  drivers: video: Makefile: Rule to compile necessary video driver files
  drivers: video: tidss: Makefile: Add condition to compile TIDSS at SPL
  common: Makefile: Add rule to compile splash and splash_source at SPL
  common: Kconfig: Add BMP configs
  cmd: bmp: Split bmp commands and functions
  common: Makefile: Rule to compile bmp.c
  drivers: video: Enable necessary video functions at SPL
  common: Enable splash functions at SPL
  include: Enable video related global data variable and splash at SPL
  board: ti: am62x: evm: OSPI support for splash screen
  common: Replace #ifdef and #if with if's

 board/ti/am62x/evm.c              |   8 +-
 cmd/bmp.c                         | 162 +---------------------
 common/Kconfig                    |  12 ++
 common/Makefile                   |   3 +
 common/bmp.c                      | 149 ++++++++++++++++++++
 common/splash.c                   |  20 +--
 drivers/Makefile                  |   1 +
 drivers/video/Kconfig             | 223 +++++++++++++++++++++++++++++-
 drivers/video/Makefile            |  16 +--
 drivers/video/console_core.c      |   6 +-
 drivers/video/tidss/Kconfig       |   6 +
 drivers/video/tidss/Makefile      |   2 +-
 drivers/video/vidconsole-uclass.c |   2 +-
 drivers/video/video-uclass.c      |  14 +-
 drivers/video/video_bmp.c         |   8 +-
 include/asm-generic/global_data.h |   4 +-
 include/splash.h                  |  15 +-
 include/video.h                   |   8 ++
 18 files changed, 447 insertions(+), 212 deletions(-)
 create mode 100644 common/bmp.c

-- 
2.34.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH V9 01/14] drivers: video: Kconfig: Add configs for enabling video at SPL
  2023-04-20 12:10 [PATCH V9 00/14] Add splash screen support at u-boot SPL Nikhil M Jain
@ 2023-04-20 12:10 ` Nikhil M Jain
  2023-04-20 12:11 ` [PATCH V9 02/14] drivers: video: tidss: Kconfig: Configs to enable TIDSS " Nikhil M Jain
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Nikhil M Jain @ 2023-04-20 12:10 UTC (permalink / raw)
  To: n-jain1, u-boot, sjg; +Cc: trini, devarsht, vigneshr, nsekhar

Add Kconfigs which enable the video driver and splash screen at SPL
stage only and not at u-boot proper. The existing Kconfigs from u-boot
proper were not used to make SPL splash screen independent to them.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
---
V9:
- No change.

V8:
- No change.

V7:
- Add Reviewed-by and Tested-by tag.

V6:
- Replace CMD_BMP with BMP.

V5:
- Added Reviewed-by tag.

V4:
- No change.

V3:
- Add separate SPL video  and splash configs.
- Reviewed-by tag not added due to additional changes in V3.

V2:
- No change.

 drivers/video/Kconfig | 223 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 222 insertions(+), 1 deletion(-)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 60f4a4bf9c..05eaaa767a 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -893,7 +893,7 @@ endif # SPLASH_SCREEN
 
 config VIDEO_BMP_GZIP
 	bool "Gzip compressed BMP image support"
-	depends on CMD_BMP || SPLASH_SCREEN
+	depends on BMP || SPLASH_SCREEN
 	help
 	  If this option is set, additionally to standard BMP
 	  images, gzipped BMP images can be displayed via the
@@ -930,4 +930,225 @@ config BMP_32BPP
 
 endif # VIDEO
 
+config SPL_VIDEO
+	bool "Enable driver model support for LCD/video"
+	depends on SPL_DM
+	help
+	  The video subsystem adds a small amount of overhead to the image.
+	  If this is acceptable and you have a need to use video drivers in
+	  SPL, enable this option. It might provide a cleaner interface to
+	  setting up video within SPL, and allows the same drivers to be
+	  used as U-Boot proper.
+
+if SPL_VIDEO
+source "drivers/video/tidss/Kconfig"
+
+config SPL_VIDEO_LOGO
+	bool "Show the U-Boot logo on the display atSPL"
+	default y if !SPL_SPLASH_SCREEN
+	select SPL_VIDEO_BMP_RLE8
+	help
+	  This enables showing the U-Boot logo on the display when a video
+	  device is probed. It appears at the top right. The logo itself is at
+	  tools/logos/u-boot_logo.bmp and looks best when the display has a
+	  black background.
+
+config SPL_SPLASH_SCREEN
+	bool "Show a splash-screen image at SPL"
+	help
+	  If this option is set, the environment is checked for a variable
+	  "splashimage" at spl stage.
+
+config SPL_SYS_WHITE_ON_BLACK
+	bool "Display console as white on a black background at SPL"
+	help
+	 Normally the display is black on a white background, Enable this
+	 option to invert this, i.e. white on a black background at spl stage.
+	 This can be better in low-light situations or to reduce eye strain in
+	 some cases.
+
+config SPL_VIDEO_PCI_DEFAULT_FB_SIZE
+	hex "Default framebuffer size to use if no drivers request it at SPL"
+	default 0x1000000 if X86 && PCI
+	default 0 if !(X86 && PCI)
+	help
+	  Generally, video drivers request the amount of memory they need for
+	  the frame buffer when they are bound, by setting the size field in
+	  struct video_uc_plat. That memory is then reserved for use after
+	  relocation. But PCI drivers cannot be bound before relocation unless
+	  they are mentioned in the devicetree.
+
+	  With this value set appropriately, it is possible for PCI video
+	  devices to have a framebuffer allocated by U-Boot.
+
+	  Note: the framebuffer needs to be large enough to store all pixels at
+	  maximum resolution. For example, at 1920 x 1200 with 32 bits per
+	  pixel, 2560 * 1600 * 32 / 8 = 0xfa0000 bytes are needed.
+
+config SPL_CONSOLE_SCROLL_LINES
+	int "Number of lines to scroll the console by at SPL"
+	default 1
+	help
+	  When the console need to be scrolled, this is the number of
+	  lines to scroll by. It defaults to 1. Increasing this makes the
+	  console jump but can help speed up operation when scrolling
+	  is slow.
+
+config SPL_CONSOLE_NORMAL
+	bool "Support a simple text console at SPL"
+	default y
+	help
+	  Support drawing text on the frame buffer console so that it can be
+	  used as a console. Rotation is not supported by this driver (see
+	  CONFIG_CONSOLE_ROTATION for that). A built-in 8x16 font is used
+	  for the display.
+
+config SPL_BACKLIGHT
+	bool "Enable panel backlight uclass support at SPL"
+	default y
+	help
+	  This provides backlight uclass driver that enables basic panel
+	  backlight support.
+
+config SPL_PANEL
+	bool "Enable panel uclass support at SPL"
+	default y
+	help
+	  This provides panel uclass driver that enables basic panel support.
+
+config SPL_SIMPLE_PANEL
+	bool "Enable simple panel support at SPL"
+	depends on SPL_PANEL && SPL_BACKLIGHT && SPL_DM_GPIO
+	default y
+	help
+	  This turns on a simple panel driver that enables a compatible
+	  video panel.
+
+config SPL_SYS_WHITE_ON_BLACK
+	bool "Display console as white on a black background at SPL"
+	help
+	 Normally the display is black on a white background, Enable this
+	 option to invert this, i.e. white on a black background at spl stage.
+	 This can be better in low-light situations or to reduce eye strain in
+	 some cases.
+
+if SPL_SPLASH_SCREEN
+
+config SPL_SPLASH_SCREEN_ALIGN
+	bool "Allow positioning the splash image anywhere on the display at SPL"
+	help
+	  If this option is set the splash image can be freely positioned
+	  on the screen only at SPL. Environment variable "splashpos" specifies
+	  the position as "x,y". If a positive number is given it is used as
+	  number of pixel from left/top. If a negative number is given it
+	  is used as number of pixel from right/bottom.
+
+config SPL_SPLASH_SOURCE
+	bool "Control the source of the splash image at SPL"
+	help
+	  Use the splash_source.c library. This library provides facilities to
+	  declare board specific splash image locations, routines for loading
+	  splash image from supported locations, and a way of controlling the
+	  selected splash location using the "splashsource" environment
+	  variable.
+
+	  This CONFIG works as follows:
+
+	  - If splashsource is set to a supported location name as defined by
+	    board code, use that splash location.
+	  - If splashsource is undefined, use the first splash location as
+	    default.
+	  - If splashsource is set to an unsupported value, do not load a splash
+	    screen.
+
+	  A splash source location can describe either storage with raw data, a
+	  storage formatted with a file system or a FIT image. In case of a
+	  filesystem, the splash screen data is loaded as a file. The name of
+	  the splash screen file can be controlled with the environment variable
+	  "splashfile".
+
+	  To enable loading the splash image from a FIT image, CONFIG_FIT must
+	  be enabled. The FIT image has to start at the 'offset' field address
+	  in the selected splash location. The name of splash image within the
+	  FIT shall be specified by the environment variable "splashfile".
+
+	  In case the environment variable "splashfile" is not defined the
+	  default name 'splash.bmp' will be used.
+
+endif # SPL_SPLASH_SCREEN
+
+config SPL_VIDEO_BMP_GZIP
+	bool "Gzip compressed BMP image support at SPL"
+	depends on SPL_SPLASH_SCREEN || SPL_BMP
+	help
+	  If this option is set, additionally to standard BMP
+	  images, gzipped BMP images can be displayed via the
+	  splashscreen supportat SPL stage.
+
+config SPL_VIDEO_LOGO_MAX_SIZE
+	hex "Maximum size of the bitmap logo in bytes at SPL"
+	default 0x100000
+	help
+	  Sets the maximum uncompressed size of the logo. This is needed when
+	  decompressing a BMP file using the gzip algorithm, since it cannot
+	  read the size from the bitmap header.
+
+config SPL_VIDEO_BMP_RLE8
+	bool "Run length encoded BMP image (RLE8) support at SPL"
+	help
+	  If this option is set, the 8-bit RLE compressed BMP images
+	  is supported.
+
+config SPL_BMP_16BPP
+	bool "16-bit-per-pixel BMP image support at SPL"
+	help
+	  Support display of bitmaps file with 16-bit-per-pixel
+
+config SPL_BMP_24BPP
+	bool "24-bit-per-pixel BMP image support at SPL"
+	help
+	  Support display of bitmaps file with 24-bit-per-pixel.
+
+config SPL_BMP_32BPP
+	bool "32-bit-per-pixel BMP image support at SPL"
+	help
+	  Support display of bitmaps file with 32-bit-per-pixel.
+
+config SPL_VIDEO_BPP8
+	bool "Support 8-bit-per-pixel displays at SPL"
+	default y
+	help
+	  Support drawing text and bitmaps onto a 8-bit-per-pixel display.
+	  Enabling this will include code to support this display. Without
+	  this option, such displays will not be supported and console output
+	  will be empty.
+
+config SPL_VIDEO_BPP16
+	bool "Support 16-bit-per-pixel displays at SPL"
+	default y
+	help
+	  Support drawing text and bitmaps onto a 16-bit-per-pixel display.
+	  Enabling this will include code to support this display. Without
+	  this option, such displays will not be supported and console output
+	  will be empty.
+
+config SPL_VIDEO_BPP32
+	bool "Support 32-bit-per-pixel displays at SPL"
+	default y
+	help
+	  Support drawing text and bitmaps onto a 32-bit-per-pixel display.
+	  Enabling this will include code to support this display. Without
+	  this option, such displays will not be supported and console output
+	  will be empty.
+
+config SPL_HIDE_LOGO_VERSION
+    bool "Hide the version information on the splash screen at SPL"
+    help
+      Normally the U-Boot version string is shown on the display when the
+      splash screen is enabled. This information is not otherwise visible
+      since video starts up after U-Boot has displayed the initial banner.
+
+      Enable this option to hide this information.
+endif
+
 endmenu
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH V9 02/14] drivers: video: tidss: Kconfig: Configs to enable TIDSS at SPL
  2023-04-20 12:10 [PATCH V9 00/14] Add splash screen support at u-boot SPL Nikhil M Jain
  2023-04-20 12:10 ` [PATCH V9 01/14] drivers: video: Kconfig: Add configs for enabling video at SPL Nikhil M Jain
@ 2023-04-20 12:11 ` Nikhil M Jain
  2023-04-20 12:11 ` [PATCH V9 03/14] drivers: Makefile: Add rule to compile video driver Nikhil M Jain
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Nikhil M Jain @ 2023-04-20 12:11 UTC (permalink / raw)
  To: n-jain1, u-boot, sjg; +Cc: trini, devarsht, vigneshr, nsekhar

To enable tidss display driver only at SPL stage, add necessary config,
CONFIG_SPL_VIDEO_TIDSS.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
---
V9:
- No change.

V8:
- No change.

V7:
- No change.

V6:
- Fix commit message.
- Add Reviewed-By tag.

V5:
- No change.

V4:
- Add Reviewed-By tag

V3:
- No change.

V2:
- No change.

 drivers/video/tidss/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/video/tidss/Kconfig b/drivers/video/tidss/Kconfig
index 2a5e56ea4e..95086f3a5d 100644
--- a/drivers/video/tidss/Kconfig
+++ b/drivers/video/tidss/Kconfig
@@ -16,3 +16,9 @@ menuconfig VIDEO_TIDSS
 	  DPI . This option enables these supports which can be used on
 	  devices which have OLDI or HDMI display connected.
 
+config SPL_VIDEO_TIDSS
+	bool "Enable TIDSS video support in SPL Stage"
+	depends on SPL_VIDEO
+	help
+	  This options enables tidss driver in SPL stage. If
+	  you need to use tidss at SPL stage use this config.
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH V9 03/14] drivers: Makefile: Add rule to compile video driver
  2023-04-20 12:10 [PATCH V9 00/14] Add splash screen support at u-boot SPL Nikhil M Jain
  2023-04-20 12:10 ` [PATCH V9 01/14] drivers: video: Kconfig: Add configs for enabling video at SPL Nikhil M Jain
  2023-04-20 12:11 ` [PATCH V9 02/14] drivers: video: tidss: Kconfig: Configs to enable TIDSS " Nikhil M Jain
@ 2023-04-20 12:11 ` Nikhil M Jain
  2023-04-20 12:11 ` [PATCH V9 04/14] drivers: video: Makefile: Rule to compile necessary video driver files Nikhil M Jain
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Nikhil M Jain @ 2023-04-20 12:11 UTC (permalink / raw)
  To: n-jain1, u-boot, sjg; +Cc: trini, devarsht, vigneshr, nsekhar

Compile video driver at SPL using CONFIG_SPL_VIDEO.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>  # qemu-x86_64
---
V9:
- No change.

V8:
- No change.

V7:
- Add Reviewed-by and Tested-by tag.

V6:
- Add Reviewed-by tag.
- Commit message updated.

V5:
- Add rule to build video at SPL using CONFIG_SPL_VIDEO and retain
  obj-y +=video for u-boot proper.

V4:
- No change.

V3 (patch introduced):
- Add rule to compile video driver at SPL.

 drivers/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/Makefile b/drivers/Makefile
index 58be410135..928a8b0e9d 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -61,6 +61,7 @@ obj-$(CONFIG_SPL_USB_HOST) += usb/host/
 obj-$(CONFIG_SPL_SATA) += ata/ scsi/
 obj-$(CONFIG_SPL_LEGACY_BLOCK) += block/
 obj-$(CONFIG_SPL_THERMAL) += thermal/
+obj-$(CONFIG_SPL_VIDEO) +=video/
 
 endif
 endif
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH V9 04/14] drivers: video: Makefile: Rule to compile necessary video driver files
  2023-04-20 12:10 [PATCH V9 00/14] Add splash screen support at u-boot SPL Nikhil M Jain
                   ` (2 preceding siblings ...)
  2023-04-20 12:11 ` [PATCH V9 03/14] drivers: Makefile: Add rule to compile video driver Nikhil M Jain
@ 2023-04-20 12:11 ` Nikhil M Jain
  2023-04-20 12:11 ` [PATCH V9 05/14] drivers: video: tidss: Makefile: Add condition to compile TIDSS at SPL Nikhil M Jain
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Nikhil M Jain @ 2023-04-20 12:11 UTC (permalink / raw)
  To: n-jain1, u-boot, sjg; +Cc: trini, devarsht, vigneshr, nsekhar

To enable video driver at SPL, need to compile video-uclass,
vidconsole-uclass, backlight-uclass, panel-uclass, simple-panel, add
rules to compile them at SPL and u-boot proper. To support
splash_display at SPL, need to compile video-bmp, add rule to compile at
SPL and u-boot proper.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
---
V9:
- No change.

V8:
- No chage.

V7:
- Add Reviewed-by and Tested-by tag.

V6:
- Fix CONFIG_$(SPL_TPL)CONSOLE_NORMAL to CONFIG_$(SPL_TPL_)CONSOLE_NORMAL
- Add rule to compile simple_panel at SPL and u-boot proper.

V5:
- Use $(SPL_TPL_) to check for stage specific configs and compile at
  specific stages.
- Removed ifdef CONFIG_SPL_BUILD.

V4:
- No change.

V3:
- Rule to compile backlight, console and panel files.
- Not added Reiewed-by tag due to changes.

V2:
- No change.

 drivers/video/Makefile | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index cb3f373645..ba2fd41865 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -4,12 +4,12 @@
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 
 ifdef CONFIG_DM
-obj-$(CONFIG_BACKLIGHT) += backlight-uclass.o
+obj-$(CONFIG_$(SPL_TPL_)BACKLIGHT) += backlight-uclass.o
 obj-$(CONFIG_BACKLIGHT_GPIO) += backlight_gpio.o
 obj-$(CONFIG_BACKLIGHT_PWM) += pwm_backlight.o
-obj-$(CONFIG_CONSOLE_NORMAL) += console_normal.o
+obj-$(CONFIG_$(SPL_TPL_)CONSOLE_NORMAL) += console_normal.o
 obj-$(CONFIG_CONSOLE_ROTATION) += console_rotate.o
-ifdef CONFIG_CONSOLE_NORMAL
+ifdef CONFIG_$(SPL_TPL_)CONSOLE_NORMAL
 obj-y += console_core.o
 else ifdef CONFIG_CONSOLE_ROTATION
 obj-y += console_core.o
@@ -18,11 +18,11 @@ obj-$(CONFIG_CONSOLE_ROTATION) += console_core.o
 obj-$(CONFIG_CONSOLE_TRUETYPE) += console_truetype.o fonts/
 obj-$(CONFIG_DISPLAY) += display-uclass.o
 obj-$(CONFIG_VIDEO_MIPI_DSI) += dsi-host-uclass.o
-obj-$(CONFIG_VIDEO) += video-uclass.o vidconsole-uclass.o
-obj-$(CONFIG_VIDEO) += video_bmp.o
-obj-$(CONFIG_PANEL) += panel-uclass.o
+obj-$(CONFIG_$(SPL_TPL_)VIDEO) += video-uclass.o vidconsole-uclass.o
+obj-$(CONFIG_$(SPL_TPL_)VIDEO) += video_bmp.o
+obj-$(CONFIG_$(SPL_TPL_)PANEL) += panel-uclass.o
 obj-$(CONFIG_PANEL_HX8238D) += hx8238d.o
-obj-$(CONFIG_SIMPLE_PANEL) += simple_panel.o
+obj-$(CONFIG_$(SPL_TPL_)SIMPLE_PANEL) += simple_panel.o
 
 obj-$(CONFIG_VIDEO_LOGO) += u_boot_logo.o
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH V9 05/14] drivers: video: tidss: Makefile: Add condition to compile TIDSS at SPL
  2023-04-20 12:10 [PATCH V9 00/14] Add splash screen support at u-boot SPL Nikhil M Jain
                   ` (3 preceding siblings ...)
  2023-04-20 12:11 ` [PATCH V9 04/14] drivers: video: Makefile: Rule to compile necessary video driver files Nikhil M Jain
@ 2023-04-20 12:11 ` Nikhil M Jain
  2023-04-20 12:11 ` [PATCH V9 06/14] common: Makefile: Add rule to compile splash and splash_source " Nikhil M Jain
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Nikhil M Jain @ 2023-04-20 12:11 UTC (permalink / raw)
  To: n-jain1, u-boot, sjg; +Cc: trini, devarsht, vigneshr, nsekhar

To enable TIDSS driver only at SPL stage add rule to compile the TIDSS
video driver.

CONFIG_$(SPL_)VIDEO_TIDSS will compile tidss_drv, at SPL only if
CONFIG_SPL_VIDEO_TIDSS is defined and at u-boot proper if
CONFIG_VIDEO_TIDSS is defined.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
V9:
- No change.

V8:
- No change.

V7:
- No change.

V6:
- No change.

V5:
- Use CONFIG_$(SPL_)VIDEO_TIDSS to build TIDSS driver at SPL and u-boot
  proper.

V4:
- Added Reviewed-by tag.

V3:
- No change.

V2:
- No change.

 drivers/video/Makefile       | 2 +-
 drivers/video/tidss/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index ba2fd41865..c6a84581fc 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -32,7 +32,7 @@ obj-${CONFIG_EXYNOS_FB} += exynos/
 obj-${CONFIG_VIDEO_ROCKCHIP} += rockchip/
 obj-${CONFIG_VIDEO_STM32} += stm32/
 obj-${CONFIG_VIDEO_TEGRA124} += tegra124/
-obj-${CONFIG_VIDEO_TIDSS} += tidss/
+obj-${CONFIG_$(SPL_)VIDEO_TIDSS} += tidss/
 obj-y += ti/
 
 obj-$(CONFIG_ATMEL_HLCD) += atmel_hlcdfb.o
diff --git a/drivers/video/tidss/Makefile b/drivers/video/tidss/Makefile
index f4f8c6c470..a29cee2a41 100644
--- a/drivers/video/tidss/Makefile
+++ b/drivers/video/tidss/Makefile
@@ -9,4 +9,4 @@
 # Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
 
 
-obj-${CONFIG_VIDEO_TIDSS} = tidss_drv.o
+obj-${CONFIG_$(SPL_)VIDEO_TIDSS} = tidss_drv.o
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH V9 06/14] common: Makefile: Add rule to compile splash and splash_source at SPL
  2023-04-20 12:10 [PATCH V9 00/14] Add splash screen support at u-boot SPL Nikhil M Jain
                   ` (4 preceding siblings ...)
  2023-04-20 12:11 ` [PATCH V9 05/14] drivers: video: tidss: Makefile: Add condition to compile TIDSS at SPL Nikhil M Jain
@ 2023-04-20 12:11 ` Nikhil M Jain
  2023-04-20 12:11 ` [PATCH V9 07/14] common: Kconfig: Add BMP configs Nikhil M Jain
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Nikhil M Jain @ 2023-04-20 12:11 UTC (permalink / raw)
  To: n-jain1, u-boot, sjg; +Cc: trini, devarsht, vigneshr, nsekhar

To enable splash screen and loading bmp from boot media, add rules to
compile splash.c and splash_source.c at SPL stage only when
CONFIG_SPL_SPLASH_SCREEN and CONFIG_SPL_SPLASH_SOURCE are defined.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
V9:
- No change

V8:
- No change.

V7:
- Add Reviewed-by tag.

V6:
- Add Reviewed-by tag.

V5:
- No change.

V4:
- No change.

 common/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/common/Makefile b/common/Makefile
index a50302d8b5..3a6ca337e0 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -56,6 +56,8 @@ obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += fdt_support.o
 obj-$(CONFIG_SPL_USB_HOST) += usb.o usb_hub.o
 obj-$(CONFIG_SPL_USB_STORAGE) += usb_storage.o
 obj-$(CONFIG_SPL_MUSB_NEW) += usb.o
+obj-$(CONFIG_SPL_SPLASH_SCREEN) += splash.o
+obj-$(CONFIG_SPL_SPLASH_SOURCE) += splash_source.o
 endif # CONFIG_SPL_BUILD
 
 #others
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH V9 07/14] common: Kconfig: Add BMP configs
  2023-04-20 12:10 [PATCH V9 00/14] Add splash screen support at u-boot SPL Nikhil M Jain
                   ` (5 preceding siblings ...)
  2023-04-20 12:11 ` [PATCH V9 06/14] common: Makefile: Add rule to compile splash and splash_source " Nikhil M Jain
@ 2023-04-20 12:11 ` Nikhil M Jain
  2023-04-20 12:11 ` [PATCH V9 08/14] cmd: bmp: Split bmp commands and functions Nikhil M Jain
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Nikhil M Jain @ 2023-04-20 12:11 UTC (permalink / raw)
  To: n-jain1, u-boot, sjg; +Cc: trini, devarsht, vigneshr, nsekhar

Add CONFIG_BMP and CONFIG_SPL_BMP which enable displaying bmp images at
u-boot proper and SPL.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
---
V9:
- No change.

V8:
- No change.

V7:
- No change.

V6:
- Added Reviewed-by tag.

V5:
- Added Reviewed-by tag.

V4:
- No change.

 common/Kconfig | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/common/Kconfig b/common/Kconfig
index 7ff62552cb..7329dc8253 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1154,3 +1154,15 @@ config FDT_SIMPLEFB
 
 config IO_TRACE
 	bool
+
+config BMP
+	bool "Enable bmp image display"
+	default y if CMD_BMP
+	help
+	  Enable bmp functions to display bmp image and get bmp info.
+
+config SPL_BMP
+	bool "Enable bmp image display at  SPL"
+	depends on SPL_VIDEO
+	help
+	  Enable bmp functions to display bmp image and get bmp info at SPL.
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH V9 08/14] cmd: bmp: Split bmp commands and functions
  2023-04-20 12:10 [PATCH V9 00/14] Add splash screen support at u-boot SPL Nikhil M Jain
                   ` (6 preceding siblings ...)
  2023-04-20 12:11 ` [PATCH V9 07/14] common: Kconfig: Add BMP configs Nikhil M Jain
@ 2023-04-20 12:11 ` Nikhil M Jain
  2023-04-20 12:11 ` [PATCH V9 09/14] common: Makefile: Rule to compile bmp.c Nikhil M Jain
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Nikhil M Jain @ 2023-04-20 12:11 UTC (permalink / raw)
  To: n-jain1, u-boot, sjg; +Cc: trini, devarsht, vigneshr, nsekhar

To enable splash screen at SPL, need to compile cmd/bmp.c which also
includes bmp commands, since SPL doesn't use commands split bmp.c into
common/bmp.c which includes all bmp functions and cmd/bmp.c which only
contains bmp commands.

Add function delclaration for bmp_info in video.h.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
V9:
- No change.

V8:
- No change.

V7:
- No change.

V6:
- Fix commit  message.
- Remove unused header files.

V5:
- Rename cmd/bmp_cmd to cmd/bmp.

V4:
- No change.

V3 (patch introduced):
- Split bmp functions and commands.

 cmd/bmp.c       | 162 +-----------------------------------------------
 common/bmp.c    | 153 +++++++++++++++++++++++++++++++++++++++++++++
 include/video.h |   8 +++
 3 files changed, 163 insertions(+), 160 deletions(-)
 create mode 100644 common/bmp.c

diff --git a/cmd/bmp.c b/cmd/bmp.c
index 46d0d916e8..8f43a40daf 100644
--- a/cmd/bmp.c
+++ b/cmd/bmp.c
@@ -9,84 +9,12 @@
  */
 
 #include <common.h>
-#include <bmp_layout.h>
 #include <command.h>
-#include <dm.h>
-#include <gzip.h>
 #include <image.h>
-#include <log.h>
-#include <malloc.h>
 #include <mapmem.h>
 #include <splash.h>
 #include <video.h>
-#include <asm/byteorder.h>
-
-static int bmp_info (ulong addr);
-
-/*
- * Allocate and decompress a BMP image using gunzip().
- *
- * Returns a pointer to the decompressed image data. This pointer is
- * aligned to 32-bit-aligned-address + 2.
- * See doc/README.displaying-bmps for explanation.
- *
- * The allocation address is passed to 'alloc_addr' and must be freed
- * by the caller after use.
- *
- * Returns NULL if decompression failed, or if the decompressed data
- * didn't contain a valid BMP signature.
- */
-#ifdef CONFIG_VIDEO_BMP_GZIP
-struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
-			     void **alloc_addr)
-{
-	void *dst;
-	unsigned long len;
-	struct bmp_image *bmp;
-
-	/*
-	 * Decompress bmp image
-	 */
-	len = CONFIG_VIDEO_LOGO_MAX_SIZE;
-	/* allocate extra 3 bytes for 32-bit-aligned-address + 2 alignment */
-	dst = malloc(CONFIG_VIDEO_LOGO_MAX_SIZE + 3);
-	if (!dst) {
-		puts("Error: malloc in gunzip failed!\n");
-		return NULL;
-	}
-
-	/* align to 32-bit-aligned-address + 2 */
-	bmp = dst + 2;
-
-	if (gunzip(bmp, CONFIG_VIDEO_LOGO_MAX_SIZE, map_sysmem(addr, 0),
-		   &len)) {
-		free(dst);
-		return NULL;
-	}
-	if (len == CONFIG_VIDEO_LOGO_MAX_SIZE)
-		puts("Image could be truncated (increase CONFIG_VIDEO_LOGO_MAX_SIZE)!\n");
-
-	/*
-	 * Check for bmp mark 'BM'
-	 */
-	if (!((bmp->header.signature[0] == 'B') &&
-	      (bmp->header.signature[1] == 'M'))) {
-		free(dst);
-		return NULL;
-	}
-
-	debug("Gzipped BMP image detected!\n");
-
-	*alloc_addr = dst;
-	return bmp;
-}
-#else
-struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
-			     void **alloc_addr)
-{
-	return NULL;
-}
-#endif
+#include <stdlib.h>
 
 static int do_bmp_info(struct cmd_tbl *cmdtp, int flag, int argc,
 		       char *const argv[])
@@ -137,7 +65,7 @@ static int do_bmp_display(struct cmd_tbl *cmdtp, int flag, int argc,
 		return CMD_RET_USAGE;
 	}
 
-	 return (bmp_display(addr, x, y));
+	return (bmp_display(addr, x, y));
 }
 
 static struct cmd_tbl cmd_bmp_sub[] = {
@@ -145,22 +73,6 @@ static struct cmd_tbl cmd_bmp_sub[] = {
 	U_BOOT_CMD_MKENT(display, 5, 0, do_bmp_display, "", ""),
 };
 
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
-void bmp_reloc(void) {
-	fixup_cmdtable(cmd_bmp_sub, ARRAY_SIZE(cmd_bmp_sub));
-}
-#endif
-
-/*
- * Subroutine:  do_bmp
- *
- * Description: Handler for 'bmp' command..
- *
- * Inputs:	argv[1] contains the subcommand
- *
- * Return:      None
- *
- */
 static int do_bmp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 {
 	struct cmd_tbl *c;
@@ -183,73 +95,3 @@ U_BOOT_CMD(
 	"info <imageAddr>          - display image info\n"
 	"bmp display <imageAddr> [x y] - display image at x,y"
 );
-
-/*
- * Subroutine:  bmp_info
- *
- * Description: Show information about bmp file in memory
- *
- * Inputs:	addr		address of the bmp file
- *
- * Return:      None
- *
- */
-static int bmp_info(ulong addr)
-{
-	struct bmp_image *bmp = (struct bmp_image *)map_sysmem(addr, 0);
-	void *bmp_alloc_addr = NULL;
-	unsigned long len;
-
-	if (!((bmp->header.signature[0]=='B') &&
-	      (bmp->header.signature[1]=='M')))
-		bmp = gunzip_bmp(addr, &len, &bmp_alloc_addr);
-
-	if (bmp == NULL) {
-		printf("There is no valid bmp file at the given address\n");
-		return 1;
-	}
-
-	printf("Image size    : %d x %d\n", le32_to_cpu(bmp->header.width),
-	       le32_to_cpu(bmp->header.height));
-	printf("Bits per pixel: %d\n", le16_to_cpu(bmp->header.bit_count));
-	printf("Compression   : %d\n", le32_to_cpu(bmp->header.compression));
-
-	if (bmp_alloc_addr)
-		free(bmp_alloc_addr);
-
-	return(0);
-}
-
-int bmp_display(ulong addr, int x, int y)
-{
-	struct udevice *dev;
-	int ret;
-	struct bmp_image *bmp = map_sysmem(addr, 0);
-	void *bmp_alloc_addr = NULL;
-	unsigned long len;
-
-	if (!((bmp->header.signature[0]=='B') &&
-	      (bmp->header.signature[1]=='M')))
-		bmp = gunzip_bmp(addr, &len, &bmp_alloc_addr);
-
-	if (!bmp) {
-		printf("There is no valid bmp file at the given address\n");
-		return 1;
-	}
-	addr = map_to_sysmem(bmp);
-
-	ret = uclass_first_device_err(UCLASS_VIDEO, &dev);
-	if (!ret) {
-		bool align = false;
-
-		if (x == BMP_ALIGN_CENTER || y == BMP_ALIGN_CENTER)
-			align = true;
-
-		ret = video_bmp_display(dev, addr, x, y, align);
-	}
-
-	if (bmp_alloc_addr)
-		free(bmp_alloc_addr);
-
-	return ret ? CMD_RET_FAILURE : 0;
-}
diff --git a/common/bmp.c b/common/bmp.c
new file mode 100644
index 0000000000..4dbcb84893
--- /dev/null
+++ b/common/bmp.c
@@ -0,0 +1,153 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2002
+ * Detlev Zundel, DENX Software Engineering, dzu@denx.de.
+ */
+
+/*
+ * BMP handling routines
+ */
+
+#include <common.h>
+#include <bmp_layout.h>
+#include <command.h>
+#include <dm.h>
+#include <gzip.h>
+#include <log.h>
+#include <malloc.h>
+#include <mapmem.h>
+#include <splash.h>
+#include <video.h>
+#include <asm/byteorder.h>
+
+/*
+ * Allocate and decompress a BMP image using gunzip().
+ *
+ * Returns a pointer to the decompressed image data. This pointer is
+ * aligned to 32-bit-aligned-address + 2.
+ * See doc/README.displaying-bmps for explanation.
+ *
+ * The allocation address is passed to 'alloc_addr' and must be freed
+ * by the caller after use.
+ *
+ * Returns NULL if decompression failed, or if the decompressed data
+ * didn't contain a valid BMP signature.
+ */
+#ifdef CONFIG_VIDEO_BMP_GZIP
+struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
+			     void **alloc_addr)
+{
+	void *dst;
+	unsigned long len;
+	struct bmp_image *bmp;
+
+	/*
+	 * Decompress bmp image
+	 */
+	len = CONFIG_VIDEO_LOGO_MAX_SIZE;
+	/* allocate extra 3 bytes for 32-bit-aligned-address + 2 alignment */
+	dst = malloc(CONFIG_VIDEO_LOGO_MAX_SIZE + 3);
+	if (!dst) {
+		puts("Error: malloc in gunzip failed!\n");
+		return NULL;
+	}
+
+	/* align to 32-bit-aligned-address + 2 */
+	bmp = dst + 2;
+
+	if (gunzip(bmp, CONFIG_VIDEO_LOGO_MAX_SIZE, map_sysmem(addr, 0),
+		   &len)) {
+		free(dst);
+		return NULL;
+	}
+	if (len == CONFIG_VIDEO_LOGO_MAX_SIZE)
+		puts("Image could be truncated (increase CONFIG_VIDEO_LOGO_MAX_SIZE)!\n");
+
+	/*
+	 * Check for bmp mark 'BM'
+	 */
+	if (!((bmp->header.signature[0] == 'B') &&
+	      (bmp->header.signature[1] == 'M'))) {
+		free(dst);
+		return NULL;
+	}
+
+	debug("Gzipped BMP image detected!\n");
+
+	*alloc_addr = dst;
+	return bmp;
+}
+#else
+struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
+			     void **alloc_addr)
+{
+	return NULL;
+}
+#endif
+
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
+void bmp_reloc(void)
+{
+	fixup_cmdtable(cmd_bmp_sub, ARRAY_SIZE(cmd_bmp_sub));
+}
+#endif
+
+int bmp_info(ulong addr)
+{
+	struct bmp_image *bmp = (struct bmp_image *)map_sysmem(addr, 0);
+	void *bmp_alloc_addr = NULL;
+	unsigned long len;
+
+	if (!((bmp->header.signature[0] == 'B') &&
+	      (bmp->header.signature[1] == 'M')))
+		bmp = gunzip_bmp(addr, &len, &bmp_alloc_addr);
+
+	if (!bmp) {
+		printf("There is no valid bmp file at the given address\n");
+		return 1;
+	}
+
+	printf("Image size    : %d x %d\n", le32_to_cpu(bmp->header.width),
+	       le32_to_cpu(bmp->header.height));
+	printf("Bits per pixel: %d\n", le16_to_cpu(bmp->header.bit_count));
+	printf("Compression   : %d\n", le32_to_cpu(bmp->header.compression));
+
+	if (bmp_alloc_addr)
+		free(bmp_alloc_addr);
+
+	return 0;
+}
+
+int bmp_display(ulong addr, int x, int y)
+{
+	struct udevice *dev;
+	int ret;
+	struct bmp_image *bmp = map_sysmem(addr, 0);
+	void *bmp_alloc_addr = NULL;
+	unsigned long len;
+
+	if (!((bmp->header.signature[0] == 'B') &&
+	      (bmp->header.signature[1] == 'M')))
+		bmp = gunzip_bmp(addr, &len, &bmp_alloc_addr);
+
+	if (!bmp) {
+		printf("There is no valid bmp file at the given address\n");
+		return 1;
+	}
+	addr = map_to_sysmem(bmp);
+
+	ret = uclass_first_device_err(UCLASS_VIDEO, &dev);
+	if (!ret) {
+		bool align = false;
+
+		if (x == BMP_ALIGN_CENTER || y == BMP_ALIGN_CENTER)
+			align = true;
+
+		ret = video_bmp_display(dev, addr, x, y, align);
+	}
+
+	if (bmp_alloc_addr)
+		free(bmp_alloc_addr);
+
+	return ret ? CMD_RET_FAILURE : 0;
+}
diff --git a/include/video.h b/include/video.h
index 4d99e5dc27..29c4f51efb 100644
--- a/include/video.h
+++ b/include/video.h
@@ -357,4 +357,12 @@ void *video_get_u_boot_logo(void);
  */
 int bmp_display(ulong addr, int x, int y);
 
+/*
+ * bmp_info() - Show information about bmp file
+ *
+ * @addr: address of bmp file
+ * Returns: 0 if OK, else 1 if bmp image not found
+ */
+int bmp_info(ulong addr);
+
 #endif
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH V9 09/14] common: Makefile: Rule to compile bmp.c
  2023-04-20 12:10 [PATCH V9 00/14] Add splash screen support at u-boot SPL Nikhil M Jain
                   ` (7 preceding siblings ...)
  2023-04-20 12:11 ` [PATCH V9 08/14] cmd: bmp: Split bmp commands and functions Nikhil M Jain
@ 2023-04-20 12:11 ` Nikhil M Jain
  2023-04-20 12:11 ` [PATCH V9 10/14] drivers: video: Enable necessary video functions at SPL Nikhil M Jain
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Nikhil M Jain @ 2023-04-20 12:11 UTC (permalink / raw)
  To: n-jain1, u-boot, sjg; +Cc: trini, devarsht, vigneshr, nsekhar

Add rule to compile bmp.c at SPL and u-boot proper when CONFIG_SPL_BMP
and CONFIG_BMP are defined.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
---
V9:
- No change.

V8:
- No change.

V7:
- Add Reviewed-by and Tested-by tag.

V6:
- Add Reviewed-by tag.

V5:
- Remove obj-y+= read.o.

V4:
- No change.

V3 (patch introduced):
- Rule to compile common/bmp.

 common/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/Makefile b/common/Makefile
index 3a6ca337e0..c87bb2e78b 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -45,6 +45,7 @@ endif # !CONFIG_SPL_BUILD
 
 obj-$(CONFIG_$(SPL_TPL_)BOOTSTAGE) += bootstage.o
 obj-$(CONFIG_$(SPL_TPL_)BLOBLIST) += bloblist.o
+obj-$(CONFIG_$(SPL_)BMP) += bmp.o
 
 ifdef CONFIG_SPL_BUILD
 ifdef CONFIG_SPL_DFU
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH V9 10/14] drivers: video: Enable necessary video functions at SPL
  2023-04-20 12:10 [PATCH V9 00/14] Add splash screen support at u-boot SPL Nikhil M Jain
                   ` (8 preceding siblings ...)
  2023-04-20 12:11 ` [PATCH V9 09/14] common: Makefile: Rule to compile bmp.c Nikhil M Jain
@ 2023-04-20 12:11 ` Nikhil M Jain
  2023-04-20 12:11 ` [PATCH V9 11/14] common: Enable splash " Nikhil M Jain
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Nikhil M Jain @ 2023-04-20 12:11 UTC (permalink / raw)
  To: n-jain1, u-boot, sjg; +Cc: trini, devarsht, vigneshr, nsekhar

To support video driver at SPL use CONFIG_IS_ENABLED and CONFIG_VAL,
which checks for stage specific configs and thus enables video support
at respective stage.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
---
V9:
- No change.

V8:
- No change.

V7:
- Add Reviewed-by and Tested-by tag.

V6:
- No change.

V5:
- Add Reviewed-By tag.
- Use COFIG_IS_ENABLED in console_core in place of console_normal.

V4:
- No change.

V3 (patch introduced):
- Enable necessary video functions at SPL.

 drivers/video/console_core.c      |  6 +++---
 drivers/video/vidconsole-uclass.c |  2 +-
 drivers/video/video-uclass.c      | 14 +++++++-------
 drivers/video/video_bmp.c         |  8 ++++----
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/video/console_core.c b/drivers/video/console_core.c
index d4f79c656a..1f93b1b85f 100644
--- a/drivers/video/console_core.c
+++ b/drivers/video/console_core.c
@@ -46,11 +46,11 @@ static int console_set_font(struct udevice *dev, struct video_fontdata *fontdata
 
 int check_bpix_support(int bpix)
 {
-	if (bpix == VIDEO_BPP8 && IS_ENABLED(CONFIG_VIDEO_BPP8))
+	if (bpix == VIDEO_BPP8 && CONFIG_IS_ENABLED(VIDEO_BPP8))
 		return 0;
-	else if (bpix == VIDEO_BPP16 && IS_ENABLED(CONFIG_VIDEO_BPP16))
+	else if (bpix == VIDEO_BPP16 && CONFIG_IS_ENABLED(VIDEO_BPP16))
 		return 0;
-	else if (bpix == VIDEO_BPP32 && IS_ENABLED(CONFIG_VIDEO_BPP32))
+	else if (bpix == VIDEO_BPP32 && CONFIG_IS_ENABLED(VIDEO_BPP32))
 		return 0;
 	else
 		return -ENOSYS;
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c
index 1225de2333..a21fde0e1d 100644
--- a/drivers/video/vidconsole-uclass.c
+++ b/drivers/video/vidconsole-uclass.c
@@ -86,7 +86,7 @@ static void vidconsole_newline(struct udevice *dev)
 	struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
 	struct udevice *vid_dev = dev->parent;
 	struct video_priv *vid_priv = dev_get_uclass_priv(vid_dev);
-	const int rows = CONFIG_CONSOLE_SCROLL_LINES;
+	const int rows = CONFIG_VAL(CONSOLE_SCROLL_LINES);
 	int i, ret;
 
 	priv->xcur_frac = priv->xstart_frac;
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index da89f43144..8396bdfb11 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -132,7 +132,7 @@ int video_reserve(ulong *addrp)
 
 	/* Allocate space for PCI video devices in case there were not bound */
 	if (*addrp == gd->video_top)
-		*addrp -= CONFIG_VIDEO_PCI_DEFAULT_FB_SIZE;
+		*addrp -= CONFIG_VAL(VIDEO_PCI_DEFAULT_FB_SIZE);
 
 	gd->video_bottom = *addrp;
 	gd->fb_base = *addrp;
@@ -149,7 +149,7 @@ int video_fill(struct udevice *dev, u32 colour)
 
 	switch (priv->bpix) {
 	case VIDEO_BPP16:
-		if (IS_ENABLED(CONFIG_VIDEO_BPP16)) {
+		if (CONFIG_IS_ENABLED(VIDEO_BPP16)) {
 			u16 *ppix = priv->fb;
 			u16 *end = priv->fb + priv->fb_size;
 
@@ -158,7 +158,7 @@ int video_fill(struct udevice *dev, u32 colour)
 			break;
 		}
 	case VIDEO_BPP32:
-		if (IS_ENABLED(CONFIG_VIDEO_BPP32)) {
+		if (CONFIG_IS_ENABLED(VIDEO_BPP32)) {
 			u32 *ppix = priv->fb;
 			u32 *end = priv->fb + priv->fb_size;
 
@@ -212,14 +212,14 @@ u32 video_index_to_colour(struct video_priv *priv, unsigned int idx)
 {
 	switch (priv->bpix) {
 	case VIDEO_BPP16:
-		if (IS_ENABLED(CONFIG_VIDEO_BPP16)) {
+		if (CONFIG_IS_ENABLED(VIDEO_BPP16)) {
 			return ((colours[idx].r >> 3) << 11) |
 			       ((colours[idx].g >> 2) <<  5) |
 			       ((colours[idx].b >> 3) <<  0);
 		}
 		break;
 	case VIDEO_BPP32:
-		if (IS_ENABLED(CONFIG_VIDEO_BPP32)) {
+		if (CONFIG_IS_ENABLED(VIDEO_BPP32)) {
 			if (priv->format == VIDEO_X2R10G10B10)
 				return (colours[idx].r << 22) |
 				       (colours[idx].g << 12) |
@@ -513,8 +513,8 @@ static int video_post_probe(struct udevice *dev)
 		return ret;
 	}
 
-	if (IS_ENABLED(CONFIG_VIDEO_LOGO) &&
-	    !IS_ENABLED(CONFIG_SPLASH_SCREEN) && !plat->hide_logo) {
+	if (CONFIG_IS_ENABLED(VIDEO_LOGO) &&
+	    !CONFIG_IS_ENABLED(SPLASH_SCREEN) && !plat->hide_logo) {
 		ret = show_splash(dev);
 		if (ret) {
 			log_debug("Cannot show splash screen\n");
diff --git a/drivers/video/video_bmp.c b/drivers/video/video_bmp.c
index 6188a13e44..47e52c4f69 100644
--- a/drivers/video/video_bmp.c
+++ b/drivers/video/video_bmp.c
@@ -320,7 +320,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
 	switch (bmp_bpix) {
 	case 1:
 	case 8:
-		if (IS_ENABLED(CONFIG_VIDEO_BMP_RLE8)) {
+		if (CONFIG_IS_ENABLED(VIDEO_BMP_RLE8)) {
 			u32 compression = get_unaligned_le32(
 				&bmp->header.compression);
 			debug("compressed %d %d\n", compression, BMP_BI_RLE8);
@@ -348,7 +348,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
 		}
 		break;
 	case 16:
-		if (IS_ENABLED(CONFIG_BMP_16BPP)) {
+		if (CONFIG_IS_ENABLED(BMP_16BPP)) {
 			for (i = 0; i < height; ++i) {
 				schedule();
 				for (j = 0; j < width; j++) {
@@ -361,7 +361,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
 		}
 		break;
 	case 24:
-		if (IS_ENABLED(CONFIG_BMP_24BPP)) {
+		if (CONFIG_IS_ENABLED(BMP_24BPP)) {
 			for (i = 0; i < height; ++i) {
 				for (j = 0; j < width; j++) {
 					if (bpix == 16) {
@@ -395,7 +395,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
 		}
 		break;
 	case 32:
-		if (IS_ENABLED(CONFIG_BMP_32BPP)) {
+		if (CONFIG_IS_ENABLED(BMP_32BPP)) {
 			for (i = 0; i < height; ++i) {
 				for (j = 0; j < width; j++) {
 					if (eformat == VIDEO_X2R10G10B10) {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH V9 11/14] common: Enable splash functions at SPL
  2023-04-20 12:10 [PATCH V9 00/14] Add splash screen support at u-boot SPL Nikhil M Jain
                   ` (9 preceding siblings ...)
  2023-04-20 12:11 ` [PATCH V9 10/14] drivers: video: Enable necessary video functions at SPL Nikhil M Jain
@ 2023-04-20 12:11 ` Nikhil M Jain
  2023-04-20 12:11 ` [PATCH V9 12/14] include: Enable video related global data variable and splash " Nikhil M Jain
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Nikhil M Jain @ 2023-04-20 12:11 UTC (permalink / raw)
  To: n-jain1, u-boot, sjg; +Cc: trini, devarsht, vigneshr, nsekhar

To support splash screen at both u-boot proper and SPL use
CONFIG_IS_ENABLED and CONFIG_VAL to check for video related Kconfigs at
respective stages.

Replace CONFIG_CMD_BMP with CONFIG_BMP to enable splash_display function
at u-boot proper and SPL.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
V9:
- No change.

V8:
- Update as per review comments.

V7:
- Add Reviewed-by tag.

V6:
- Fix commit message.
- Add Reviewed-by tag.

V5:
- Replace CONFIG_CMD_BMP with CONFIG_BMP.

V4:
- No change

V3 (patch introduced):
- Enable splash functions at SPL

 common/bmp.c    | 10 +++++-----
 common/splash.c | 10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/common/bmp.c b/common/bmp.c
index 4dbcb84893..ad91351f19 100644
--- a/common/bmp.c
+++ b/common/bmp.c
@@ -33,7 +33,7 @@
  * Returns NULL if decompression failed, or if the decompressed data
  * didn't contain a valid BMP signature.
  */
-#ifdef CONFIG_VIDEO_BMP_GZIP
+#if CONFIG_IS_ENABLED(VIDEO_BMP_GZIP)
 struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
 			     void **alloc_addr)
 {
@@ -44,9 +44,9 @@ struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
 	/*
 	 * Decompress bmp image
 	 */
-	len = CONFIG_VIDEO_LOGO_MAX_SIZE;
+	len = CONFIG_VAL(VIDEO_LOGO_MAX_SIZE);
 	/* allocate extra 3 bytes for 32-bit-aligned-address + 2 alignment */
-	dst = malloc(CONFIG_VIDEO_LOGO_MAX_SIZE + 3);
+	dst = malloc(CONFIG_VAL(VIDEO_LOGO_MAX_SIZE) + 3);
 	if (!dst) {
 		puts("Error: malloc in gunzip failed!\n");
 		return NULL;
@@ -55,12 +55,12 @@ struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
 	/* align to 32-bit-aligned-address + 2 */
 	bmp = dst + 2;
 
-	if (gunzip(bmp, CONFIG_VIDEO_LOGO_MAX_SIZE, map_sysmem(addr, 0),
+	if (gunzip(bmp, CONFIG_VAL(VIDEO_LOGO_MAX_SIZE), map_sysmem(addr, 0),
 		   &len)) {
 		free(dst);
 		return NULL;
 	}
-	if (len == CONFIG_VIDEO_LOGO_MAX_SIZE)
+	if (len == CONFIG_VAL(VIDEO_LOGO_MAX_SIZE))
 		puts("Image could be truncated (increase CONFIG_VIDEO_LOGO_MAX_SIZE)!\n");
 
 	/*
diff --git a/common/splash.c b/common/splash.c
index 4bc54b1bf9..a4e68b7042 100644
--- a/common/splash.c
+++ b/common/splash.c
@@ -89,14 +89,14 @@ static inline int splash_video_logo_load(void) { return -ENOSYS; }
 
 __weak int splash_screen_prepare(void)
 {
-	if (IS_ENABLED(CONFIG_SPLASH_SOURCE))
+	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
+#if CONFIG_IS_ENABLED(SPLASH_SCREEN_ALIGN)
 void splash_get_pos(int *x, int *y)
 {
 	char *s = env_get("splashpos");
@@ -119,7 +119,7 @@ void splash_get_pos(int *x, int *y)
 }
 #endif /* CONFIG_SPLASH_SCREEN_ALIGN */
 
-#if defined(CONFIG_VIDEO) && !defined(CONFIG_HIDE_LOGO_VERSION)
+#if CONFIG_IS_ENABLED(VIDEO) && !CONFIG_IS_ENABLED(HIDE_LOGO_VERSION)
 
 #ifdef CONFIG_VIDEO_LOGO
 #include <bmp_logo.h>
@@ -159,7 +159,7 @@ void splash_display_banner(void)
  * Common function to show a splash image if env("splashimage") is set.
  * For additional details please refer to doc/README.splashprepare.
  */
-#if defined(CONFIG_SPLASH_SCREEN) && defined(CONFIG_CMD_BMP)
+#if CONFIG_IS_ENABLED(SPLASH_SCREEN) && CONFIG_IS_ENABLED(BMP)
 int splash_display(void)
 {
 	ulong addr;
@@ -183,7 +183,7 @@ int splash_display(void)
 	if (x || y)
 		goto end;
 
-#if defined(CONFIG_VIDEO) && !defined(CONFIG_HIDE_LOGO_VERSION)
+#if CONFIG_IS_ENABLED(VIDEO) && !CONFIG_IS_ENABLED(HIDE_LOGO_VERSION)
 	splash_display_banner();
 #endif
 end:
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH V9 12/14] include: Enable video related global data variable and splash at SPL
  2023-04-20 12:10 [PATCH V9 00/14] Add splash screen support at u-boot SPL Nikhil M Jain
                   ` (10 preceding siblings ...)
  2023-04-20 12:11 ` [PATCH V9 11/14] common: Enable splash " Nikhil M Jain
@ 2023-04-20 12:11 ` Nikhil M Jain
  2023-04-20 12:11 ` [PATCH V9 13/14] board: ti: am62x: evm: OSPI support for splash screen Nikhil M Jain
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Nikhil M Jain @ 2023-04-20 12:11 UTC (permalink / raw)
  To: n-jain1, u-boot, sjg; +Cc: trini, devarsht, vigneshr, nsekhar

To include video related global data variables and splash functions at
SPL and u-boot proper, use CONFIG_IS_ENABLED.

Replace CONFIG_CMD_BMP with CONFIG_BMP to enable splash_display function
at u-boot proper and SPL.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
V9:
- No change.

V8:
- No change.

V7:
- Add Reviewed-by tag.

V6:
- Fix commit message.
- Add Reviewed-by tag.

V5:
- Replace CONFIG_CMD_BMP with CONFIG_BMP.

V4:
- No change.

V3 (patch introduced):
- Enable splash functions at SPL.

 include/asm-generic/global_data.h | 4 ++--
 include/splash.h                  | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index 987fb66c17..65bf8df1e5 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -68,7 +68,7 @@ struct global_data {
 	 * @mem_clk: memory clock rate in Hz
 	 */
 	unsigned long mem_clk;
-#if defined(CONFIG_VIDEO)
+#if CONFIG_IS_ENABLED(VIDEO)
 	/**
 	 * @fb_base: base address of frame buffer memory
 	 */
@@ -359,7 +359,7 @@ struct global_data {
 	 */
 	struct membuff console_in;
 #endif
-#ifdef CONFIG_VIDEO
+#if CONFIG_IS_ENABLED(VIDEO)
 	/**
 	 * @video_top: top of video frame buffer area
 	 */
diff --git a/include/splash.h b/include/splash.h
index 33e45e6941..b6a100ffc3 100644
--- a/include/splash.h
+++ b/include/splash.h
@@ -49,7 +49,7 @@ struct splash_location {
 	char *ubivol;	/* UBI volume-name for ubifsmount */
 };
 
-#ifdef CONFIG_SPLASH_SOURCE
+#if CONFIG_IS_ENABLED(SPLASH_SOURCE)
 int splash_source_load(struct splash_location *locations, uint size);
 #else
 static inline int splash_source_load(struct splash_location *locations,
@@ -61,13 +61,13 @@ static inline int splash_source_load(struct splash_location *locations,
 
 int splash_screen_prepare(void);
 
-#ifdef CONFIG_SPLASH_SCREEN_ALIGN
+#if CONFIG_IS_ENABLED(SPLASH_SCREEN_ALIGN)
 void splash_get_pos(int *x, int *y);
 #else
 static inline void splash_get_pos(int *x, int *y) { }
 #endif
 
-#if defined(CONFIG_SPLASH_SCREEN) && defined(CONFIG_CMD_BMP)
+#if CONFIG_IS_ENABLED(SPLASH_SCREEN) && CONFIG_IS_ENABLED(BMP)
 int splash_display(void);
 #else
 static inline int splash_display(void)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH V9 13/14] board: ti: am62x: evm: OSPI support for splash screen
  2023-04-20 12:10 [PATCH V9 00/14] Add splash screen support at u-boot SPL Nikhil M Jain
                   ` (11 preceding siblings ...)
  2023-04-20 12:11 ` [PATCH V9 12/14] include: Enable video related global data variable and splash " Nikhil M Jain
@ 2023-04-20 12:11 ` Nikhil M Jain
  2023-04-20 12:11 ` [PATCH V9 14/14] common: Replace #ifdef and #if with if's Nikhil M Jain
  2023-05-05  0:40 ` [PATCH V9 00/14] Add splash screen support at u-boot SPL Simon Glass
  14 siblings, 0 replies; 19+ messages in thread
From: Nikhil M Jain @ 2023-04-20 12:11 UTC (permalink / raw)
  To: n-jain1, u-boot, sjg; +Cc: trini, devarsht, vigneshr, nsekhar

Add ospi boot media support to load splash image from OSPI memory,
add offset to read image from ospi and necessary flags defininig type
of storage and storage device.

Use CONFIG_IS_ENBALED to use the splash locations at SPL and u-boot
proper.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
---
V9:
- No change.

V8:
- No change.

V7:
- Add Reviewed-by tag.

V6:
- No change.

V5:
- Replace #ifdef with #if.
- Add Reviewed-by tag.

V4:
- Added Reviewed-by tag.

V3:
- Enable splash location at SPL.

V2:
- No change.

 board/ti/am62x/evm.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c
index 584b4ec552..fd58ece29c 100644
--- a/board/ti/am62x/evm.c
+++ b/board/ti/am62x/evm.c
@@ -20,8 +20,14 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_SPLASH_SCREEN
+#if CONFIG_IS_ENABLED(SPLASH_SCREEN)
 static struct splash_location default_splash_locations[] = {
+	{
+		.name = "sf",
+		.storage = SPLASH_STORAGE_SF,
+		.flags = SPLASH_STORAGE_RAW,
+		.offset = 0x700000,
+	},
 	{
 		.name		= "mmc",
 		.storage	= SPLASH_STORAGE_MMC,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH V9 14/14] common: Replace #ifdef and #if with if's
  2023-04-20 12:10 [PATCH V9 00/14] Add splash screen support at u-boot SPL Nikhil M Jain
                   ` (12 preceding siblings ...)
  2023-04-20 12:11 ` [PATCH V9 13/14] board: ti: am62x: evm: OSPI support for splash screen Nikhil M Jain
@ 2023-04-20 12:11 ` Nikhil M Jain
  2023-05-05  0:40 ` [PATCH V9 00/14] Add splash screen support at u-boot SPL Simon Glass
  14 siblings, 0 replies; 19+ messages in thread
From: Nikhil M Jain @ 2023-04-20 12:11 UTC (permalink / raw)
  To: n-jain1, u-boot, sjg; +Cc: trini, devarsht, vigneshr, nsekhar

Avoid using preprocessor compilation directives and instead use simple
logical expressions for better readability since compiler will anyway
optimize out the respective code block if condition is not satisfied.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
---
V9:
- Add Reviewed-By tag.

V8:
- Update as per review comments.
- Call bmp_display only when CONFIG_BMP is defined.

V7(patch introduced):
- Replace #ifdef and #if with if's.

 common/bmp.c     | 14 +++++---------
 common/splash.c  | 14 +++++++-------
 include/splash.h | 13 -------------
 3 files changed, 12 insertions(+), 29 deletions(-)

diff --git a/common/bmp.c b/common/bmp.c
index ad91351f19..57764f3653 100644
--- a/common/bmp.c
+++ b/common/bmp.c
@@ -31,9 +31,9 @@
  * by the caller after use.
  *
  * Returns NULL if decompression failed, or if the decompressed data
- * didn't contain a valid BMP signature.
+ * didn't contain a valid BMP signature or decompression is not enabled in
+ * Kconfig.
  */
-#if CONFIG_IS_ENABLED(VIDEO_BMP_GZIP)
 struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
 			     void **alloc_addr)
 {
@@ -41,6 +41,9 @@ struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
 	unsigned long len;
 	struct bmp_image *bmp;
 
+	if (!CONFIG_IS_ENABLED(VIDEO_BMP_GZIP))
+		return NULL;
+
 	/*
 	 * Decompress bmp image
 	 */
@@ -77,13 +80,6 @@ struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
 	*alloc_addr = dst;
 	return bmp;
 }
-#else
-struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
-			     void **alloc_addr)
-{
-	return NULL;
-}
-#endif
 
 #ifdef CONFIG_NEEDS_MANUAL_RELOC
 void bmp_reloc(void)
diff --git a/common/splash.c b/common/splash.c
index a4e68b7042..6820db683b 100644
--- a/common/splash.c
+++ b/common/splash.c
@@ -96,12 +96,11 @@ __weak int splash_screen_prepare(void)
 	return splash_video_logo_load();
 }
 
-#if CONFIG_IS_ENABLED(SPLASH_SCREEN_ALIGN)
 void splash_get_pos(int *x, int *y)
 {
 	char *s = env_get("splashpos");
 
-	if (!s)
+	if (!CONFIG_IS_ENABLED(SPLASH_SCREEN_ALIGN) || !s)
 		return;
 
 	if (s[0] == 'm')
@@ -117,7 +116,6 @@ void splash_get_pos(int *x, int *y)
 			*y = simple_strtol(s + 1, NULL, 0);
 	}
 }
-#endif /* CONFIG_SPLASH_SCREEN_ALIGN */
 
 #if CONFIG_IS_ENABLED(VIDEO) && !CONFIG_IS_ENABLED(HIDE_LOGO_VERSION)
 
@@ -159,13 +157,13 @@ void splash_display_banner(void)
  * Common function to show a splash image if env("splashimage") is set.
  * For additional details please refer to doc/README.splashprepare.
  */
-#if CONFIG_IS_ENABLED(SPLASH_SCREEN) && CONFIG_IS_ENABLED(BMP)
 int splash_display(void)
 {
 	ulong addr;
 	char *s;
 	int x = 0, y = 0, ret;
-
+	if (!CONFIG_IS_ENABLED(SPLASH_SCREEN))
+		return -ENOSYS;
 	s = env_get("splashimage");
 	if (!s)
 		return -EINVAL;
@@ -177,7 +175,10 @@ int splash_display(void)
 
 	splash_get_pos(&x, &y);
 
-	ret = bmp_display(addr, x, y);
+	if (CONFIG_IS_ENABLED(BMP))
+		ret = bmp_display(addr, x, y);
+	else
+		return -ENOSYS;
 
 	/* Skip banner output on video console if the logo is not at 0,0 */
 	if (x || y)
@@ -189,4 +190,3 @@ int splash_display(void)
 end:
 	return ret;
 }
-#endif
diff --git a/include/splash.h b/include/splash.h
index b6a100ffc3..c392237598 100644
--- a/include/splash.h
+++ b/include/splash.h
@@ -60,21 +60,8 @@ static inline int splash_source_load(struct splash_location *locations,
 #endif
 
 int splash_screen_prepare(void);
-
-#if CONFIG_IS_ENABLED(SPLASH_SCREEN_ALIGN)
 void splash_get_pos(int *x, int *y);
-#else
-static inline void splash_get_pos(int *x, int *y) { }
-#endif
-
-#if CONFIG_IS_ENABLED(SPLASH_SCREEN) && CONFIG_IS_ENABLED(BMP)
 int splash_display(void);
-#else
-static inline int splash_display(void)
-{
-	return -ENOSYS;
-}
-#endif
 
 #define BMP_ALIGN_CENTER	0x7FFF
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH V9 00/14] Add splash screen support at u-boot SPL
  2023-04-20 12:10 [PATCH V9 00/14] Add splash screen support at u-boot SPL Nikhil M Jain
                   ` (13 preceding siblings ...)
  2023-04-20 12:11 ` [PATCH V9 14/14] common: Replace #ifdef and #if with if's Nikhil M Jain
@ 2023-05-05  0:40 ` Simon Glass
  2023-05-05  0:56   ` Tom Rini
  2023-05-05  8:34   ` Anatolij Gustschin
  14 siblings, 2 replies; 19+ messages in thread
From: Simon Glass @ 2023-05-05  0:40 UTC (permalink / raw)
  To: Nikhil M Jain; +Cc: u-boot, trini, devarsht, vigneshr, nsekhar

Hi,

On Thu, 20 Apr 2023 at 06:11, Nikhil M Jain <n-jain1@ti.com> wrote:
>
> To enable splash screen at SPL stage move video driver and splash screen
> framework at SPL, which will bring up image on display very quickly and
> thus have early display support in SPL.
>
> Changes in V9
> - Update as per review comments.
> - Add Reviewed-by tag in appropriate patch.
>
> Changes in V8
> - Update as per review comments.
>
> Changes in V7
> - Replace #ifdefs' and #ifs' with if in common/splash and common/bmp.
> - Add Reviewed-by and Tested-by tag in apprpriate patch.
>
> Changes in V6
> - Fix commit messages.
> - Fix compile rules for video related files in patch
>   drivers: video: Makefile: Rule to compile necessary video driver
>   files.
>
> Changes in V5
> - Drop patch cmd: Makefile: Rule to compile bmp_cmd.
> - Squash common: splash: Replace CONFIG_CMD_BMP patch into patches
>   common: Enable splash functions at SPL
>   include: Enable video related global data variable and splash at SPL
> - Fix merge issue for next branch.
> - Replace cmd/bmp_cmd with cmd/bmp.
> - Use CONFIG_$(SPL_TPL_) to compile files in
>   drivers: video: Makefile: Rule to compile necessary video driver files.
> - Add Reviewed-by tag in appropriate patch.
>
> Changes in V4
> - Add Reviewed-by tag in appropriate patch.
>
> Changes in V3
> - Add separate video configs for SPL splash screen.
> - Add rule to compile video driver in drivers/Makefile at SPL.
> - Add rule to compile splash.c and splash_source.c.
> - Squash drivers: video: video-uclass: Disable u-boot logo at SPL into
>   drivers: video: Use CONFIG_IS_ENABLED and CONFIG_VAL.
> - Split cmd/bmp.c to separate bmp functions and commands.
> - Add CONFIG_BMP and CONFIG_SPL_BMP.
> - Add rule to compile necessary files required for video driver.
> - Add rule to compile common/bmp.c.
>
> Changes in V2
> - Removed artifacts from bad patch apply.
>
> Nikhil M Jain (14):
>   drivers: video: Kconfig: Add configs for enabling video at SPL
>   drivers: video: tidss: Kconfig: Configs to enable TIDSS at SPL
>   drivers: Makefile: Add rule to compile video driver
>   drivers: video: Makefile: Rule to compile necessary video driver files
>   drivers: video: tidss: Makefile: Add condition to compile TIDSS at SPL
>   common: Makefile: Add rule to compile splash and splash_source at SPL
>   common: Kconfig: Add BMP configs
>   cmd: bmp: Split bmp commands and functions
>   common: Makefile: Rule to compile bmp.c
>   drivers: video: Enable necessary video functions at SPL
>   common: Enable splash functions at SPL
>   include: Enable video related global data variable and splash at SPL
>   board: ti: am62x: evm: OSPI support for splash screen
>   common: Replace #ifdef and #if with if's
>
>  board/ti/am62x/evm.c              |   8 +-
>  cmd/bmp.c                         | 162 +---------------------
>  common/Kconfig                    |  12 ++
>  common/Makefile                   |   3 +
>  common/bmp.c                      | 149 ++++++++++++++++++++
>  common/splash.c                   |  20 +--
>  drivers/Makefile                  |   1 +
>  drivers/video/Kconfig             | 223 +++++++++++++++++++++++++++++-
>  drivers/video/Makefile            |  16 +--
>  drivers/video/console_core.c      |   6 +-
>  drivers/video/tidss/Kconfig       |   6 +
>  drivers/video/tidss/Makefile      |   2 +-
>  drivers/video/vidconsole-uclass.c |   2 +-
>  drivers/video/video-uclass.c      |  14 +-
>  drivers/video/video_bmp.c         |   8 +-
>  include/asm-generic/global_data.h |   4 +-
>  include/splash.h                  |  15 +-
>  include/video.h                   |   8 ++
>  18 files changed, 447 insertions(+), 212 deletions(-)
>  create mode 100644 common/bmp.c
>
> --
> 2.34.1
>

Can this be applied, please? We have rc1 out now so this should really
be in there by now.

I have another series that depends on it, and it is also pending application.

Regards,
Simon

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH V9 00/14] Add splash screen support at u-boot SPL
  2023-05-05  0:40 ` [PATCH V9 00/14] Add splash screen support at u-boot SPL Simon Glass
@ 2023-05-05  0:56   ` Tom Rini
  2023-05-05  8:38     ` Anatolij Gustschin
  2023-05-05  8:34   ` Anatolij Gustschin
  1 sibling, 1 reply; 19+ messages in thread
From: Tom Rini @ 2023-05-05  0:56 UTC (permalink / raw)
  To: Simon Glass, Anatolij Gustschin
  Cc: Nikhil M Jain, u-boot, devarsht, vigneshr, nsekhar

[-- Attachment #1: Type: text/plain, Size: 4302 bytes --]

On Thu, May 04, 2023 at 06:40:56PM -0600, Simon Glass wrote:
> Hi,
> 
> On Thu, 20 Apr 2023 at 06:11, Nikhil M Jain <n-jain1@ti.com> wrote:
> >
> > To enable splash screen at SPL stage move video driver and splash screen
> > framework at SPL, which will bring up image on display very quickly and
> > thus have early display support in SPL.
> >
> > Changes in V9
> > - Update as per review comments.
> > - Add Reviewed-by tag in appropriate patch.
> >
> > Changes in V8
> > - Update as per review comments.
> >
> > Changes in V7
> > - Replace #ifdefs' and #ifs' with if in common/splash and common/bmp.
> > - Add Reviewed-by and Tested-by tag in apprpriate patch.
> >
> > Changes in V6
> > - Fix commit messages.
> > - Fix compile rules for video related files in patch
> >   drivers: video: Makefile: Rule to compile necessary video driver
> >   files.
> >
> > Changes in V5
> > - Drop patch cmd: Makefile: Rule to compile bmp_cmd.
> > - Squash common: splash: Replace CONFIG_CMD_BMP patch into patches
> >   common: Enable splash functions at SPL
> >   include: Enable video related global data variable and splash at SPL
> > - Fix merge issue for next branch.
> > - Replace cmd/bmp_cmd with cmd/bmp.
> > - Use CONFIG_$(SPL_TPL_) to compile files in
> >   drivers: video: Makefile: Rule to compile necessary video driver files.
> > - Add Reviewed-by tag in appropriate patch.
> >
> > Changes in V4
> > - Add Reviewed-by tag in appropriate patch.
> >
> > Changes in V3
> > - Add separate video configs for SPL splash screen.
> > - Add rule to compile video driver in drivers/Makefile at SPL.
> > - Add rule to compile splash.c and splash_source.c.
> > - Squash drivers: video: video-uclass: Disable u-boot logo at SPL into
> >   drivers: video: Use CONFIG_IS_ENABLED and CONFIG_VAL.
> > - Split cmd/bmp.c to separate bmp functions and commands.
> > - Add CONFIG_BMP and CONFIG_SPL_BMP.
> > - Add rule to compile necessary files required for video driver.
> > - Add rule to compile common/bmp.c.
> >
> > Changes in V2
> > - Removed artifacts from bad patch apply.
> >
> > Nikhil M Jain (14):
> >   drivers: video: Kconfig: Add configs for enabling video at SPL
> >   drivers: video: tidss: Kconfig: Configs to enable TIDSS at SPL
> >   drivers: Makefile: Add rule to compile video driver
> >   drivers: video: Makefile: Rule to compile necessary video driver files
> >   drivers: video: tidss: Makefile: Add condition to compile TIDSS at SPL
> >   common: Makefile: Add rule to compile splash and splash_source at SPL
> >   common: Kconfig: Add BMP configs
> >   cmd: bmp: Split bmp commands and functions
> >   common: Makefile: Rule to compile bmp.c
> >   drivers: video: Enable necessary video functions at SPL
> >   common: Enable splash functions at SPL
> >   include: Enable video related global data variable and splash at SPL
> >   board: ti: am62x: evm: OSPI support for splash screen
> >   common: Replace #ifdef and #if with if's
> >
> >  board/ti/am62x/evm.c              |   8 +-
> >  cmd/bmp.c                         | 162 +---------------------
> >  common/Kconfig                    |  12 ++
> >  common/Makefile                   |   3 +
> >  common/bmp.c                      | 149 ++++++++++++++++++++
> >  common/splash.c                   |  20 +--
> >  drivers/Makefile                  |   1 +
> >  drivers/video/Kconfig             | 223 +++++++++++++++++++++++++++++-
> >  drivers/video/Makefile            |  16 +--
> >  drivers/video/console_core.c      |   6 +-
> >  drivers/video/tidss/Kconfig       |   6 +
> >  drivers/video/tidss/Makefile      |   2 +-
> >  drivers/video/vidconsole-uclass.c |   2 +-
> >  drivers/video/video-uclass.c      |  14 +-
> >  drivers/video/video_bmp.c         |   8 +-
> >  include/asm-generic/global_data.h |   4 +-
> >  include/splash.h                  |  15 +-
> >  include/video.h                   |   8 ++
> >  18 files changed, 447 insertions(+), 212 deletions(-)
> >  create mode 100644 common/bmp.c
> >
> > --
> > 2.34.1
> >
> 
> Can this be applied, please? We have rc1 out now so this should really
> be in there by now.
> 
> I have another series that depends on it, and it is also pending application.

Anatolij ?

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH V9 00/14] Add splash screen support at u-boot SPL
  2023-05-05  0:40 ` [PATCH V9 00/14] Add splash screen support at u-boot SPL Simon Glass
  2023-05-05  0:56   ` Tom Rini
@ 2023-05-05  8:34   ` Anatolij Gustschin
  1 sibling, 0 replies; 19+ messages in thread
From: Anatolij Gustschin @ 2023-05-05  8:34 UTC (permalink / raw)
  To: Simon Glass; +Cc: Nikhil M Jain, u-boot, trini, devarsht, vigneshr, nsekhar

Hi Simon,

On Thu, 4 May 2023 18:40:56 -0600
Simon Glass sjg@chromium.org wrote:
... 
> Can this be applied, please? We have rc1 out now so this should really
> be in there by now.
> 
> I have another series that depends on it, and it is also pending application.

Series applied to u-boot-video now. A pull request for Tom is pending.

Sorry for delay.

--
Anatolij

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH V9 00/14] Add splash screen support at u-boot SPL
  2023-05-05  0:56   ` Tom Rini
@ 2023-05-05  8:38     ` Anatolij Gustschin
  0 siblings, 0 replies; 19+ messages in thread
From: Anatolij Gustschin @ 2023-05-05  8:38 UTC (permalink / raw)
  To: Tom Rini; +Cc: Simon Glass, Nikhil M Jain, u-boot, devarsht, vigneshr, nsekhar

On Thu, 4 May 2023 20:56:11 -0400
Tom Rini trini@konsulko.com wrote:
...
> > Can this be applied, please? We have rc1 out now so this should really
> > be in there by now.
> > 
> > I have another series that depends on it, and it is also pending application.  
> 
> Anatolij ?

Done. My u-boot-video pull request is pending.

--
Anatolij

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2023-05-05  8:38 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-20 12:10 [PATCH V9 00/14] Add splash screen support at u-boot SPL Nikhil M Jain
2023-04-20 12:10 ` [PATCH V9 01/14] drivers: video: Kconfig: Add configs for enabling video at SPL Nikhil M Jain
2023-04-20 12:11 ` [PATCH V9 02/14] drivers: video: tidss: Kconfig: Configs to enable TIDSS " Nikhil M Jain
2023-04-20 12:11 ` [PATCH V9 03/14] drivers: Makefile: Add rule to compile video driver Nikhil M Jain
2023-04-20 12:11 ` [PATCH V9 04/14] drivers: video: Makefile: Rule to compile necessary video driver files Nikhil M Jain
2023-04-20 12:11 ` [PATCH V9 05/14] drivers: video: tidss: Makefile: Add condition to compile TIDSS at SPL Nikhil M Jain
2023-04-20 12:11 ` [PATCH V9 06/14] common: Makefile: Add rule to compile splash and splash_source " Nikhil M Jain
2023-04-20 12:11 ` [PATCH V9 07/14] common: Kconfig: Add BMP configs Nikhil M Jain
2023-04-20 12:11 ` [PATCH V9 08/14] cmd: bmp: Split bmp commands and functions Nikhil M Jain
2023-04-20 12:11 ` [PATCH V9 09/14] common: Makefile: Rule to compile bmp.c Nikhil M Jain
2023-04-20 12:11 ` [PATCH V9 10/14] drivers: video: Enable necessary video functions at SPL Nikhil M Jain
2023-04-20 12:11 ` [PATCH V9 11/14] common: Enable splash " Nikhil M Jain
2023-04-20 12:11 ` [PATCH V9 12/14] include: Enable video related global data variable and splash " Nikhil M Jain
2023-04-20 12:11 ` [PATCH V9 13/14] board: ti: am62x: evm: OSPI support for splash screen Nikhil M Jain
2023-04-20 12:11 ` [PATCH V9 14/14] common: Replace #ifdef and #if with if's Nikhil M Jain
2023-05-05  0:40 ` [PATCH V9 00/14] Add splash screen support at u-boot SPL Simon Glass
2023-05-05  0:56   ` Tom Rini
2023-05-05  8:38     ` Anatolij Gustschin
2023-05-05  8:34   ` Anatolij Gustschin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).