diff --git a/drivers/media/vout/hdmitx21/hw/hdmi_tx_hw.c b/drivers/media/vout/hdmitx21/hw/hdmi_tx_hw.c index 8d461044f..4ad13d0c4 100644 --- a/drivers/media/vout/hdmitx21/hw/hdmi_tx_hw.c +++ b/drivers/media/vout/hdmitx21/hw/hdmi_tx_hw.c @@ -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 diff --git a/drivers/media/vout/hdmitx_common/hdmitx_packet.c b/drivers/media/vout/hdmitx_common/hdmitx_packet.c index 5a1fa0edf..338c7ca91 100644 --- a/drivers/media/vout/hdmitx_common/hdmitx_packet.c +++ b/drivers/media/vout/hdmitx_common/hdmitx_packet.c @@ -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,