summaryrefslogtreecommitdiff
authorZhi Zhou <zhi.zhou@amlogic.com>2018-07-16 03:29:16 (GMT)
committer xiaoliang.wang <xiaoliang.wang@amlogic.com>2019-01-17 06:46:16 (GMT)
commitce5f3f319eb8916575fbbf1dd8e436e88f33a683 (patch)
treef8a2e59c51e238b6af336c17db232b8d19097474
parent7abeb19c88efc2452566a7263ab7be643b5a224f (diff)
downloadcommon-ce5f3f319eb8916575fbbf1dd8e436e88f33a683.zip
common-ce5f3f319eb8916575fbbf1dd8e436e88f33a683.tar.gz
common-ce5f3f319eb8916575fbbf1dd8e436e88f33a683.tar.bz2
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>
Diffstat
-rw-r--r--drivers/amlogic/media/frame_sync/ptsserv.c12
-rw-r--r--drivers/amlogic/media/frame_sync/timestamp.c14
2 files changed, 13 insertions, 13 deletions
diff --git a/drivers/amlogic/media/frame_sync/ptsserv.c b/drivers/amlogic/media/frame_sync/ptsserv.c
index de2e8b5..206e50d 100644
--- a/drivers/amlogic/media/frame_sync/ptsserv.c
+++ b/drivers/amlogic/media/frame_sync/ptsserv.c
@@ -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;
diff --git a/drivers/amlogic/media/frame_sync/timestamp.c b/drivers/amlogic/media/frame_sync/timestamp.c
index fd19c64..c3e811b 100644
--- a/drivers/amlogic/media/frame_sync/timestamp.c
+++ b/drivers/amlogic/media/frame_sync/timestamp.c
@@ -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);