From c524489cafece86ff93c5a4e384b248a44babd37 Mon Sep 17 00:00:00 2001 From: Peng Yixin Date: Wed, 6 Mar 2019 10:27:56 +0800 Subject: [PATCH] video: set pcrscr after 2 frames ready [2/3] PD#SWPL-795 Problem: Solution: add a sysfs to get vframe ready count Verify: Verified p212 Change-Id: I92171f57d336063e4a3af751e808b4a778184fe0 Signed-off-by: Peng Yixin --- drivers/amlogic/media/video_sink/video.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/amlogic/media/video_sink/video.c b/drivers/amlogic/media/video_sink/video.c index 9fedc05..c5fd152 100644 --- a/drivers/amlogic/media/video_sink/video.c +++ b/drivers/amlogic/media/video_sink/video.c @@ -11293,6 +11293,18 @@ static ssize_t video_vsync_slow_factor_store(struct class *cla, return count; } +static ssize_t vframe_ready_cnt_show(struct class *cla, + struct class_attribute *attr, char *buf) +{ + int ret = -1; + struct vframe_states states; + + ret = video_vf_get_states(&states); + + return snprintf(buf, 10, "%d\n", (ret == 0) ? + states.buf_avail_num : 0); +} + static ssize_t fps_info_show(struct class *cla, struct class_attribute *attr, char *buf) { @@ -12104,6 +12116,7 @@ static struct class_attribute amvideo_class_attrs[] = { __ATTR_RO(vframe_states), __ATTR_RO(video_state), __ATTR_RO(fps_info), + __ATTR_RO(vframe_ready_cnt), __ATTR_RO(video_layer1_state), __ATTR_RO(pic_mode_info), #ifdef VIDEO_PIP -- 2.7.4