[linux-sunxi] [PATCH v2 2/3] sunxi: Enable splash screen support

2020-06-17 Thread Jagan Teki
Enable splash screen support for sunxi platforms.

The splash screen image, sunxi.bmp would load left corner
on screen in 0,0 splash position. This is default legacy
logo position on sunxi platform and also it would be common
practice to have at 0,0 since the default sunx.bmp is nominal
size.

Signed-off-by: Jagan Teki 
---
Changes for v2:
- new patch

 include/configs/sunxi-common.h | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 5b0bec0561..308d7a42aa 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -270,6 +270,15 @@ extern int soft_i2c_gpio_scl;
 
 #endif /* CONFIG_VIDEO_SUNXI */
 
+#if CONFIG_IS_ENABLED(CMD_BMP)
+# define CONFIG_VIDEO_BMP_RLE8
+# define CONFIG_SPLASH_SCREEN
+# define CONFIG_SPLASH_SCREEN_ALIGN
+# define CONFIG_BMP_16BPP
+# define CONFIG_VIDEO_LOGO
+# define CONFIG_VIDEO_BMP_LOGO
+#endif
+
 /* Ethernet support */
 
 #ifdef CONFIG_USB_EHCI_HCD
@@ -475,6 +484,8 @@ extern int soft_i2c_gpio_scl;
 #endif
 
 #define CONSOLE_ENV_SETTINGS \
+   "splashpos=0,0\0" \
+   "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
CONSOLE_STDIN_SETTINGS \
CONSOLE_STDOUT_SETTINGS
 
-- 
2.25.1

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20200617202437.301108-3-jagan%40amarulasolutions.com.


[linux-sunxi] [PATCH v2 3/3] video: sunxi_display: Convert to DM_VIDEO

2020-06-17 Thread Jagan Teki
DM_VIDEO migration deadline is already expired, but around
80 Allwinner boards are still using video in a legacy way.

= WARNING ==
This board does not use CONFIG_DM_VIDEO Please update
the board to use CONFIG_DM_VIDEO before the v2019.07 release.
Failure to update by the deadline may result in board removal.
See doc/driver-model/migration.rst for more info.


So let's live these boards on the tree before the video maintainer
removes it by converting in to DM_VIDEO.

Tested in Bananapi M1+ Plus 1920x1200 HDMI out.

Signed-off-by: Jagan Teki 
---
Changes for v2:
- add BMP support

 arch/arm/mach-sunxi/Kconfig |   4 +-
 drivers/video/sunxi/sunxi_display.c | 264 
 include/configs/sunxi-common.h  |  17 --
 scripts/config_whitelist.txt|   1 -
 4 files changed, 157 insertions(+), 129 deletions(-)

diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index be0822bfb7..7d2fb55ff0 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -758,8 +758,10 @@ config VIDEO_SUNXI
depends on !MACH_SUN9I
depends on !MACH_SUN50I
depends on !MACH_SUN50I_H6
-   select VIDEO
+   select DM_VIDEO
+   select DISPLAY
imply VIDEO_DT_SIMPLEFB
+   imply CMD_BMP
default y
---help---
Say Y here to add support for using a cfb console on the HDMI, LCD
diff --git a/drivers/video/sunxi/sunxi_display.c 
b/drivers/video/sunxi/sunxi_display.c
index f52aba4d21..fb51b0c5ba 100644
--- a/drivers/video/sunxi/sunxi_display.c
+++ b/drivers/video/sunxi/sunxi_display.c
@@ -7,6 +7,8 @@
  */
 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -28,7 +30,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include "../videomodes.h"
 #include "../anx9804.h"
 #include "../hitachi_tx18d42vm_lcd.h"
