mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
VIDEO_PTS: don't used the hardware register
PD#169889: don't used harware vpts/apts for avsync. becuase this apts/vpts is hardware irrelevant. so if we need this register, we need power on the parser,but it is irrelevant in ATV/hdmi-in mode. Change-Id: I4bd218c228516c974027b61c3a094b536913312e Signed-off-by: Zhi Zhou <zhi.zhou@amlogic.com>
This commit is contained in:
@@ -510,9 +510,9 @@ static int pts_checkin_offset_inline(u8 type, u32 offset, u32 val, u64 uS64)
|
||||
pr_info("init apts[%d] at 0x%x\n", type, val);
|
||||
|
||||
if (type == PTS_TYPE_VIDEO)
|
||||
WRITE_PARSER_REG(VIDEO_PTS, val);
|
||||
timestamp_vpts_set(val);
|
||||
else if (type == PTS_TYPE_AUDIO)
|
||||
WRITE_PARSER_REG(AUDIO_PTS, val);
|
||||
timestamp_apts_set(val);
|
||||
|
||||
pTable->status = PTS_RUNNING;
|
||||
}
|
||||
@@ -1391,7 +1391,7 @@ int pts_start(u8 type)
|
||||
pTable->buf_size = READ_VREG(HEVC_STREAM_END_ADDR)
|
||||
- pTable->buf_start;
|
||||
#endif
|
||||
WRITE_PARSER_REG(VIDEO_PTS, 0);
|
||||
timestamp_vpts_set(0);
|
||||
timestamp_pcrscr_set(0);
|
||||
/* video always need the pcrscr,*/
|
||||
/*Clear it to use later */
|
||||
@@ -1424,8 +1424,7 @@ int pts_start(u8 type)
|
||||
* streaming buffer though.
|
||||
*/
|
||||
/* BUG_ON(pTable->buf_size <= 0x10000); */
|
||||
|
||||
WRITE_PARSER_REG(VIDEO_PTS, 0);
|
||||
timestamp_vpts_set(0);
|
||||
timestamp_pcrscr_set(0);
|
||||
/* video always need the pcrscr, */
|
||||
/*Clear it to use later*/
|
||||
@@ -1442,8 +1441,7 @@ int pts_start(u8 type)
|
||||
- pTable->buf_start + 8;
|
||||
|
||||
/* BUG_ON(pTable->buf_size <= 0x10000); */
|
||||
|
||||
WRITE_PARSER_REG(AUDIO_PTS, 0);
|
||||
timestamp_apts_set(0);
|
||||
timestamp_firstapts_set(0);
|
||||
pTable->first_checkin_pts = -1;
|
||||
pTable->first_lookup_ok = 0;
|
||||
|
||||
@@ -38,6 +38,8 @@ static u32 first_vpts;
|
||||
static u32 first_checkin_vpts;
|
||||
static u32 first_apts;
|
||||
static u32 pcrscr_lantcy = 200*90;
|
||||
static u32 video_pts;
|
||||
static u32 audio_pts;
|
||||
|
||||
static u32 system_time_scale_base = 1;
|
||||
static u32 system_time_scale_remainder;
|
||||
@@ -53,31 +55,31 @@ void set_timestamp_inc_factor(u32 factor)
|
||||
|
||||
u32 timestamp_vpts_get(void)
|
||||
{
|
||||
return (u32) READ_PARSER_REG(VIDEO_PTS);
|
||||
return video_pts;
|
||||
}
|
||||
EXPORT_SYMBOL(timestamp_vpts_get);
|
||||
|
||||
void timestamp_vpts_set(u32 pts)
|
||||
{
|
||||
WRITE_PARSER_REG(VIDEO_PTS, pts);
|
||||
video_pts = pts;
|
||||
}
|
||||
EXPORT_SYMBOL(timestamp_vpts_set);
|
||||
|
||||
void timestamp_vpts_inc(s32 val)
|
||||
{
|
||||
WRITE_PARSER_REG(VIDEO_PTS, READ_PARSER_REG(VIDEO_PTS) + val);
|
||||
video_pts += val;
|
||||
}
|
||||
EXPORT_SYMBOL(timestamp_vpts_inc);
|
||||
|
||||
u32 timestamp_apts_get(void)
|
||||
{
|
||||
return (u32) READ_PARSER_REG(AUDIO_PTS);
|
||||
return audio_pts;
|
||||
}
|
||||
EXPORT_SYMBOL(timestamp_apts_get);
|
||||
|
||||
void timestamp_apts_set(u32 pts)
|
||||
{
|
||||
WRITE_PARSER_REG(AUDIO_PTS, pts);
|
||||
audio_pts = pts;
|
||||
}
|
||||
EXPORT_SYMBOL(timestamp_apts_set);
|
||||
|
||||
@@ -87,7 +89,7 @@ void timestamp_apts_inc(s32 inc)
|
||||
#ifdef MODIFY_TIMESTAMP_INC_WITH_PLL
|
||||
inc = inc * timestamp_inc_factor / PLL_FACTOR;
|
||||
#endif
|
||||
WRITE_PARSER_REG(AUDIO_PTS, READ_PARSER_REG(AUDIO_PTS) + inc);
|
||||
audio_pts += inc;
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(timestamp_apts_inc);
|
||||
|
||||
Reference in New Issue
Block a user