From 44421e56543241b8e53914534d244d1fd89920a9 Mon Sep 17 00:00:00 2001 From: Ye Li Date: Wed, 28 Feb 2018 05:23:49 -0800 Subject: [PATCH] MLK-17638 video: imx8m_hdmi: Checks HDMI FW before enabling video output Checks whether the HDMI FW is running before initialize the HDMI display. So that for cases like mfgtool and imx-boot image without HDMI FW, the u-boot won't be blocked. Signed-off-by: Ye Li (cherry picked from commit 273b45dd3cf8773462400857c8b48b70bcfe96bb) (cherry picked from commit 5527e5674c438cd7ef7735e2bdef37668d88676b) --- arch/arm/mach-imx/imx8m/video_common.c | 7 ++++++- drivers/video/imx/imx8_hdmi.c | 9 ++++++--- include/imx8_hdmi.h | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-imx/imx8m/video_common.c b/arch/arm/mach-imx/imx8m/video_common.c index a622933..26597db 100644 --- a/arch/arm/mach-imx/imx8m/video_common.c +++ b/arch/arm/mach-imx/imx8m/video_common.c @@ -652,6 +652,7 @@ void *video_hw_init(void) { void *fb; int encoding = 1; + int ret; debug("%s()\n", __func__); @@ -676,7 +677,11 @@ void *video_hw_init(void) imx8m_create_color_bar((void *)((uint64_t) fb), &gmode); - imx8_hdmi_enable(encoding, &gmode); /* may change gmode */ + ret = imx8_hdmi_enable(encoding, &gmode); /* may change gmode */ + if (ret) { + printf("HDMI enable failed!\n"); + return NULL; + } /* start dccs */ imx8m_display_init((uint64_t) fb, encoding, &gmode); diff --git a/drivers/video/imx/imx8_hdmi.c b/drivers/video/imx/imx8_hdmi.c index ecb00f4..3d73c13 100644 --- a/drivers/video/imx/imx8_hdmi.c +++ b/drivers/video/imx/imx8_hdmi.c @@ -166,9 +166,12 @@ static int imx8_hdmi_init(int vic, cdn_api_init(); debug("CDN_API_Init completed\n"); - ret = cdn_api_checkalive_blocking(); + ret = cdn_api_checkalive(); debug("CDN_API_CheckAlive returned ret = %d\n", ret); + if (ret) + return -EPERM; + ret = cdn_api_general_test_echo_ext_blocking(echo_msg, echo_resp, sizeof(echo_msg), @@ -244,7 +247,7 @@ static int imx8_hdmi_init(int vic, return 0; } -void imx8_hdmi_enable(int encoding, +int imx8_hdmi_enable(int encoding, struct video_mode_settings *vms) { int vic = 0; @@ -261,7 +264,7 @@ void imx8_hdmi_enable(int encoding, vic = 0; /* 480p60 */ imx8_hdmi_set_vic_mode(vic, vms); - imx8_hdmi_init(vic, encoding, g_color_depth, use_phy_pixel_clk); + return imx8_hdmi_init(vic, encoding, g_color_depth, use_phy_pixel_clk); } void imx8_hdmi_disable(void) diff --git a/include/imx8_hdmi.h b/include/imx8_hdmi.h index 741f86d..eb1253c 100644 --- a/include/imx8_hdmi.h +++ b/include/imx8_hdmi.h @@ -7,7 +7,7 @@ #ifndef __IMX8_HDMI_H__ #define __IMX8_HDMI_H__ -void imx8_hdmi_enable(int encoding, struct video_mode_settings *vms); +int imx8_hdmi_enable(int encoding, struct video_mode_settings *vms); void imx8_hdmi_disable(void); #endif /* __IMX8_HDMI_H__*/ -- 1.9.1