hdmirx: add allm mode. [1/2]

PD#SWPL-1619

Problem:
need support allm mode

Solution:
add allm mode

Verify:
None

Change-Id: I34d05cfbef4b3fccbbb7c6b35fa613cda9b9cf36
Signed-off-by: yicheng shen <yicheng.shen@amlogic.com>
This commit is contained in:
yicheng shen
2018-12-24 00:54:59 -05:00
committed by Jianxin Pan
parent e5f641e72d
commit 211b677aeb
10 changed files with 74 additions and 3 deletions

View File

@@ -771,6 +771,16 @@ void hdmirx_get_repetition_info(struct tvin_sig_property_s *prop)
HDMI_DE_REPEAT_DONE_FLAG;
}
/*
* hdmirx_get_allm_mode - get allm mode
*/
void hdmirx_get_latency_info(struct tvin_sig_property_s *prop)
{
prop->latency.allm_mode = rx.vs_info_details.allm_mode;
prop->latency.it_content = it_content;
prop->latency.cn_type = rx.cur.cn_type;
}
/*
* hdmirx_get_hdr_info - get hdr info
*/
@@ -865,6 +875,7 @@ void hdmirx_get_sig_property(struct tvin_frontend_s *fe,
hdmirx_set_timing_info(prop);
hdmirx_get_hdr_info(prop);
hdmirx_get_vsi_info(prop);
hdmirx_get_latency_info(prop);
prop->skip_vf_num = vdin_drop_frame_cnt;
}

View File

@@ -41,7 +41,7 @@
*
*
*/
#define RX_VER1 "ver.2018/12/13"
#define RX_VER1 "ver.2018/12/24"
/*
*
*
@@ -204,6 +204,13 @@ enum map_addr_module_e {
MAP_ADDR_MODULE_NUM
};
enum rx_cn_type_e {
CN_GRAPHICS,
CN_PHOTO,
CN_CINEMA,
CN_GAME,
};
/**
* @short HDMI RX controller video parameters
*
@@ -248,6 +255,7 @@ struct rx_video_info {
enum hdmi_vic_e sw_vic;
uint8_t sw_dvi;
unsigned int it_content;
enum rx_cn_type_e cn_type;
/** AVI Q1-0, RGB quantization range */
unsigned int rgb_quant_range;
/** AVI Q1-0, YUV quantization range */
@@ -316,6 +324,7 @@ struct vsi_info_s {
bool backlt_md_bit;
unsigned int dolby_timeout;
unsigned int eff_tmax_pq;
bool allm_mode;
};
#define CHANNEL_STATUS_SIZE 24

View File

@@ -2540,6 +2540,8 @@ void rx_get_video_info(void)
/* AVI parameters */
rx.cur.hw_vic =
hdmirx_rd_bits_dwc(DWC_PDEC_AVI_PB, VID_IDENT_CODE);
rx.cur.cn_type =
hdmirx_rd_bits_dwc(DWC_PDEC_AVI_HB, CONETNT_TYPE);
rx.cur.repeat =
hdmirx_rd_bits_dwc(DWC_PDEC_AVI_HB, PIX_REP_FACTOR);
rx.cur.colorspace =

View File

@@ -695,6 +695,8 @@
#define N_DECODED MSK(20, 0)
/** Register address: auxiliary video information info frame */
#define DWC_PDEC_AVI_HB (0x3A0UL)
/** AVI content type*/
#define CONETNT_TYPE MSK(2, 28)
/** PR3-0, pixel repetition factor */
#define PIX_REP_FACTOR MSK(4, 24)
/** Q1-0, YUV quantization range */

View File

@@ -1391,6 +1391,10 @@ void rx_get_vsi_info(void)
((pkt->sbpkt.payload.data[0] & 0xff) == 0)) {
rx.vs_info_details.dolby_vision = false;
}
} else if (pkt->ieee == 0xd85dc4) {
/*TODO:hdmi2.1 spec vsi packet*/
tmp = pkt->sbpkt.payload.data[0] & _BIT(9);
rx.vs_info_details.allm_mode = tmp ? true : false;
} else {
/*3d VSI*/
if (pkt->sbpkt.vsi_3Dext.vdfmt == VSI_FORMAT_3D_FORMAT) {

View File

@@ -617,7 +617,18 @@ struct vsi_infoframe_st {
/*pb6*/
uint8_t data[22];/* val=0 */
} __packed vsi_DobV;
/*TODO:hdmi2.1 spec vsi packet*/
struct vsi_st_21 {
/*pb4*/
uint8_t ver:8;
/*pb5*/
uint8_t threeD_valid:1;
uint8_t allm_mode:1;
uint8_t rsvd1:2;
uint8_t ccbpc:4;
/*pb6*/
/*todo*/
} __packed vsi_st_21;
} __packed sbpkt;
} __packed;

View File

@@ -438,6 +438,19 @@ struct tvin_hdr_info_s {
unsigned int hdr_check_cnt;
};
enum tvin_cn_type_e {
GRAPHICS,
PHOTO,
CINEMA,
GAME,
};
struct tvin_latency_s {
bool allm_mode;
bool it_content;
enum tvin_cn_type_e cn_type;
};
struct tvin_sig_property_s {
enum tvin_trans_fmt trans_fmt;
enum tvin_color_fmt_e color_format;
@@ -464,6 +477,7 @@ struct tvin_sig_property_s {
bool low_latency;/*is low latency dolby mode*/
uint8_t fps;
unsigned int skip_vf_num;/*skip pre vframe num*/
struct tvin_latency_s latency;
};
#define TVAFE_VF_POOL_SIZE 6 /* 8 */

View File

@@ -2327,6 +2327,22 @@ static long vdin_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
devp->auto_ratio_en);
}
break;
case TVIN_IOC_GET_LATENCY_MODE:
mutex_unlock(&devp->fe_lock);
if (copy_to_user(argp,
&(devp->prop.latency),
sizeof(struct tvin_latency_s))) {
mutex_unlock(&devp->fe_lock);
ret = -EFAULT;
pr_info("TVIN_IOC_GET_ALLM_MODE err\n\n");
break;
}
pr_info("allm mode-%d,IT=%d,CN=%d\n\n",
devp->prop.latency.allm_mode,
devp->prop.latency.it_content,
devp->prop.latency.cn_type);
mutex_unlock(&devp->fe_lock);
break;
default:
ret = -ENOIOCTLCMD;
/* pr_info("%s %d is not supported command\n", __func__, cmd); */

View File

@@ -45,7 +45,7 @@
#include "vdin_vf.h"
#include "vdin_regs.h"
#define VDIN_VER "Ref.2018/11/21a"
#define VDIN_VER "Ref.2019/01/03"
/*the counter of vdin*/
#define VDIN_MAX_DEVS 2

View File

@@ -432,6 +432,8 @@ struct tvafe_pin_mux_s {
enum tvin_force_color_range_e)
#define TVIN_IOC_GAME_MODE _IOW(_TM_T, 0x4b, unsigned int)
#define TVIN_IOC_SET_AUTO_RATIO_EN _IOW(_TM_T, 0x4c, unsigned int)
#define TVIN_IOC_GET_LATENCY_MODE _IOR(_TM_T, 0x4d,\
struct tvin_latency_s)
/* TVAFE */
#define TVIN_IOC_S_AFE_VGA_PARM _IOW(_TM_T, 0x16, struct tvafe_vga_parm_s)