mirror of
https://github.com/hardkernel/kernel_common_drivers.git
synced 2026-06-25 12:03:48 +09:00
hdmirx: support iMax mode [1/1]
PD#SWPL-137268 Problem: not support iMax mode Solution: parse iMax flag from VSIF packet Verify: T5W Change-Id: I3b1c52f132e47d825cf086473c6c60af44c5045f Signed-off-by: Gaowei Zhao <gaowei.zhao@amlogic.com>
This commit is contained in:
committed by
gerrit autosubmit
parent
6f2428f6c4
commit
0bfa23f2f7
@@ -1159,6 +1159,7 @@ void hdmirx_get_vsi_info(struct tvin_sig_property_s *prop, u8 port)
|
||||
prop->hdr10p_info.hdr10p_on = false;
|
||||
prop->cuva_info.cuva_on = false;
|
||||
prop->filmmaker.fmm_vsif_flag = false;
|
||||
prop->imax_flag = false;
|
||||
last_vsi_state = rx[port].vs_info_details.vsi_state;
|
||||
}
|
||||
if (rx[port].pre.colorspace != E_COLOR_YUV420)
|
||||
@@ -1175,6 +1176,8 @@ void hdmirx_get_vsi_info(struct tvin_sig_property_s *prop, u8 port)
|
||||
rx[port].vs_info_details.vsi_state = E_VSI_CUVAHDR;
|
||||
else if (rx[port].vs_info_details.vsi_state & E_VSI_FILMMAKER)
|
||||
rx[port].vs_info_details.vsi_state = E_VSI_FILMMAKER;
|
||||
else if (rx[port].vs_info_details.vsi_state & E_VSI_IMAX)
|
||||
rx[port].vs_info_details.vsi_state = E_VSI_IMAX;
|
||||
else if (rx[port].vs_info_details.vsi_state & E_VSI_VSI21)
|
||||
rx[port].vs_info_details.vsi_state = E_VSI_VSI21;
|
||||
else
|
||||
@@ -1219,6 +1222,10 @@ void hdmirx_get_vsi_info(struct tvin_sig_property_s *prop, u8 port)
|
||||
sizeof(struct tvin_fmm_data_s) - 3);
|
||||
}
|
||||
break;
|
||||
case E_VSI_IMAX:
|
||||
if (rx[port].vs_info_details.imax)
|
||||
prop->imax_flag = true;
|
||||
break;
|
||||
case E_VSI_4K3D:
|
||||
if (hdmirx_hw_get_3d_structure(port) == 1) {
|
||||
if (rx[port].vs_info_details._3d_structure == 0x1) {
|
||||
|
||||
@@ -593,8 +593,9 @@ struct vsi_info_s {
|
||||
bool hdr10plus;
|
||||
bool cuva_hdr;
|
||||
bool filmmaker;
|
||||
bool imax;
|
||||
u8 ccbpc;
|
||||
u8 vsi_state; // bit0-6: 4K3D/VSI21/HDR10+/DV10/DV15/CUVA/filmmaker
|
||||
u8 vsi_state; // bit0-6: 4K3D/VSI21/HDR10+/DV10/DV15/CUVA/filmmaker/imax
|
||||
u8 emp_pkt_cnt;
|
||||
u8 timeout;
|
||||
u8 max_frl_rate;
|
||||
|
||||
@@ -1216,6 +1216,8 @@ void rx_get_vsi_info(u8 port)
|
||||
rx[port].vs_info_details.hdr10plus = false;
|
||||
rx[port].vs_info_details.cuva_hdr = false;
|
||||
rx[port].vs_info_details.filmmaker = false;
|
||||
rx[port].vs_info_details.imax = false;
|
||||
|
||||
if (!emp_info_p) {
|
||||
rx_pr("%s emp info null\n", __func__);
|
||||
return;
|
||||
@@ -1288,6 +1290,14 @@ void rx_get_vsi_info(u8 port)
|
||||
if (log_level & PACKET_LOG)
|
||||
rx_pr("vsi filmmaker pkt err\n");
|
||||
rx[port].vs_info_details.filmmaker = true;
|
||||
} else if (pkt->ieee == IEEE_IMAX) {
|
||||
if (pkt->length != E_PKT_LENGTH_5 ||
|
||||
pkt->ver_st.version != 0x01 ||
|
||||
pkt->sbpkt.vsi_st.data[0] != 0x01 ||
|
||||
pkt->sbpkt.payload.data[1] != 0x01)
|
||||
if (log_level & PACKET_LOG)
|
||||
rx_pr("vsi imax pkt err\n");
|
||||
rx[port].vs_info_details.imax = true;
|
||||
}
|
||||
|
||||
if (pkt->ieee == IEEE_VSI14) {
|
||||
@@ -1835,6 +1845,11 @@ int rx_pkt_fifodecode(struct packet_info_s *prx,
|
||||
sizeof(struct pd_infoframe_s));
|
||||
rx[port].vs_info_details.vsi_state |= E_VSI_FILMMAKER;
|
||||
break;
|
||||
case IEEE_IMAX:
|
||||
memcpy(&prx->multi_vs_info[IMAX], pktdata,
|
||||
sizeof(struct pd_infoframe_s));
|
||||
rx[port].vs_info_details.vsi_state |= E_VSI_IMAX;
|
||||
break;
|
||||
case IEEE_VSI21:
|
||||
memcpy(&prx->multi_vs_info[VSI21], pktdata,
|
||||
sizeof(struct pd_infoframe_s));
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#define IEEE_HDR10PLUS 0x90848b
|
||||
#define IEEE_CUVAHDR 0x047503
|
||||
#define IEEE_FILMMAKER 0x1ABBFB
|
||||
#define IEEE_IMAX 0xDA4162
|
||||
#define IEEE_DV_PLUS_ALLM 0x1
|
||||
#define IEEE_HDR10P_PLUS_ALLM 0x2
|
||||
|
||||
@@ -49,6 +50,7 @@ enum vsi_state_e {
|
||||
E_VSI_DV15 = 0x10,
|
||||
E_VSI_CUVAHDR = 0x20,
|
||||
E_VSI_FILMMAKER = 0x40,
|
||||
E_VSI_IMAX = 0x80,
|
||||
};
|
||||
|
||||
enum vsi_type {
|
||||
@@ -56,6 +58,7 @@ enum vsi_type {
|
||||
CUVAHDR,
|
||||
HDR10PLUS,
|
||||
FILMMAKER,
|
||||
IMAX,
|
||||
VSI21,
|
||||
VSI14,
|
||||
VSI_TYPE_MAX
|
||||
@@ -760,6 +763,16 @@ struct vsi_infoframe_st {
|
||||
/*pb5*/
|
||||
u8 content_subtype:8;
|
||||
} __packed vsi_filmmaker;
|
||||
|
||||
/* imax ieee 0xDA4162 */
|
||||
struct vsi_imax {
|
||||
/*pb4*/
|
||||
u8 usage_code:4;
|
||||
u8 entry_size:4;
|
||||
/*pb5*/
|
||||
u8 entry_data:8;
|
||||
} __packed vsi_imax;
|
||||
|
||||
} __packed sbpkt;
|
||||
} __packed;
|
||||
|
||||
|
||||
@@ -7508,6 +7508,8 @@ void dump_video_status(u8 port)
|
||||
rx_pr("dolby_vision = %d\n", rx[port].vs_info_details.dolby_vision_flag);
|
||||
rx_pr("dv ll = %d\n", rx[port].vs_info_details.low_latency);
|
||||
rx_pr("cuva hdr = %d\n", rx[port].vs_info_details.cuva_hdr);
|
||||
rx_pr("filmmaker = %d\n", rx[port].vs_info_details.filmmaker);
|
||||
rx_pr("iMax = %d\n", rx[port].vs_info_details.imax);
|
||||
//rx_pr("VTEM = %d\n", rx[port_idx].vrr_en);
|
||||
rx_pr("DRM = %d\n", rx_pkt_chk_attach_drm(port));
|
||||
rx_pr("freesync = %d\n-bit0 supported,bit1:enabled.bit2:active",
|
||||
|
||||
@@ -573,6 +573,7 @@ struct tvin_sig_property_s {
|
||||
unsigned int skip_vf_num;/*skip pre vframe num*/
|
||||
struct tvin_latency_s latency;
|
||||
struct tvin_fmm_s filmmaker;
|
||||
bool imax_flag;
|
||||
struct tvin_hdr10plus_info_s hdr10p_info;
|
||||
struct tvin_emp_data_s emp_data;
|
||||
struct tvin_vtem_data_s vtem_data;
|
||||
|
||||
@@ -6406,7 +6406,8 @@ void vdin_vs_proc_monitor(struct vdin_dev_s *devp)
|
||||
if (devp->prop.latency.allm_mode != devp->pre_prop.latency.allm_mode ||
|
||||
devp->prop.latency.it_content != devp->pre_prop.latency.it_content ||
|
||||
devp->prop.latency.cn_type != devp->pre_prop.latency.cn_type ||
|
||||
devp->prop.filmmaker.fmm_flag != devp->pre_prop.filmmaker.fmm_flag)
|
||||
devp->prop.filmmaker.fmm_flag != devp->pre_prop.filmmaker.fmm_flag ||
|
||||
devp->prop.imax_flag != devp->pre_prop.imax_flag)
|
||||
devp->dv.allm_chg_cnt++;
|
||||
else
|
||||
devp->dv.allm_chg_cnt = 0;
|
||||
|
||||
@@ -1930,8 +1930,9 @@ static void vdin_dump_state(struct vdin_dev_s *devp)
|
||||
devp->dv.dv_flag, devp->dv.dv_config, devp->prop.dolby_vision,
|
||||
devp->dv.low_latency, devp->prop.low_latency,
|
||||
devp->vfp->low_latency, devp->pre_prop.latency.allm_mode);
|
||||
pr_info("fmm_flag:%d, fmm_vsif_flag:%d\n",
|
||||
devp->prop.filmmaker.fmm_flag, devp->prop.filmmaker.fmm_vsif_flag);
|
||||
pr_info("fmm_flag:%d, fmm_vsif_flag:%d imax_flag:%d\n",
|
||||
devp->prop.filmmaker.fmm_flag, devp->prop.filmmaker.fmm_vsif_flag,
|
||||
devp->prop.imax_flag);
|
||||
pr_info("dv emp size:%d crc_flag:%d\n", devp->prop.emp_data.size,
|
||||
devp->dv.dv_crc_check);
|
||||
pr_info("size of struct vdin_dev_s: %d\n", devp->vdin_dev_ssize);
|
||||
|
||||
@@ -4705,6 +4705,19 @@ static long vdin_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
devp->prop.latency.it_content,
|
||||
devp->prop.latency.cn_type);
|
||||
break;
|
||||
case TVIN_IOC_G_IMAX_STATUS:
|
||||
if (devp->parm.info.status != TVIN_SIG_STATUS_STABLE)
|
||||
pr_info("get TVIN_IOC_G_IMAX_STATUS signal not stable\n");
|
||||
|
||||
if (copy_to_user(argp, &devp->prop.imax_flag,
|
||||
sizeof(devp->prop.imax_flag))) {
|
||||
ret = -EFAULT;
|
||||
pr_info("TVIN_IOC_G_IMAX_STATUS err\n\n");
|
||||
break;
|
||||
}
|
||||
if (vdin_dbg_en)
|
||||
pr_info("TVIN_IOC_G_IMAX_STATUS:%d\n", devp->prop.imax_flag);
|
||||
break;
|
||||
case TVIN_IOC_G_VDIN_HIST:
|
||||
if (devp->index == 0) {
|
||||
pr_info("TVIN_IOC_G_VDIN_HIST can't be used at vdin0\n");
|
||||
|
||||
@@ -334,6 +334,19 @@ static enum tvin_sg_chg_flg vdin_hdmirx_fmt_chg_detect(struct vdin_dev_s *devp)
|
||||
}
|
||||
}
|
||||
|
||||
if (devp->pre_prop.imax_flag != devp->prop.imax_flag) {
|
||||
if (devp->dv.allm_chg_cnt > vdin_dv_chg_cnt) {
|
||||
devp->dv.allm_chg_cnt = 0;
|
||||
signal_chg |= TVIN_SIG_CHG_DV_ALLM;
|
||||
if (signal_chg)
|
||||
pr_info("%s imax chg:(0x%x->0x%x)\n",
|
||||
__func__,
|
||||
devp->pre_prop.imax_flag,
|
||||
devp->prop.imax_flag);
|
||||
devp->pre_prop.imax_flag = devp->prop.imax_flag;
|
||||
}
|
||||
}
|
||||
|
||||
if (devp->pre_prop.latency.it_content !=
|
||||
devp->prop.latency.it_content) {
|
||||
if (devp->dv.allm_chg_cnt > vdin_dv_chg_cnt) {
|
||||
|
||||
@@ -596,6 +596,7 @@ enum tvin_sg_chg_flg {
|
||||
#define TVIN_IOC_G_INPUT_TIMING _IOR(_TM_T, 0x52, struct tvin_format_s)
|
||||
#define TVIN_IOC_G_VRR_STATUS _IOR(_TM_T, 0x53, struct vdin_vrr_freesync_param_s)
|
||||
#define TVIN_IOC_G_VDIN_STATUS _IOR(_TM_T, 0x54, unsigned int)
|
||||
#define TVIN_IOC_G_IMAX_STATUS _IOR(_TM_T, 0x55, bool)
|
||||
|
||||
#define TVIN_IOC_S_CANVAS_RECOVERY _IO(_TM_T, 0x0a)
|
||||
/* TVAFE */
|
||||
|
||||
Reference in New Issue
Block a user