Skip to contentSkip to conversation

Allwinner DE2 HDMI SimpleFB support

PATCH Superseded Icenowy Zheng 3 participants 10 messages Sep 15, 2017 – Sep 18, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v4 cover Allwinner DE2 HDMI SimpleFB support

This patchset is for Allwinner DE2 HDMI SimpleFB support.

The framebuffer initialized by the Allwinner DE2 driver can be passed by to the kernel as simplefb, and this can enable the kernel to display graphics without having full DE2 driver.

Add the suppot of simplefb in DE2 code.

The code to find a simplefb with sunxi extension and a suitable pipeline is extracted to a new source file in video/sunxi/.

An option is added for device tree simplefb, and furtherly other simplefb support code should also be converted to it.

Icenowy Zheng (3):
video: sunxi: extract simplefb match code to a new file
video: add an option for video simplefb via DT
sunxi: setup simplefb for Allwinner DE2

 arch/arm/mach-sunxi/Kconfig           |  1 +
 drivers/video/Kconfig                 |  8 ++++
 drivers/video/sunxi/Makefile          |  4 +-
 drivers/video/sunxi/simplefb_common.c | 30 +++++++++++++++
 drivers/video/sunxi/simplefb_common.h | 22 +++++++++++
 drivers/video/sunxi/sunxi_de2.c       | 72 +++++++++++++++++++++++++++++++++++
 drivers/video/sunxi/sunxi_display.c   | 13 +------
 7 files changed, 137 insertions(+), 13 deletions(-)
 create mode 100644 drivers/video/sunxi/simplefb_common.c
 create mode 100644 drivers/video/sunxi/simplefb_common.h
Signature · 1 line
2.13.5
#1 lore raw

PATCH v4 1/3 video: sunxi: extract simplefb match code to a new file

As the DE2 simplefb setup code can also benefit from the simplefb match code, extract it to a new source file.

---
Changes in v4:
- Add missing copyright for Luc.
Changes in v3:
- Use /** to start kerndoc.

 drivers/video/sunxi/Makefile          |  2 +-
 drivers/video/sunxi/simplefb_common.c | 30 ++++++++++++++++++++++++++++++
 drivers/video/sunxi/simplefb_common.h | 22 ++++++++++++++++++++++
 drivers/video/sunxi/sunxi_display.c   | 13 ++-----------
 4 files changed, 55 insertions(+), 12 deletions(-)
 create mode 100644 drivers/video/sunxi/simplefb_common.c
 create mode 100644 drivers/video/sunxi/simplefb_common.h
drivers/video/sunxi/Makefile +1 -1
index 0d64c2021f..10862edaca 100644
@@ -5,5 +5,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-obj-$(CONFIG_VIDEO_SUNXI) += sunxi_display.o lcdc.o tve_common.o ../videomodes.o
+obj-$(CONFIG_VIDEO_SUNXI) += sunxi_display.o simplefb_common.o lcdc.o tve_common.o ../videomodes.o
 obj-$(CONFIG_VIDEO_DE2) += sunxi_de2.o sunxi_dw_hdmi.o lcdc.o ../dw_hdmi.o
drivers/video/sunxi/simplefb_common.c new file +30 -0
new file mode 100644
index 0000000000..7befb736da
@@ -0,0 +1,30 @@
+/*
+ * Common code for Allwinner SimpleFB with pipeline.
+ *
+ * (C) Copyright 2013-2014 Luc Verhaegen <[email protected]>
+ * (C) Copyright 2014-2015 Hans de Goede <[email protected]>
+ * (C) Copyright 2017 Icenowy Zheng <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <fdtdec.h>
+
+int sunxi_simplefb_fdt_match(void *blob, const char *pipeline)
+{
+	int offset, ret;
+
+	/* Find a prefilled simpefb node, matching out pipeline config */
+	offset = fdt_node_offset_by_compatible(blob, -1,
+					       "allwinner,simple-framebuffer");
+	while (offset >= 0) {
+		ret = fdt_stringlist_search(blob, offset, "allwinner,pipeline",
+					    pipeline);
+		if (ret == 0)
+			break;
+		offset = fdt_node_offset_by_compatible(blob, offset,
+					       "allwinner,simple-framebuffer");
+	}
+
+	return offset;
+}
drivers/video/sunxi/simplefb_common.h new file +22 -0
new file mode 100644
index 0000000000..1a2bfabf00
@@ -0,0 +1,22 @@
+/*
+ * (C) Copyright 2017 Icenowy Zheng <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __SIMPLEFB_COMMON_H
+#define __SIMPLEFB_COMMON_H
+
+/**
+ * sunxi_simplefb_fdt_match() - match a sunxi simplefb node
+ *
+ * Match a sunxi simplefb device node with a specified pipeline, and
+ * return its offset.
+ *
+ * @blob: device tree blob
+ * @pipeline: display pipeline
+ * @return device node offset in blob, or negative values if failed
+ */
+int sunxi_simplefb_fdt_match(void *blob, const char *pipeline);
+
+#endif
drivers/video/sunxi/sunxi_display.c +2 -11
index de768ba94a..7f25ed5f26 100644
@@ -29,6 +29,7 @@
 #include "../anx9804.h"
 #include "../hitachi_tx18d42vm_lcd.h"
 #include "../ssd2828.h"