@@ -45,6 +49,13 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+enum {
+   /* Maximum LCD size we support */
+   LCD_MAX_WIDTH   = 3840,
+   LCD_MAX_HEIGHT  = 2160,
+   LCD_MAX_LOG2_BPP= VIDEO_BPP32,
+};
+
 enum sunxi_monitor {
sunxi_monitor_none,
sunxi_monitor_dvi,
@@ -59,12 +70,11 @@ enum sunxi_monitor {
 #define SUNXI_MONITOR_LAST sunxi_monitor_composite_pal_nc
 
 struct sunxi_display {
-   GraphicDevice graphic_device;
enum sunxi_monitor monitor;
unsigned int depth;
unsigned int fb_addr;
unsigned int fb_size;
-} sunxi_display;
+};
 
 const struct ctfb_res_modes composite_video_modes[2] = {
/*  x y  hz  pixclk ps/kHz   le   ri  up  lo   hs vs  s  vmode */
@@ -214,7 +224,8 @@ static int sunxi_hdmi_edid_get_block(int block, u8 *buf)
return r;
 }
 
-static int sunxi_hdmi_edid_get_mode(struct ctfb_res_modes *mode,
+static int sunxi_hdmi_edid_get_mode(struct sunxi_display *sunxi_display,
+   struct ctfb_res_modes *mode,
bool verbose_mode)
 {
struct edid1_info edid1;
@@ -291,14 +302,14 @@ static int sunxi_hdmi_edid_get_mode(struct ctfb_res_modes 
*mode,
}
 
/* Check for basic audio support, if found enable hdmi output */
-   sunxi_display.monitor = sunxi_monitor_dvi;
+   sunxi_display->monitor = sunxi_monitor_dvi;
for (i = 0; i < ext_blocks; i++) {
if (cea681[i].extension_tag != EDID_CEA861_EXTENSION_TAG ||
cea681[i].revision < 2)
continue;
 
if (EDID_CEA861_SUPPORTS_BASIC_AUDIO(cea681[i]))
-   sunxi_display.monitor = sunxi_monitor_hdmi;
+   sunxi_display->monitor = sunxi_monitor_hdmi;
}
 
return 0;
@@ -414,9 +425,9 @@ static void sunxi_frontend_mode_set(const struct 
ctfb_res_modes *mode,
 static void sunxi_frontend_enable(void) {}
 #endif
 
-static bool sunxi_is_composite(void)
+static bool sunxi_is_composite(enum sunxi_monitor monitor)
 {
-   switch (sunxi_display.monitor) {
+   switch (monitor) {
case sunxi_monitor_none:
case sunxi_monitor_dvi:
case sunxi_monitor_hdmi:
@@ -473,7 +484,8 @@ static const u32 sunxi_rgb2yuv_coef[12] = {
 };
 
 static void sunxi_composer_mode_set(const struct ctfb_res_modes *mode,
-   unsigned int address)
+   unsigned int address,
+   enum sunxi_monitor monitor)
 {
struct sunxi_de_be_reg * const de_be =
(struct sunxi_de_be_reg *)SUNXI_DE_BE0_BASE;
@@ -502,7 +514,7 @@ static void sunxi_composer_mode_set(const struct 
ctfb_res_modes *mode,
 #endif
 SUNXI_DE_BE_MODE_INTERLACE_ENABLE);
 
-   if (sunxi_is_composite()) {
+   if (sunxi_is_composite(monitor)) {
writel(SUNXI_DE_BE_OUTPUT_COLOR_CTRL_ENABLE,
   

[linux-sunxi] [PATCH v2 1/3] logos: Add sunxi logo

2020-06-17 Thread Jagan Teki
Add sunxi logo which would be used for splash screen support.

The original images were the crapped version from linux-sunxi.org
and generated using below step

$ convert sunxi.jpg -type Palette -colors 224 -depth 8 \
-compress none -verbose BMP3:tools/logos/sunxi.bmp

Signed-off-by: Jagan Teki 
---
Changes for v2:
- new patch

 tools/logos/sunxi.bmp | Bin 0 -> 11018 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 tools/logos/sunxi.bmp

diff --git a/tools/logos/sunxi.bmp b/tools/logos/sunxi.bmp
new file mode 100644
index 
..87dfea0c4fe2c7cf805e042cb20e54c1481b02c6
GIT binary patch
literal 11018
zcmeHNduUV55+5JO$5G?a_=q7y6Jiau#u}U3P-{&>jiIrmgxW$vsv(3EN(d!2h9D6m
zkppr?5fnu94-rH}K@da~K}12sKg6pb3W|sbqWHk~>(1<+lP@Y?8^3b@xR9wiXLfdW
z=C`x6vzwr=TU-i^{xuQ6j@-ZTvkpJwU<#A}r-8lrV;t*X{J3%BVEp*;Fk!+3m^g7F
z2!a5UCQX9LlPANJDN|tT)TuCS+B6VF5vEU{4l`!VfSEIAf+R^WYt}57J$p9j^?H~y
zXAaDrI~V57n+Nmf$)c1e3`GX0sU8}{tk
z1AF)Gg?;<>!T$aG;lP0daPZ(kICSU`96o#)jvP4xM~@zbO7>xdK19$JjUSA^^041G1PB2kod+$Re4-e9;t
zYyewgxU7^1Z73pTgNzWAfDUv?e8;PQ1E{j}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S{28?`~O{1W3(*6be@){n9D@*{>Vsb?dWjRX-K45t~9F_L+ewuu*o|a!-xOT
zQ?Li3@}S)BZ>F+=RB_7rignhhJxEFWRB`H9P3w=}f~3R$&!7`oJ<*KeTVt!aDg?iD
zYfbI_$1tkgFdM3*;%$VkUo`8@dIahbs7Ih4fqDe$5vWJt|1Sdn1vprt
AKL7v#

literal 0
HcmV?d1

-- 
2.25.1

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20200617202437.301108-2-jagan%40amarulasolutions.com.


[linux-sunxi] [PATCH v2 0/3] video: sunxi: Convert DM_VIDEO

2020-06-17 Thread Jagan Teki
These series supports DM_VIDEO conversation for missing 
sunxi platforms. Separate splash screen support is required 
since the video log support in legacy drivers are not 
supporting with driver mode video.

Dependencies:
http://patchwork.ozlabs.org/project/uboot/list/?series=182476
http://patchwork.ozlabs.org/project/uboot/list/?series=182477
http://patchwork.ozlabs.org/project/uboot/list/?series=182478

Changes for v2:
- new splash screen support patches

Any inputs?
Jagan.

Jagan Teki (3):
  logos: Add sunxi logo
  sunxi: Enable splash screen support
  video: sunxi_display: Convert to DM_VIDEO

 arch/arm/mach-sunxi/Kconfig |   4 +-
 drivers/video/sunxi/sunxi_display.c | 264 
 include/configs/sunxi-common.h  |  26 ++-
 scripts/config_whitelist.txt|   1 -
 tools/logos/sunxi.bmp   | Bin 0 -> 11018 bytes
 5 files changed, 167 insertions(+), 128 deletions(-)
 create mode 100644 tools/logos/sunxi.bmp

-- 
2.25.1

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20200617202437.301108-1-jagan%40amarulasolutions.com.