hdmitx: update edid attach after reading once [1/1]

PD#SWPL-17476

Problem:
After kernel boots up, there will no edid info for vinfo

Solution:
Need update edid attach after reading once
In kernel init, hdmitx / vout / edid with attach once time
Normal replug, plugin / edid / uevent / mode setting / attach
Also, init DRM_DB[0] data.

Verify:
G12/U212

Change-Id: I188f0972c882a17efcbc568ef7d0db861b9b6c0a
Signed-off-by: Zongdong Jiao <zongdong.jiao@amlogic.com>
This commit is contained in:
Zongdong Jiao
2019-11-25 22:10:13 +08:00
committed by Luke Go
parent d9a5cf0a56
commit 022ced4b3d
3 changed files with 21 additions and 1 deletions

View File

@@ -1357,6 +1357,17 @@ static void hdr_work_func(struct work_struct *work)
pr_info("%s[%d]\n", __func__, __LINE__); \
} while (0)
/* Init DRM_DB[0] from Uboot status */
static void init_drm_db0(struct hdmitx_dev *hdev, unsigned char *dat)
{
static int once_flag = 1;
if (once_flag) {
once_flag = 0;
*dat = hdev->hwop.getstate(hdev, STAT_HDR_TYPE, 0);
}
}
#define GET_LOW8BIT(a) ((a) & 0xff)
#define GET_HIGH8BIT(a) (((a) >> 8) & 0xff)
static void hdmitx_set_drm_pkt(struct master_display_info_s *data)
@@ -1366,6 +1377,7 @@ static void hdmitx_set_drm_pkt(struct master_display_info_s *data)
static unsigned char DRM_DB[26] = {0x0};
hdmi_debug();
init_drm_db0(hdev, &DRM_DB[0]);
if (hdr_status_pos == 4) {
/* zero hdr10+ VSIF being sent - disable it */
pr_info("hdmitx_set_drm_pkt: disable hdr10+ zero vsif\n");
@@ -4271,6 +4283,7 @@ static int hdmitx_notify_callback_a(struct notifier_block *block,
static void hdmitx_get_edid(struct hdmitx_dev *hdev)
{
static int once_flag = 1;
mutex_lock(&getedid_mutex);
/* TODO hdmitx_edid_ram_buffer_clear(hdev); */
hdev->hwop.cntlddc(hdev, DDC_RESET_EDID, 0);
@@ -4295,7 +4308,10 @@ static void hdmitx_get_edid(struct hdmitx_dev *hdev)
memset(dv, 0, sizeof(struct dv_info));
pr_info("clear dv_info\n");
}
if (once_flag) {
once_flag = 0;
edidinfo_attach_to_vinfo(hdev);
}
mutex_unlock(&getedid_mutex);
}

View File

@@ -5414,6 +5414,8 @@ static int hdmitx_get_state(struct hdmitx_dev *hdev, unsigned int cmd,
return (int)get_vic_from_pkt();
case STAT_VIDEO_CLK:
break;
case STAT_HDR_TYPE:
return hdmitx_rd_reg(HDMITX_DWC_FC_DRM_PB00) & 0xff;
default:
break;
}

View File

@@ -610,6 +610,8 @@ struct hdmitx_dev {
#define STAT_AUDIO_CHANNEL (CMD_STAT_OFFSET + 0x11)
#define STAT_AUDIO_CLK_STABLE (CMD_STAT_OFFSET + 0x12)
#define STAT_AUDIO_PACK (CMD_STAT_OFFSET + 0x13)
#define STAT_HDR_TYPE (CMD_STAT_OFFSET + 0x20)
/* HDMI LOG */
#define HDMI_LOG_HDCP (1 << 0)