video: set pcrscr after 2 frames ready [2/3]
authorPeng Yixin <yixin.peng@amlogic.com>
Wed, 6 Mar 2019 02:27:56 +0000 (10:27 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Thu, 4 Apr 2019 09:12:25 +0000 (02:12 -0700)
PD#SWPL-795

Problem:

Solution:
add a sysfs to get vframe ready count

Verify:
Verified p212

Change-Id: I92171f57d336063e4a3af751e808b4a778184fe0
Signed-off-by: Peng Yixin <yixin.peng@amlogic.com>
drivers/amlogic/media/video_sink/video.c

index 9fedc05..c5fd152 100644 (file)
@@ -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