From 401a3ca0fb7070ab1654dde67192037b64fe0873 Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Thu, 26 Oct 2017 11:14:44 +0800 Subject: sunxi: change the DE1 video option to CONFIG_VIDEO_SUNXI The sunxi DE1 video option used to be CONFIG_VIDEO, which has the same name as the "Enable legacy video support" option in drivers/video/Kconfig. Change the option name to CONFIG_VIDEO_SUNXI, which is really used by Makefile under drivers/video/sunxi/, and defined in sunxi-common.h when CONFIG_VIDEO is selected before this change. Now CONFIG_VIDEO_SUNXI selects CONFIG_VIDEO and the usages of CONFIG_VIDEO in sunxi Kconfig and config headers are all converted to use CONFIG_VIDEO_SUNXI. Signed-off-by: Icenowy Zheng --- include/configs/sunxi-common.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index 91751171ec2..7d86b58417e 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -268,7 +268,7 @@ extern int soft_i2c_gpio_scl; /* GPIO */ #define CONFIG_SUNXI_GPIO -#ifdef CONFIG_VIDEO +#ifdef CONFIG_VIDEO_SUNXI /* * The amount of RAM to keep free at the top of RAM when relocating u-boot, * to use as framebuffer. This must be a multiple of 4096. @@ -278,8 +278,6 @@ extern int soft_i2c_gpio_scl; /* Do we want to initialize a simple FB? */ #define CONFIG_VIDEO_DT_SIMPLEFB -#define CONFIG_VIDEO_SUNXI - #define CONFIG_VIDEO_LOGO #define CONFIG_VIDEO_STD_TIMINGS #define CONFIG_I2C_EDID @@ -288,7 +286,7 @@ extern int soft_i2c_gpio_scl; /* allow both serial and cfb console. */ /* stop x86 thinking in cfbconsole from trying to init a pc keyboard */ -#endif /* CONFIG_VIDEO */ +#endif /* CONFIG_VIDEO_SUNXI */ /* Ethernet support */ #ifdef CONFIG_SUNXI_EMAC -- cgit v1.3.1 From f6bdddc92bbbd555868067cc529275327d1ba0fa Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Thu, 26 Oct 2017 11:14:46 +0800 Subject: video: add an option for video simplefb via DT 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 DE driver uses this option, and the definition of this option in the sunxi-common.h config header is converted to an imply of this option from CONFIG_VIDEO_SUNXI. Signed-off-by: Icenowy Zheng Acked-by: Maxime Ripard --- arch/arm/mach-sunxi/Kconfig | 1 + drivers/video/Kconfig | 8 ++++++++ include/configs/sunxi-common.h | 3 --- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig index 3c29fc61f76..33869a3dde9 100644 --- a/arch/arm/mach-sunxi/Kconfig +++ b/arch/arm/mach-sunxi/Kconfig @@ -615,6 +615,7 @@ config VIDEO_SUNXI depends on !MACH_SUN9I depends on !MACH_SUN50I select VIDEO + imply VIDEO_DT_SIMPLEFB default y ---help--- Say Y here to add support for using a cfb console on the HDMI, LCD diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index e6b7f11dc9d..45a105db06a 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -650,4 +650,12 @@ config VIDEO_SIMPLE before u-boot starts, and u-boot will simply render to the pre- allocated frame buffer surface. +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 diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index 7d86b58417e..4207398eb90 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -275,9 +275,6 @@ extern int soft_i2c_gpio_scl; */ #define CONFIG_SUNXI_MAX_FB_SIZE (16 << 20) -/* Do we want to initialize a simple FB? */ -#define CONFIG_VIDEO_DT_SIMPLEFB - #define CONFIG_VIDEO_LOGO #define CONFIG_VIDEO_STD_TIMINGS #define CONFIG_I2C_EDID -- cgit v1.3.1 From fdb5525572ec7dc240ccc960888ae969253fede4 Mon Sep 17 00:00:00 2001 From: Vasily Khoruzhick Date: Wed, 20 Sep 2017 23:29:07 -0700 Subject: dm: video: bridge: add operation to read EDID Add an operation to read EDID, since bridge may have ability to read EDID from the panel that is connected to it, for example LCD<->eDP bridge. Signed-off-by: Vasily Khoruzhick --- drivers/video/bridge/video-bridge-uclass.c | 10 ++++++++++ include/video_bridge.h | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+) (limited to 'include') diff --git a/drivers/video/bridge/video-bridge-uclass.c b/drivers/video/bridge/video-bridge-uclass.c index 07270bac9eb..79facd02a68 100644 --- a/drivers/video/bridge/video-bridge-uclass.c +++ b/drivers/video/bridge/video-bridge-uclass.c @@ -8,6 +8,7 @@ #include #include #include +#include #include int video_bridge_set_backlight(struct udevice *dev, int percent) @@ -45,6 +46,15 @@ int video_bridge_check_attached(struct udevice *dev) return ops->check_attached(dev); } +int video_bridge_read_edid(struct udevice *dev, u8 *buf, int buf_size) +{ + struct video_bridge_ops *ops = video_bridge_get_ops(dev); + + if (!ops || !ops->read_edid) + return -ENOSYS; + return ops->read_edid(dev, buf, buf_size); +} + static int video_bridge_pre_probe(struct udevice *dev) { struct video_bridge_priv *uc_priv = dev_get_uclass_priv(dev); diff --git a/include/video_bridge.h b/include/video_bridge.h index c7b8681849c..0699a8dda83 100644 --- a/include/video_bridge.h +++ b/include/video_bridge.h @@ -53,6 +53,16 @@ struct video_bridge_ops { * @return 0 if OK, -ve on error */ int (*set_backlight)(struct udevice *dev, int percent); + + /** + * read_edid() - Read information from EDID + * + * @dev: Device to read from + * @buf: Buffer to read into + * @buf_size: Buffer size + * @return number of bytes read, <=0 for error + */ + int (*read_edid)(struct udevice *dev, u8 *buf, int buf_size); }; #define video_bridge_get_ops(dev) \ @@ -89,4 +99,14 @@ int video_bridge_set_active(struct udevice *dev, bool active); */ int video_bridge_check_attached(struct udevice *dev); +/** + * video_bridge_read_edid() - Read information from EDID + * + * @dev: Device to read from + * @buf: Buffer to read into + * @buf_size: Buffer size + * @return number of bytes read, <=0 for error + */ +int video_bridge_read_edid(struct udevice *dev, u8 *buf, int buf_size); + #endif -- cgit v1.3.1