hdmitx21: modify send allm vsif method [1/1]

PD#SWPL-159832

Problem:
VSIF send bytes wrong

Solution:
hdmitx21 requires software calculation,
Valid values need to be filled starting from db[1]

Verify:
s7_bh201

Test:
DRM-TX-30, DRM-TX-78, DRM-TX-79, DRM-TX-80, DRM-TX-81

Change-Id: I62d32a0dc6c73b788ad56aaec35277d2447ee7a6
Signed-off-by: xiang.wu1 <xiang.wu1@amlogic.com>
This commit is contained in:
xiang.wu1
2024-03-12 15:53:31 +08:00
committed by Luan Yuan
parent 6b33422b11
commit afc1bd643a
2 changed files with 26 additions and 8 deletions
+22 -5
View File
@@ -640,11 +640,28 @@ static int hdmitx21_calc_formatpara(struct hdmitx_hw_common *tx_hw,
static void hdmitx_set_packet(int type,
unsigned char *DB, unsigned char *HB)
{
if (type == HDMI_INFOFRAME_TYPE_VENDOR2)
hdmi_vend_infoframe2_rawset(HB, DB);
else if (type == HDMI_INFOFRAME_TYPE_VENDOR)
hdmi_vend_infoframe_rawset(HB, DB);
/* add other type here if needed */
unsigned char vsif_db[28] = {0};
switch (type) {
case HDMI_INFOFRAME_TYPE_VENDOR:
case HDMI_INFOFRAME_TYPE_VENDOR2:
if (!HB || !DB) {
if (type == HDMI_INFOFRAME_TYPE_VENDOR2)
hdmi_vend_infoframe2_rawset(NULL, NULL);
else
hdmi_vend_infoframe_rawset(NULL, NULL);
return;
}
/* vsif_db[0] is checksum, requires software calculation */
memcpy(&vsif_db[1], DB, 27);
if (type == HDMI_INFOFRAME_TYPE_VENDOR2)
hdmi_vend_infoframe2_rawset(HB, vsif_db);
else
hdmi_vend_infoframe_rawset(HB, vsif_db);
break;
default:
break;
}
}
/* note: if need to check if global_tx_hw not NULL before use it
@@ -12,7 +12,8 @@ int hdmitx_common_setup_vsif_packet(struct hdmitx_common *tx_comm,
u8 hb[3] = {0x81, 0x1, 0};
u8 len = 0; /* hb[2] = len */
u8 vsif_db[28] = {0}; /* to be fulfilled */
u8 *db = &vsif_db[1]; /* to be fulfilled */
/* transmission usage, excluding checksum */
u8 *db = &vsif_db[1];
u32 ieeeoui = 0;
u32 vic = 0;
struct hdmitx_hw_common *tx_hw = tx_comm->tx_hw;
@@ -35,7 +36,7 @@ int hdmitx_common_setup_vsif_packet(struct hdmitx_common *tx_comm,
db[4] = vic & 0xf;
db[3] = 0x20;
hdmitx_hw_cntl_config(tx_hw, CONF_AVI_VIC, 0);
hdmitx_hw_set_packet(tx_hw, HDMI_INFOFRAME_TYPE_VENDOR, vsif_db, hb);
hdmitx_hw_set_packet(tx_hw, HDMI_INFOFRAME_TYPE_VENDOR, db, hb);
} else {
HDMITX_INFO("skip vsif for non-4k mode.\n");
return -EINVAL;
@@ -54,7 +55,7 @@ int hdmitx_common_setup_vsif_packet(struct hdmitx_common *tx_comm,
/*reset vic which may be reset by VT_HDMI14_4K.*/
if (hdmitx_edid_get_hdmi14_4k_vic(tx_comm->fmt_para.vic) > 0)
hdmitx_hw_cntl_config(tx_hw, CONF_AVI_VIC, tx_comm->fmt_para.vic);
hdmitx_hw_set_packet(tx_hw, HDMI_INFOFRAME_TYPE_VENDOR2, vsif_db, hb);
hdmitx_hw_set_packet(tx_hw, HDMI_INFOFRAME_TYPE_VENDOR2, db, hb);
} else {
db[4] &= ~(1 << 1); /* clear bit1, ALLM_MODE */
/* 1.When the Source stops transmitting the HF-VSIF,