From 862eab105c2919a69309a5eabacee62f314d3c8e Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Thu, 25 Jul 2019 17:18:12 +0900 Subject: [PATCH] Revert "media_module: mh264/h265/avs2 [1/2]" This reverts commit 65e6d31e356bcc46bcd7ea3e79575d7be40bfd5b. Change-Id: Ie1e0f32bea013995c54809ab98ee1f735fa93aa9 --- drivers/amlogic/media/frame_sync/ptsserv.c | 38 ++++-------- drivers/amlogic/media/frame_sync/tsync.c | 4 +- .../linux/amlogic/media/frame_sync/ptsserv.h | 7 +-- .../amlogic/media/registers/regs/hevc_regs.h | 8 --- include/linux/amlogic/media/utils/amstream.h | 62 ------------------- 5 files changed, 17 insertions(+), 102 deletions(-) diff --git a/drivers/amlogic/media/frame_sync/ptsserv.c b/drivers/amlogic/media/frame_sync/ptsserv.c index d9b4cca38e0d..b1469c55e13d 100644 --- a/drivers/amlogic/media/frame_sync/ptsserv.c +++ b/drivers/amlogic/media/frame_sync/ptsserv.c @@ -55,7 +55,6 @@ struct pts_rec_s { struct list_head list; u32 offset; u32 val; - u32 size; u64 pts_uS64; } /*pts_rec_t */; @@ -642,7 +641,7 @@ int get_last_checkout_pts(u8 type) } EXPORT_SYMBOL(get_last_checkout_pts); -int pts_lookup(u8 type, u32 *val, u32 *frame_size, u32 pts_margin) +int pts_lookup(u8 type, u32 *val, u32 pts_margin) { u32 page, offset; @@ -650,20 +649,18 @@ int pts_lookup(u8 type, u32 *val, u32 *frame_size, u32 pts_margin) if (type == PTS_TYPE_VIDEO) { offset = page * pts_table[PTS_TYPE_VIDEO].buf_size + offset; - pts_lookup_offset( - PTS_TYPE_VIDEO, offset, val, frame_size, pts_margin); + pts_lookup_offset(PTS_TYPE_VIDEO, offset, val, pts_margin); return 0; } else if (type == PTS_TYPE_AUDIO) { offset = page * pts_table[PTS_TYPE_AUDIO].buf_size + offset; - pts_lookup_offset( - PTS_TYPE_AUDIO, offset, val, frame_size, pts_margin); + pts_lookup_offset(PTS_TYPE_AUDIO, offset, val, pts_margin); return 0; } else return -EINVAL; } EXPORT_SYMBOL(pts_lookup); static int pts_lookup_offset_inline_locked(u8 type, u32 offset, u32 *val, - u32 *frame_size, u32 pts_margin, u64 *uS64) + u32 pts_margin, u64 *uS64) { struct pts_table_s *pTable; int lookup_threshold; @@ -781,9 +778,6 @@ static int pts_lookup_offset_inline_locked(u8 type, u32 offset, u32 *val, } else p2 = p; - if (type == PTS_TYPE_VIDEO) - *frame_size = p->size; - if ((p2) && (OFFSET_DIFF(offset, p2->offset) < lookup_threshold)) { if (p2->val == 0) /* FFT: set valid vpts */ @@ -795,9 +789,8 @@ static int pts_lookup_offset_inline_locked(u8 type, u32 offset, u32 *val, ("vpts look up offset<0x%x> -->", offset); pr_info - ("<0x%x:0x%x>, fsize %x, look_cnt = %d\n", - p2->offset, p2->val, - p2->size, look_cnt); + ("<0x%x:0x%x>, look_cnt = %d\n", + p2->offset, p2->val, look_cnt); } if (tsync_get_debug_apts() @@ -813,7 +806,6 @@ static int pts_lookup_offset_inline_locked(u8 type, u32 offset, u32 *val, } *val = p2->val; *uS64 = p2->pts_uS64; - *frame_size = p2->size; #ifdef CALC_CACHED_TIME pTable->last_checkout_pts = p2->val; @@ -1139,15 +1131,14 @@ static int pts_pick_by_offset_inline_locked(u8 type, u32 offset, u32 *val, static int pts_lookup_offset_inline(u8 type, u32 offset, u32 *val, - u32 *frame_size, u32 pts_margin, u64 *uS64) + u32 pts_margin, u64 *uS64) { unsigned long flags; int res; spin_lock_irqsave(&lock, flags); res = pts_lookup_offset_inline_locked( - type, offset, val, - frame_size, pts_margin, uS64); + type, offset, val, pts_margin, uS64); #if 0 if (timestamp_firstvpts_get() == 0 && res == 0 && (*val) != 0 @@ -1185,21 +1176,18 @@ static int pts_pick_by_offset_inline(u8 type, u32 offset, u32 *val, } -int pts_lookup_offset(u8 type, u32 offset, u32 *val, - u32 *frame_size, u32 pts_margin) +int pts_lookup_offset(u8 type, u32 offset, u32 *val, u32 pts_margin) { u64 pts_us; - return pts_lookup_offset_inline(type, offset, val, - frame_size, pts_margin, &pts_us); + return pts_lookup_offset_inline(type, offset, val, pts_margin, &pts_us); } EXPORT_SYMBOL(pts_lookup_offset); -int pts_lookup_offset_us64(u8 type, u32 offset, u32 *val, - u32 *frame_size, u32 pts_margin, u64 *uS64) +int pts_lookup_offset_us64(u8 type, u32 offset, u32 *val, u32 pts_margin, + u64 *uS64) { - return pts_lookup_offset_inline(type, offset, val, - frame_size, pts_margin, uS64); + return pts_lookup_offset_inline(type, offset, val, pts_margin, uS64); } EXPORT_SYMBOL(pts_lookup_offset_us64); diff --git a/drivers/amlogic/media/frame_sync/tsync.c b/drivers/amlogic/media/frame_sync/tsync.c index c6a9b410a6c3..3bc5e8d7e781 100644 --- a/drivers/amlogic/media/frame_sync/tsync.c +++ b/drivers/amlogic/media/frame_sync/tsync.c @@ -2022,10 +2022,8 @@ static ssize_t store_latency(struct class *class, static ssize_t show_apts_lookup(struct class *class, struct class_attribute *attrr, char *buf) { - u32 frame_size; unsigned int pts = 0xffffffff; - pts_lookup_offset(PTS_TYPE_AUDIO, apts_lookup_offset, - &pts, &frame_size, 300); + pts_lookup_offset(PTS_TYPE_AUDIO, apts_lookup_offset, &pts, 300); return sprintf(buf, "0x%x\n", pts); } diff --git a/include/linux/amlogic/media/frame_sync/ptsserv.h b/include/linux/amlogic/media/frame_sync/ptsserv.h index 5d981871d7e5..d17f1aaec14f 100644 --- a/include/linux/amlogic/media/frame_sync/ptsserv.h +++ b/include/linux/amlogic/media/frame_sync/ptsserv.h @@ -43,13 +43,12 @@ extern int get_last_checkin_pts(u8 type); extern int get_last_checkout_pts(u8 type); -extern int pts_lookup(u8 type, u32 *val, u32 *frame_size, u32 pts_margin); +extern int pts_lookup(u8 type, u32 *val, u32 pts_margin); -extern int pts_lookup_offset(u8 type, u32 offset, u32 *val, - u32 *frame_size, u32 pts_margin); +extern int pts_lookup_offset(u8 type, u32 offset, u32 *val, u32 pts_margin); extern int pts_lookup_offset_us64(u8 type, u32 offset, u32 *val, - u32 *frame_size, u32 pts_margin, u64 *uS64); + u32 pts_margin, u64 *uS64); extern int pts_pickout_offset_us64(u8 type, u32 offset, u32 *val, u32 pts_margin, diff --git a/include/linux/amlogic/media/registers/regs/hevc_regs.h b/include/linux/amlogic/media/registers/regs/hevc_regs.h index 9eb5eed0e28a..3258b90f752f 100644 --- a/include/linux/amlogic/media/registers/regs/hevc_regs.h +++ b/include/linux/amlogic/media/registers/regs/hevc_regs.h @@ -357,14 +357,6 @@ #define HEVC_IQIT_STAT_GEN0 0x3708 #define HEVC_QP_WRITE 0x3709 #define HEVC_IQIT_STAT_GEN1 0x370a -#define HEVC_IQIT_BITDEPTH 0x370b -#define HEVC_IQIT_STAT_GEN2 0x370c -#define HEVC_IQIT_AVS2_WQP_0123 0x370d -#define HEVC_IQIT_AVS2_WQP_45 0x370e -#define HEVC_IQIT_AVS2_QP_DELTA 0x370f -#define HEVC_PIC_QUALITY_CTRL 0x3710 -#define HEVC_PIC_QUALITY_DATA 0x3711 - /**/ /*add from M8M2*/ diff --git a/include/linux/amlogic/media/utils/amstream.h b/include/linux/amlogic/media/utils/amstream.h index 0d690f28fc18..7448e631231e 100644 --- a/include/linux/amlogic/media/utils/amstream.h +++ b/include/linux/amlogic/media/utils/amstream.h @@ -246,9 +246,6 @@ #define AMSTREAM_IOC_SET_EX _IOW((_A_M), 0xc4, struct am_ioctl_parm_ex) #define AMSTREAM_IOC_GET_PTR _IOWR((_A_M), 0xc5, struct am_ioctl_parm_ptr) #define AMSTREAM_IOC_SET_PTR _IOW((_A_M), 0xc6, struct am_ioctl_parm_ptr) -#define AMSTREAM_IOC_GET_AVINFO _IOR((_A_M), 0xc7, struct av_param_info_t) -#define AMSTREAM_IOC_GET_QOSINFO _IOR((_A_M), 0xc8, struct av_param_qosinfo_t) - #define TRICKMODE_NONE 0x00 #define TRICKMODE_I 0x01 @@ -719,65 +716,6 @@ struct am_ioctl_parm_ptr { u32 len; /*char reserved[4]; */ }; -struct vframe_qos_s { - int num; - int type; - int size; - int pts; - int max_qp; - int avg_qp; - int min_qp; - int max_skip; - int avg_skip; - int min_skip; - int max_mv; - int min_mv; - int avg_mv; - int decode_buffer; -} /*vframe_qos */; - -enum FRAME_FORMAT { - FRAME_FORMAT_UNKNOWN, - FRAME_FORMAT_PROGRESS, - FRAME_FORMAT_INTERLACE, -}; - -#define QOS_FRAME_NUM 60 -struct av_info_t { - /*auido info*/ - int sample_rate; - int channels; - int aformat_type; - unsigned int apts; - unsigned int apts_err; - /*video info*/ - unsigned int width; - unsigned int height; - unsigned int dec_error_count; - unsigned int first_pic_coming; - unsigned int fps; - unsigned int current_fps; - unsigned int vpts; - unsigned int vpts_err; - unsigned int ts_error; - unsigned int first_vpts; - int vformat_type; - enum FRAME_FORMAT frame_format; - unsigned int toggle_frame_count;/*toggle frame count*/ - unsigned int dec_err_frame_count;/*vdec error frame count*/ - unsigned int dec_frame_count;/*vdec frame count*/ - unsigned int dec_drop_frame_count;/*drop frame num*/ - int tsync_mode; -}; - -struct av_param_info_t { - struct av_info_t av_info; -}; -struct av_param_qosinfo_t { - struct vframe_qos_s vframe_qos[QOS_FRAME_NUM]; -}; - - #define SUPPORT_VDEC_NUM (20) int vcodec_profile_register(const struct codec_profile_t *vdec_profile); ssize_t vcodec_profile_read(char *buf);