From: jintao xu Date: Fri, 10 May 2019 11:47:36 +0000 (+0800) Subject: pipvideo: add frame drop mechanism [1/1] X-Git-Tag: khadas-vims-v0.9.6-release~442 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c23656bc957989f78c6f3f2e9a46bb3222fc1a1;p=platform%2Fkernel%2Flinux-amlogic.git pipvideo: add frame drop mechanism [1/1] PD#OTT-3616 Problem: when HDMI output is 30HZ, video is 60fps, pipvideo only can display 30fps, need drop 30fps. Solution: drop frames when there is no time to display Verify: U212 Change-Id: I3c946aa49ccc40b8e69e6e7c5031df0b5af34454 Signed-off-by: jintao xu --- diff --git a/drivers/amlogic/media/video_processor/videosync/videosync.c b/drivers/amlogic/media/video_processor/videosync/videosync.c index 23b6d0b..f2eb0fe 100644 --- a/drivers/amlogic/media/video_processor/videosync/videosync.c +++ b/drivers/amlogic/media/video_processor/videosync/videosync.c @@ -1002,10 +1002,16 @@ static int videosync_receiver_event_fun(int type, void *data, videosync_buffer_states(&states, dev_s); if (states.buf_queued_num + states.buf_ready_num > 0) return RECEIVER_ACTIVE; - - vp_print(dev_s->vf_receiver_name, 0, + else { + vp_print(dev_s->vf_receiver_name, 0, "buf queue empty!!\n"); - return RECEIVER_ACTIVE;/*return RECEIVER_INACTIVE;*/ + if (vf_notify_receiver( + dev_s->vf_provider_name, + VFRAME_EVENT_PROVIDER_QUREY_STATE, + NULL) == RECEIVER_ACTIVE) + return RECEIVER_ACTIVE; + return RECEIVER_INACTIVE; + } } return 0; } diff --git a/drivers/amlogic/media/video_sink/video.c b/drivers/amlogic/media/video_sink/video.c index dbc6117..0b9dff3 100644 --- a/drivers/amlogic/media/video_sink/video.c +++ b/drivers/amlogic/media/video_sink/video.c @@ -6787,10 +6787,12 @@ static irqreturn_t vsync_isr_in(int irq, void *dev_id) SET_FILTER: #ifdef VIDEO_PIP vf = pip_vf_peek(); + /* setting video display property in underflow mode */ if ((!vf) && cur_pipbuf && (pip_property_changed)) pip_toggle_frame(cur_pipbuf); - if (vf) { + + while (vf) { vf = pip_vf_get(); if (vf) { if (!vf->frame_dirty) @@ -6798,6 +6800,7 @@ SET_FILTER: else pip_vf_put(vf); } + vf = pip_vf_peek(); } #endif #if defined(CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_VECM)