mirror of
https://github.com/hardkernel/kernel_common_drivers.git
synced 2026-06-25 12:03:48 +09:00
frc: frc chg new latency [1/1]
PD#SWPL-155997 Problem: sync customer changed Solution: sync customer changed Verify: T5M Change-Id: I39e2f4ff3619dd8d67921e432cbe9082226e197a Signed-off-by: dongfei.li <dongfei.li@amlogic.com>
This commit is contained in:
committed by
gerrit autosubmit
parent
8584c8f0c5
commit
1cbf38bb02
@@ -112,6 +112,87 @@ int frc_set_mode(enum frc_state_e state)
|
||||
* get current frc video latency
|
||||
* return: ms
|
||||
*/
|
||||
int frc_get_video_latency_for_gd(void)
|
||||
{
|
||||
struct frc_dev_s *devp = get_frc_devp();
|
||||
struct frc_fw_data_s *fw_data;
|
||||
struct frc_top_type_s *frc_top;
|
||||
|
||||
// u32 out_frm_dly_num;
|
||||
struct vinfo_s *vinfo = get_current_vinfo();
|
||||
u32 vout_hz = 0;
|
||||
int delay_time = -1; /*ms*/
|
||||
|
||||
fw_data = (struct frc_fw_data_s *)devp->fw_data;
|
||||
frc_top = &fw_data->frc_top_type;
|
||||
|
||||
if (vinfo && vinfo->sync_duration_den != 0)
|
||||
vout_hz = vinfo->sync_duration_num / vinfo->sync_duration_den;
|
||||
// delay_time = out_frm_dly_num;
|
||||
if (!devp || !vinfo)
|
||||
return -1;
|
||||
|
||||
if (devp->frc_sts.auto_ctrl == 1) {
|
||||
if (devp->in_sts.frc_vf_rate == 0)
|
||||
return -1;
|
||||
else if (frc_top->film_mode == 0)
|
||||
delay_time = 35 * 100 / devp->in_sts.frc_vf_rate;
|
||||
else if (frc_top->film_mode != 0) // 30hz or 25hz
|
||||
delay_time = 35 * 100 / devp->in_sts.frc_vf_rate;
|
||||
else
|
||||
delay_time = -2;
|
||||
} else {
|
||||
delay_time = -1;
|
||||
}
|
||||
return delay_time;
|
||||
}
|
||||
EXPORT_SYMBOL(frc_get_video_latency_for_gd);
|
||||
|
||||
/*
|
||||
* get current frc video latency 1
|
||||
* return: out vsync num
|
||||
*/
|
||||
int frc_get_video_latency_for_gd1(void)
|
||||
{
|
||||
struct frc_dev_s *devp = get_frc_devp();
|
||||
struct frc_fw_data_s *fw_data;
|
||||
struct frc_top_type_s *frc_top;
|
||||
// u32 out_frm_dly_num;
|
||||
struct vinfo_s *vinfo = get_current_vinfo();
|
||||
u32 vout_hz = 0;
|
||||
|
||||
int delay_time = -1; /*ms*/
|
||||
int delay_vsync_num = 0;
|
||||
|
||||
fw_data = (struct frc_fw_data_s *)devp->fw_data;
|
||||
frc_top = &fw_data->frc_top_type;
|
||||
|
||||
if (!devp || !vinfo)
|
||||
return -1;
|
||||
if (vinfo && vinfo->sync_duration_den != 0)
|
||||
vout_hz = vinfo->sync_duration_num / vinfo->sync_duration_den;
|
||||
|
||||
if (devp->frc_sts.auto_ctrl == 1) {
|
||||
if (devp->in_sts.frc_vf_rate == 0)
|
||||
return -1;
|
||||
else if (frc_top->film_mode == 0)
|
||||
delay_time = 35 * 100 / devp->in_sts.frc_vf_rate;
|
||||
else if (frc_top->film_mode != 0) // 30hz or 25hz
|
||||
delay_time = 35 * 100 / devp->in_sts.frc_vf_rate;
|
||||
else
|
||||
delay_time = -2;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (delay_time > 0)
|
||||
delay_vsync_num = delay_time * vout_hz / 1000;
|
||||
else
|
||||
delay_vsync_num = -2;
|
||||
return delay_vsync_num;
|
||||
}
|
||||
EXPORT_SYMBOL(frc_get_video_latency_for_gd1);
|
||||
|
||||
int frc_get_video_latency(void)
|
||||
{
|
||||
struct frc_dev_s *devp = get_frc_devp();
|
||||
|
||||
@@ -23,6 +23,10 @@ enum frc_state_e {
|
||||
int frc_input_handle(struct vframe_s *vf, struct vpp_frame_par_s *cur_video_sts);
|
||||
int frc_set_mode(enum frc_state_e state);
|
||||
int frc_get_video_latency(void);
|
||||
int frc_get_video_latency_for_gd(void);
|
||||
int frc_get_video_latency_for_gd1(void);
|
||||
|
||||
int frc_is_on(void);
|
||||
int frc_is_supported(void);
|
||||
int frc_memc_set_level(u8 level);
|
||||
int frc_fpp_memc_set_level(u8 level, u8 num);
|
||||
|
||||
Reference in New Issue
Block a user