+#include "simplefb_common.h"
 
 #ifdef CONFIG_VIDEO_LCD_BL_PWM_ACTIVE_LOW
 #define PWM_ON 0
@@ -1377,17 +1378,7 @@ int sunxi_simplefb_setup(void *blob)
 		break;
 	}
 
-	/* Find a prefilled simpefb node, matching out pipeline config */
-	offset = fdt_node_offset_by_compatible(blob, -1,
-					       "allwinner,simple-framebuffer");
-	while (offset >= 0) {
-		ret = fdt_stringlist_search(blob, offset, "allwinner,pipeline",
-					    pipeline);
-		if (ret == 0)
-			break;
-		offset = fdt_node_offset_by_compatible(blob, offset,
-					       "allwinner,simple-framebuffer");
-	}
+	offset = sunxi_simplefb_fdt_match(blob, pipeline);
 	if (offset < 0) {
 		eprintf("Cannot setup simplefb: node not found\n");
 		return 0; /* Keep older kernels working */
Signature · 1 line
2.13.5
#2 lore raw

PATCH v4 2/3 video: add an option for video simplefb via DT

In reply to Icenowy Zheng

Add an option to indicate that the video driver should setup a SimpleFB node that passes the video framebuffer initialized by U-Boot to the operating system kernel.

Currently only the Allwinner DE2 driver uses this option.

---
Changes in v4:
- Remove the dependency of VIDEO_DT_SIMPLEFB.

 drivers/video/Kconfig | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/video/Kconfig +8 -0
index 082cc4a528..547d4cc0c7 100644
@@ -601,4 +601,12 @@ config VIDEO_DW_HDMI
 	  rather requires a SoC-specific glue driver to call it), it
 	  can not be enabled from the configuration menu.
 
+config VIDEO_DT_SIMPLEFB
+	bool "Enable SimpleFB support for passing framebuffer to OS"
+	help
+	  Enables the code to pass the framebuffer to the kernel as a
+	  simple framebuffer in the device tree.
+	  The video output is initialized by U-Boot, and kept by the
+	  kernel.
+
 endmenu
Signature · 1 line
2.13.5
#3 lore raw

PATCH v4 2/3 video: add an option for video simplefb via DT

Hi,

Quoted 20 lines · Icenowy Zheng

Add an option to indicate that the video driver should setup a SimpleFB node that passes the video framebuffer initialized by U-Boot to the operating system kernel.

Currently only the Allwinner DE2 driver uses this option.

---
Changes in v4:
- Remove the dependency of VIDEO_DT_SIMPLEFB.

 drivers/video/Kconfig | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/video/Kconfig +0 -0
index 082cc4a528..547d4cc0c7 100644
@@ -601,4 +601,12 @@ config VIDEO_DW_HDMI
 	  rather requires a SoC-specific glue driver to call it), it

drivers/video/Kconfig config VIDEO_DW_HDMI · line 611

Quoted 10 lines
drivers/video/Kconfig +8 -0
 	  can not be enabled from the configuration menu.
 
+config VIDEO_DT_SIMPLEFB
+	bool "Enable SimpleFB support for passing framebuffer to OS"
+	help
+	  Enables the code to pass the framebuffer to the kernel as a
+	  simple framebuffer in the device tree.
+	  The video output is initialized by U-Boot, and kept by the
+	  kernel.
+

