From b0c57cfbb95c262f7ff787336c01d833716e5da8 Mon Sep 17 00:00:00 2001 From: jintao xu Date: Thu, 12 Dec 2019 13:47:29 +0800 Subject: [PATCH] amvideo: fix axis not update when video is paused [1/1] PD#SWPL-17536 Problem: axis not update when video is paused Solution: update axis every vsync Verify: Verify on u212 Change-Id: Iad1629f750e9ba075cbb1737a8c0b66be7f7fed4 Signed-off-by: jintao xu --- drivers/amlogic/media/video_sink/video.c | 33 +++++++++++++++++++ drivers/amlogic/media/video_sink/video_priv.h | 1 + 2 files changed, 34 insertions(+) diff --git a/drivers/amlogic/media/video_sink/video.c b/drivers/amlogic/media/video_sink/video.c index 597912ef6c61..21a512593303 100644 --- a/drivers/amlogic/media/video_sink/video.c +++ b/drivers/amlogic/media/video_sink/video.c @@ -3384,6 +3384,8 @@ static irqreturn_t vsync_isr_in(int irq, void *dev_id) u32 next_afbc_request = atomic_read(&gafbc_request); s32 vd1_path_id = glayer_info[0].display_path_id; s32 vd2_path_id = glayer_info[1].display_path_id; + int axis[4]; + int crop[4]; if (debug_flag & DEBUG_FLAG_VSYNC_DONONE) return IRQ_HANDLED; @@ -4507,6 +4509,21 @@ SET_FILTER: get_layer_display_canvas(0); } } + if (vd_layer[0].dispbuf && + (vd_layer[0].dispbuf->flag & VFRAME_FLAG_VIDEO_COMPOSER) && + !(debug_flag & DEBUG_FLAG_AXIS_NO_UPDATE)) { + axis[0] = vd_layer[0].dispbuf->axis[0]; + axis[1] = vd_layer[0].dispbuf->axis[1]; + axis[2] = vd_layer[0].dispbuf->axis[2]; + axis[3] = vd_layer[0].dispbuf->axis[3]; + crop[0] = vd_layer[0].dispbuf->crop[0]; + crop[1] = vd_layer[0].dispbuf->crop[1]; + crop[2] = vd_layer[0].dispbuf->crop[2]; + crop[3] = vd_layer[0].dispbuf->crop[3]; + _set_video_window(&glayer_info[0], axis); + _set_video_crop(&glayer_info[0], crop); + glayer_info[0].zorder = vd_layer[0].dispbuf->zorder; + } /* setting video display property in underflow mode */ if (!new_frame && vd_layer[0].dispbuf && @@ -4689,6 +4706,22 @@ SET_FILTER: } } + if (vd_layer[1].dispbuf && + (vd_layer[1].dispbuf->flag & VFRAME_FLAG_VIDEO_COMPOSER) && + !(debug_flag & DEBUG_FLAG_AXIS_NO_UPDATE)) { + axis[0] = vd_layer[1].dispbuf->axis[0]; + axis[1] = vd_layer[1].dispbuf->axis[1]; + axis[2] = vd_layer[1].dispbuf->axis[2]; + axis[3] = vd_layer[1].dispbuf->axis[3]; + crop[0] = vd_layer[1].dispbuf->crop[0]; + crop[1] = vd_layer[1].dispbuf->crop[1]; + crop[2] = vd_layer[1].dispbuf->crop[2]; + crop[3] = vd_layer[1].dispbuf->crop[3]; + _set_video_window(&glayer_info[1], axis); + _set_video_crop(&glayer_info[1], crop); + glayer_info[1].zorder = vd_layer[1].dispbuf->zorder; + } + /* setting video display property in underflow mode */ if (!new_frame2 && vd_layer[1].dispbuf && diff --git a/drivers/amlogic/media/video_sink/video_priv.h b/drivers/amlogic/media/video_sink/video_priv.h index 5f68d90e9043..16103e4d0edb 100644 --- a/drivers/amlogic/media/video_sink/video_priv.h +++ b/drivers/amlogic/media/video_sink/video_priv.h @@ -45,6 +45,7 @@ #define DEBUG_FLAG_PRINT_DROP_FRAME 0x4000000 #define DEBUG_FLAG_OMX_DV_DROP_FRAME 0x8000000 #define DEBUG_FLAG_COMPOSER_NO_DROP_FRAME 0x10000000 +#define DEBUG_FLAG_AXIS_NO_UPDATE 0x20000000 #define VOUT_TYPE_TOP_FIELD 0 #define VOUT_TYPE_BOT_FIELD 1 -- 2.20.1