}
#endif
+/* #define HDMI_SEND_ALL_PKT */
+static u32 last_dst_format = FORMAT_SDR;
static bool send_hdmi_pkt(
enum signal_format_e dst_format,
const struct vinfo_s *vinfo)
if (vinfo && vinfo->vout_device &&
vinfo->vout_device->fresh_tx_hdr_pkt)
vinfo->vout_device->fresh_tx_hdr_pkt(&hdr10_data);
+#ifdef HDMI_SEND_ALL_PKT
if (vinfo && vinfo->vout_device &&
vinfo->vout_device->fresh_tx_vsif_pkt)
vinfo->vout_device->fresh_tx_vsif_pkt(0, 0, NULL);
-
+#endif
+ last_dst_format = dst_format;
if (flag) {
pr_dolby_dbg("Info frame for hdr10 changed:\n");
for (i = 0; i < 3; i++)
memset(&vsif, 0, sizeof(vsif));
#ifdef V2_4
- if (vinfo)
- prepare_vsif_pkt(
- &vsif, &dovi_setting, vinfo);
+ if (vinfo)
+ prepare_vsif_pkt(
+ &vsif, &dovi_setting, vinfo);
#endif
+#ifdef HDMI_SEND_ALL_PKT
hdr10_data.features =
(1 << 29) /* video available */
| (5 << 26) /* unspecified */
if (vinfo && vinfo->vout_device &&
vinfo->vout_device->fresh_tx_hdr_pkt)
vinfo->vout_device->fresh_tx_hdr_pkt(&hdr10_data);
+#endif
if (vinfo && vinfo->vout_device &&
vinfo->vout_device->fresh_tx_vsif_pkt) {
#ifdef V2_4
DOLBY_VISION_OUTPUT_MODE_IPT_TUNNEL
? RGB_8BIT : YUV422_BIT12, &vsif);
}
- } else {
- hdr10_data.features =
- (1 << 29) /* video available */
- | (5 << 26) /* unspecified */
- | (0 << 25) /* limit */
- | (1 << 24) /* color available */
- | (1 << 16) /* bt709 */
- | (1 << 8) /* bt709 */
- | (1 << 0); /* bt709 */
- for (i = 0; i < 3; i++) {
- hdr10_data.primaries[i][0] = 0;
- hdr10_data.primaries[i][1] = 0;
+ last_dst_format = dst_format;
+ } else if (last_dst_format != dst_format) {
+ if (last_dst_format == FORMAT_HDR10) {
+ hdr10_data.features =
+ (1 << 29) /* video available */
+ | (5 << 26) /* unspecified */
+ | (0 << 25) /* limit */
+ | (1 << 24) /* color available */
+ | (1 << 16) /* bt709 */
+ | (1 << 8) /* bt709 */
+ | (1 << 0); /* bt709 */
+ for (i = 0; i < 3; i++) {
+ hdr10_data.primaries[i][0] = 0;
+ hdr10_data.primaries[i][1] = 0;
+ }
+ hdr10_data.white_point[0] = 0;
+ hdr10_data.white_point[1] = 0;
+ hdr10_data.luminance[0] = 0;
+ hdr10_data.luminance[1] = 0;
+ hdr10_data.max_content = 0;
+ hdr10_data.max_frame_average = 0;
+ if (vinfo && vinfo->vout_device &&
+ vinfo->vout_device->fresh_tx_hdr_pkt)
+ vinfo->vout_device->fresh_tx_hdr_pkt(
+ &hdr10_data);
+ } else if (last_dst_format == FORMAT_DOVI) {
+ if (vinfo && vinfo->vout_device &&
+ vinfo->vout_device->fresh_tx_vsif_pkt)
+ vinfo->vout_device->fresh_tx_vsif_pkt(
+ 0, 0, NULL);
}
- hdr10_data.white_point[0] = 0;
- hdr10_data.white_point[1] = 0;
- hdr10_data.luminance[0] = 0;
- hdr10_data.luminance[1] = 0;
- hdr10_data.max_content = 0;
- hdr10_data.max_frame_average = 0;
- if (vinfo && vinfo->vout_device &&
- vinfo->vout_device->fresh_tx_hdr_pkt)
- vinfo->vout_device->fresh_tx_hdr_pkt(&hdr10_data);
- if (vinfo && vinfo->vout_device &&
- vinfo->vout_device->fresh_tx_vsif_pkt)
- vinfo->vout_device->fresh_tx_vsif_pkt(0, 0, NULL);
+ last_dst_format = dst_format;
}
return flag;
}
VEN_DB1[4] = 0x4;
}
if (type == EOTF_T_DOLBYVISION) {
+ /*first disable drm package*/
+ hdmitx_device.HWOp.SetPacket(HDMI_PACKET_DRM,
+ NULL, NULL);
hdev->HWOp.SetPacket(HDMI_PACKET_VEND, VEN_DB1, VEN_HB);
hdev->HWOp.CntlConfig(hdev, CONF_AVI_BT2020,
CLR_AVI_BT2020);/*BT709*/
/*Dolby Vision standard case*/
if (type == EOTF_T_DOLBYVISION) {
+ /*first disable drm package*/
+ hdmitx_device.HWOp.SetPacket(HDMI_PACKET_DRM,
+ NULL, NULL);
hdev->HWOp.SetPacket(HDMI_PACKET_VEND, VEN_DB2, VEN_HB);
hdev->HWOp.CntlConfig(hdev, CONF_AVI_BT2020,
CLR_AVI_BT2020);/*BT709*/
}
/*Dolby Vision low-latency case*/
else if (type == EOTF_T_LL_MODE) {
+ /*first disable drm package*/
+ hdmitx_device.HWOp.SetPacket(HDMI_PACKET_DRM,
+ NULL, NULL);
hdev->HWOp.SetPacket(HDMI_PACKET_VEND, VEN_DB2, VEN_HB);
if (hdev->RXCap.colorimetry_data & 0xe0)
/*if RX support BT2020, then output BT2020*/
hdmitx_set_reg_bits(HDMITX_DWC_FC_PACKET_TX_EN, 0, 7, 1);
}
+ /* If RX support 3D, then enable 3D send out */
+ if (hdev->flag_3dfp || hdev->flag_3dtb || hdev->flag_3dss) {
+ hdmitx_set_reg_bits(HDMITX_DWC_FC_DATAUTO0, 1, 3, 1);
+ hdmitx_set_reg_bits(HDMITX_DWC_FC_PACKET_TX_EN, 1, 4, 1);
+ } else {
+ /* after changing mode, dv will call vsif function again*/
+ hdmitx_set_reg_bits(HDMITX_DWC_FC_DATAUTO0, 0, 3, 1);
+ hdmitx_set_reg_bits(HDMITX_DWC_FC_PACKET_TX_EN, 0, 4, 1);
+ }
+
hdmitx_wr_reg(HDMITX_DWC_FC_RDRB0, 0);
hdmitx_wr_reg(HDMITX_DWC_FC_RDRB1, 0);
hdmitx_wr_reg(HDMITX_DWC_FC_RDRB2, 0);