From a6eedb670d56fe0d8784f2f5737077d79d96a4e5 Mon Sep 17 00:00:00 2001 From: Igor Opaniuk Date: Mon, 10 Jun 2019 14:47:49 +0300 Subject: video: fsl_dcu_fb: refactor init functions Move dcu-related code to fsl_dcu_probe_common, keep in video_hw_init() only legacy video stack (filling GraphicPanel struct etc.). Add wrappers for all init functions, that will let to provide struct fb_info as an additional param (needed for further moving it from the global scope to driver private data struct in DM converted driver). Signed-off-by: Igor Opaniuk Reviewed-by: Oleksandr Suvorov --- include/fsl_dcu_fb.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/fsl_dcu_fb.h b/include/fsl_dcu_fb.h index 2dd5f54c3e0..7a5347a9247 100644 --- a/include/fsl_dcu_fb.h +++ b/include/fsl_dcu_fb.h @@ -6,11 +6,17 @@ */ #include -int fsl_dcu_init(unsigned int xres, unsigned int yres, +int fsl_dcu_init(struct fb_info *fbinfo, + unsigned int xres, + unsigned int yres, unsigned int pixel_format); + int fsl_dcu_fixedfb_setup(void *blob); /* Prototypes for external board-specific functions */ -int platform_dcu_init(unsigned int xres, unsigned int yres, - const char *port, struct fb_videomode *dcu_fb_videomode); +int platform_dcu_init(struct fb_info *fbinfo, + unsigned int xres, + unsigned int yres, + const char *port, + struct fb_videomode *dcu_fb_videomode); unsigned int dcu_set_pixel_clock(unsigned int pixclock); -- cgit v1.2.3 From 9de5eb23dc7972b9e382327b9a485335b24d3b4a Mon Sep 17 00:00:00 2001 From: Igor Opaniuk Date: Wed, 19 Jun 2019 11:47:08 +0300 Subject: colibri-imx6ull: support building with DM_VIDEO=y 1. This fixes linking issues when building with DM_VIDEO enabled mxsfb driver. 2. Provide proper defines for both VIDEO=y and DM_VIDEO=y. Signed-off-by: Igor Opaniuk Reviewed-by: Oleksandr Suvorov --- include/configs/colibri-imx6ull.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/configs/colibri-imx6ull.h b/include/configs/colibri-imx6ull.h index 2c43862800a..05af222a1fa 100644 --- a/include/configs/colibri-imx6ull.h +++ b/include/configs/colibri-imx6ull.h @@ -170,7 +170,7 @@ #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_16M #define DFU_DEFAULT_POLL_TIMEOUT 300 -#ifdef CONFIG_VIDEO +#if defined(CONFIG_VIDEO) || defined(CONFIG_DM_VIDEO) #define CONFIG_VIDEO_MXS #define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR #define CONFIG_VIDEO_LOGO -- cgit v1.2.3 From 1c1ed441b0d1d7d5fbf02cf89a390c04b18f8ba3 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Thu, 4 Jul 2019 15:52:06 +0200 Subject: edid: add edid_get_timing_validate() variant to filter out edid modes The original edid_get_timing() function returns the first valid timing, but on some plaforms, we could only supports a subset of the listed monitot's navite timing. Let's introduce a edid_get_timing_validate() adding a mode_valid callback including a private cookie pointer. If the callback returns false, the current timing is discared and the next one is checked. If no valid & supported timings are found, the function would return an error. Signed-off-by: Neil Armstrong --- include/edid.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'include') diff --git a/include/edid.h b/include/edid.h index f05d2b82f24..2562733061c 100644 --- a/include/edid.h +++ b/include/edid.h @@ -306,6 +306,28 @@ int edid_get_ranges(struct edid1_info *edid, unsigned int *hmin, struct display_timing; +/** + * edid_get_timing_validate() - Get basic digital display parameters with + * mode selection callback + * + * @param buf Buffer containing EDID data + * @param buf_size Size of buffer in bytes + * @param timing Place to put preferring timing information + * @param panel_bits_per_colourp Place to put the number of bits per + * colour supported by the panel. This will be set to + * -1 if not available + * @param mode_valid Callback validating mode, returning true is mode is + * supported, false otherwise. + * @parem valid_priv Pointer to private data for mode_valid callback + * @return 0 if timings are OK, -ve on error + */ +int edid_get_timing_validate(u8 *buf, int buf_size, + struct display_timing *timing, + int *panel_bits_per_colourp, + bool (*mode_valid)(void *priv, + const struct display_timing *timing), + void *mode_valid_priv); + /** * edid_get_timing() - Get basic digital display parameters * -- cgit v1.2.3 From eb4ee4e436287a69de7a87ea3070fa52bd327602 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Thu, 4 Jul 2019 15:52:07 +0200 Subject: video: display: use edid_get_timing_validate() variant to filter supported EDID modes Introduce a new display op, mode_valid() to be used with the newly introduced edid_get_timing_validate() function, to filter supported monitor timings if handled by the display driver. Signed-off-by: Neil Armstrong --- include/display.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/display.h b/include/display.h index 16f317c9c8c..66294616ea2 100644 --- a/include/display.h +++ b/include/display.h @@ -80,6 +80,16 @@ struct dm_display_ops { */ int (*enable)(struct udevice *dev, int panel_bpp, const struct display_timing *timing); + + /** + * mode_valid() - Check if mode is supported + * + * @dev: Device to enable + * @timing: Display timings + * @return true if supported, false if not + */ + bool (*mode_valid)(struct udevice *dev, + const struct display_timing *timing); }; #define display_get_ops(dev) ((struct dm_display_ops *)(dev)->driver->ops) -- cgit v1.2.3 From 60a62acfb07afb0815f28abe6f49a9b906a7c3f4 Mon Sep 17 00:00:00 2001 From: Niklas Schulze Date: Sat, 27 Jul 2019 12:07:13 +0000 Subject: video: dw_hdmi: Add support for ddc-i2c-bus property Add support for the ddc-i2c-bus device tree property which allows for using an external i2c master for reading the display's EDID. Signed-off-by: Niklas Schulze --- include/dw_hdmi.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/dw_hdmi.h b/include/dw_hdmi.h index 90fb64bc998..8acae3839fb 100644 --- a/include/dw_hdmi.h +++ b/include/dw_hdmi.h @@ -542,6 +542,7 @@ struct dw_hdmi { u8 i2c_clk_low; u8 reg_io_width; struct hdmi_data_info hdmi_data; + struct udevice *ddc_bus; int (*phy_set)(struct dw_hdmi *hdmi, uint mpixelclock); void (*write_reg)(struct dw_hdmi *hdmi, u8 val, int offset); -- cgit v1.2.3