You should also remove it from the current users. It will generate a warning otherwise.

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170918/d84a8dc0/attachment.sig>
#4 lore raw

PATCH v4 2/3 video: add an option for video simplefb via DT

于 2017年9月18日 GMT+08:00 下午3:29:06, Maxime Ripard <[email protected]> 写到:

Quoted 26 lines

Hi,

Quoted 1 line · Icenowy Zheng

Add an option to indicate that the video driver should setup a

SimpleFB

Quoted 21 lines

node that passes the video framebuffer initialized by U-Boot to the operating system kernel.

Currently only the Allwinner DE2 driver uses this option.

---
Changes in v4:
- Remove the dependency of VIDEO_DT_SIMPLEFB.

 drivers/video/Kconfig | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/video/Kconfig +0 -0
index 082cc4a528..547d4cc0c7 100644
@@ -601,4 +601,12 @@ config VIDEO_DW_HDMI
 	  rather requires a SoC-specific glue driver to call it), it
 	  can not be enabled from the configuration menu.
 
Quoted 11 lines

drivers/video/Kconfig config VIDEO_DW_HDMI · line 611

Quoted 8 lines
drivers/video/Kconfig +8 -0
+config VIDEO_DT_SIMPLEFB
+	bool "Enable SimpleFB support for passing framebuffer to OS"
+	help
+	  Enables the code to pass the framebuffer to the kernel as a
+	  simple framebuffer in the device tree.
+	  The video output is initialized by U-Boot, and kept by the
+	  kernel.
+

You should also remove it from the current users. It will generate a warning otherwise.

I think the only current user is DE1.

Should I also convert DE1 to use this option in this patch?

Quoted 2 lines

Maxime

#5 lore raw

PATCH v4 2/3 video: add an option for video simplefb via DT

Quoted 41 lines · Icenowy Zheng

于 2017年9月18日 GMT+08:00 下午3:29:06, Maxime Ripard <[email protected]> 写到:

Quoted 26 lines

Hi,

Quoted 1 line · Icenowy Zheng

Add an option to indicate that the video driver should setup a

SimpleFB

Quoted 21 lines

node that passes the video framebuffer initialized by U-Boot to the operating system kernel.

Currently only the Allwinner DE2 driver uses this option.

---
Changes in v4:
- Remove the dependency of VIDEO_DT_SIMPLEFB.

 drivers/video/Kconfig | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/video/Kconfig +0 -0
index 082cc4a528..547d4cc0c7 100644
@@ -601,4 +601,12 @@ config VIDEO_DW_HDMI
 	  rather requires a SoC-specific glue driver to call it), it
 	  can not be enabled from the configuration menu.
 
Quoted 11 lines

drivers/video/Kconfig config VIDEO_DW_HDMI · line 611

Quoted 8 lines
drivers/video/Kconfig +8 -0
+config VIDEO_DT_SIMPLEFB
+	bool "Enable SimpleFB support for passing framebuffer to OS"
+	help
+	  Enables the code to pass the framebuffer to the kernel as a
+	  simple framebuffer in the device tree.
+	  The video output is initialized by U-Boot, and kept by the
+	  kernel.
+

You should also remove it from the current users. It will generate a warning otherwise.

Quoted 1 line

I think the only current user is DE1.

I was talking about configs/sunxi-common.h

Quoted 1 line

Should I also convert DE1 to use this option in this patch?

That, or just make it a default to ARCH_SUNXI in that patch.

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170918/b615068e/attachment.sig>
#6 lore raw

PATCH v4 3/3 sunxi: setup simplefb for Allwinner DE2

In reply to Icenowy Zheng

As the support of EFI boot on Allwinner H3 is broken, we still need to use simplefb to pass the framebuffer to Linux.

Add code to setup simplefb for Allwinner DE2 driver.

---
Changes in v4:
- Imply CONFIG_VIDEO_DT_SIMPLEFB.

Changes in v3:
- Extract CONFIG_VIDEO_DT_SIMPLEFB to a Kconfig option.

Changes in v2:
- Extract the simplefb node searching code.

 arch/arm/mach-sunxi/Kconfig     |  1 +
 drivers/video/sunxi/Makefile    |  2 +-
 drivers/video/sunxi/sunxi_de2.c | 72 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 74 insertions(+), 1 deletion(-)
arch/arm/mach-sunxi/Kconfig +1 -0
index 2309f59999..6474b12b54 100644
@@ -768,6 +768,7 @@ config VIDEO_DE2
 	depends on SUNXI_DE2
 	select DM_VIDEO
 	select DISPLAY
+	imply VIDEO_DT_SIMPLEFB
 	default y
 	---help---
 	Say y here if you want to build DE2 video driver which is present on
drivers/video/sunxi/Makefile +1 -1
index 10862edaca..aec32b79b9 100644
@@ -6,4 +6,4 @@
 #
 
 obj-$(CONFIG_VIDEO_SUNXI) += sunxi_display.o simplefb_common.o lcdc.o tve_common.o ../videomodes.o
-obj-$(CONFIG_VIDEO_DE2) += sunxi_de2.o sunxi_dw_hdmi.o lcdc.o ../dw_hdmi.o
+obj-$(CONFIG_VIDEO_DE2) += sunxi_de2.o sunxi_dw_hdmi.o simplefb_common.o lcdc.o ../dw_hdmi.o
drivers/video/sunxi/sunxi_de2.c +72 -0

87 lines not on this page · raw message

Signature · 1 line
2.13.5
#7 lore raw

v4 cover Allwinner DE2 HDMI SimpleFB support

In reply to Icenowy Zheng
Quoted 6 lines · Icenowy Zheng

This patchset is for Allwinner DE2 HDMI SimpleFB support.

The framebuffer initialized by the Allwinner DE2 driver can be passed by to the kernel as simplefb, and this can enable the kernel to display graphics without having full DE2 driver.

Quoted 7 lines

Add the suppot of simplefb in DE2 code.

The code to find a simplefb with sunxi extension and a suitable pipeline is extracted to a new source file in video/sunxi/.

An option is added for device tree simplefb, and furtherly other simplefb support code should also be converted to it.

There was a generic simplefb driver recently added [1], is it worth basing it on that?

[1] https://lists.denx.de/pipermail/u-boot/2017-September/306273.html

#8 lore raw

v4 cover Allwinner DE2 HDMI SimpleFB support

Quoted 12 lines · Peter Robinson
Quoted 11 lines · Icenowy Zheng

This patchset is for Allwinner DE2 HDMI SimpleFB support.

The framebuffer initialized by the Allwinner DE2 driver can be passed by to the kernel as simplefb, and this can enable the kernel to display graphics without having full DE2 driver.

Add the suppot of simplefb in DE2 code.

The code to find a simplefb with sunxi extension and a suitable pipeline is extracted to a new source file in video/sunxi/.

Quoted 7 lines
Quoted 2 lines

An option is added for device tree simplefb, and furtherly other simplefb support code should also be converted to it.

There was a generic simplefb driver recently added [1], is it worth basing it on that?

[1] https://lists.denx.de/pipermail/u-boot/2017-September/306273.html

This is a simplefb "client", it uses a display that has already been initialized. What Icenowy is working on is a "provider", ie it initializes the display in order for other components to reuse it (Linux).

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170915/e50d9d2d/attachment.sig>
#9 lore raw

v4 cover Allwinner DE2 HDMI SimpleFB support

Quoted 20 lines · 在 2017-09-15 21:35,Maxime Ripard 写道:
Quoted 19 lines · Peter Robinson
Quoted 6 lines · Icenowy Zheng

This patchset is for Allwinner DE2 HDMI SimpleFB support.

The framebuffer initialized by the Allwinner DE2 driver can be passed by to the kernel as simplefb, and this can enable the kernel to display graphics without having full DE2 driver.

Quoted 7 lines

Add the suppot of simplefb in DE2 code.

The code to find a simplefb with sunxi extension and a suitable pipeline is extracted to a new source file in video/sunxi/.

An option is added for device tree simplefb, and furtherly other simplefb support code should also be converted to it.

There was a generic simplefb driver recently added [1], is it worth basing it on that?

Quoted 6 lines
Quoted 1 line

[1] https://lists.denx.de/pipermail/u-boot/2017-September/306273.html

This is a simplefb "client", it uses a display that has already been initialized. What Icenowy is working on is a "provider", ie it initializes the display in order for other components to reuse it (Linux).

As I know, now FreeBSD and NetBSD are also going to use the simplefb.

Quoted 2 lines

Maxime