Skip to content

Commit

Permalink
vpp: add the pic_mode backup to check difference [1/1]
Browse files Browse the repository at this point in the history
PD#TV-2929

Problem:
The pic_mode in cur_dispbuf was changed but not be detected.

Solution:
Add global pic_mode variable to check if the pic_mode in cur_dispbuf
is changed. If so, force vpp_set_filters.

Verify:
verified on x301

Change-Id: I5b95f512ad0823b031989f05526f114694887f2b
Signed-off-by: Brian Zhu <brian.zhu@amlogic.com>
  • Loading branch information
Brian Zhu authored and kongsuozt committed Mar 20, 2019
1 parent a1bf1b1 commit c67657f
Showing 1 changed file with 39 additions and 8 deletions.
47 changes: 39 additions & 8 deletions drivers/amlogic/media/video_sink/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ static DEFINE_MUTEX(video_layer_mutex);
static u32 layer_cap;

static struct disp_info_s glayer_info[MAX_VD_LAYERS];
static struct vframe_pic_mode_s gPic_info[MAX_VD_LAYERS];

static u32 reference_zorder = 128;

Expand Down Expand Up @@ -3063,6 +3064,7 @@ static inline void proc_vd2_vsc_phase_per_vsync(
static void pip_toggle_frame(struct vframe_s *vf)
{
u32 first_picture = 0;
bool force_toggle = false;

if (vf == NULL)
return;
Expand Down Expand Up @@ -3139,6 +3141,21 @@ static void pip_toggle_frame(struct vframe_s *vf)
#endif
}

if (cur_pipbuf &&
(cur_pipbuf->ratio_control &
DISP_RATIO_ADAPTED_PICMODE)) {
if (vf && (cur_pipbuf->ratio_control
== vf->ratio_control)
&& memcmp(&cur_pipbuf->pic_mode,
&vf->pic_mode,
sizeof(struct vframe_pic_mode_s)))
force_toggle = true;
else if (memcmp(&cur_pipbuf->pic_mode,
&gPic_info[1],
sizeof(struct vframe_pic_mode_s)))
force_toggle = true;
}

if (pip_property_changed) {
first_picture = 1;
pip_property_changed = 0;
Expand All @@ -3147,7 +3164,8 @@ static void pip_toggle_frame(struct vframe_s *vf)
vf->type_backup = vf->type;

/* enable new config on the new frames */
if ((first_picture) || (cur_pipbuf &&
if (first_picture || force_toggle ||
(cur_pipbuf &&
((cur_pipbuf->bufWidth != vf->bufWidth) ||
(cur_pipbuf->width != vf->width) ||
(cur_pipbuf->height != vf->height) ||
Expand Down Expand Up @@ -3175,6 +3193,9 @@ static void pip_toggle_frame(struct vframe_s *vf)
nextpip_frame_par, vinfo,
true, 1);

memcpy(&gPic_info[1], &vf->pic_mode,
sizeof(struct vframe_pic_mode_s));

if (iret == VppFilter_Success_and_Changed)
pip_property_changed = 1;

Expand Down Expand Up @@ -3932,14 +3953,20 @@ static void vsync_toggle_frame(struct vframe_s *vf, int line)
vf->type_backup = vf->type;
}

if (cur_dispbuf && vf &&
if (cur_dispbuf &&
(cur_dispbuf->ratio_control &
DISP_RATIO_ADAPTED_PICMODE) &&
(cur_dispbuf->ratio_control ==
vf->ratio_control) &&
memcmp(&cur_dispbuf->pic_mode, &vf->pic_mode,
sizeof(struct vframe_pic_mode_s)))
force_toggle = true;
DISP_RATIO_ADAPTED_PICMODE)) {
if (vf && (cur_dispbuf->ratio_control
== vf->ratio_control)
&& memcmp(&cur_dispbuf->pic_mode,
&vf->pic_mode,
sizeof(struct vframe_pic_mode_s)))
force_toggle = true;
else if (memcmp(&cur_dispbuf->pic_mode,
&gPic_info[0],
sizeof(struct vframe_pic_mode_s)))
force_toggle = true;
}

if ((last_process_3d_type != process_3d_type)
|| (last_el_status != vf_with_el))
Expand Down Expand Up @@ -3988,6 +4015,9 @@ static void vsync_toggle_frame(struct vframe_s *vf, int line)
if (iret == VppFilter_Success_and_Changed)
video_property_changed = 1;

memcpy(&gPic_info[0], &vf->pic_mode,
sizeof(struct vframe_pic_mode_s));

/* apply new vpp settings */
frame_par_ready_to_set = 1;

Expand Down Expand Up @@ -12764,6 +12794,7 @@ static int __init video_init(void)
/* make vd1 below vd2 */
for (i = 0; i < MAX_VD_LAYERS; i++) {
vpp_disp_info_init(&glayer_info[i], i);
memset(&gPic_info[i], 0, sizeof(struct vframe_pic_mode_s));
glayer_info[i].wide_mode = 1;
glayer_info[i].zorder = reference_zorder - 2 + i;
glayer_info[i].cur_sel_port = i;
Expand Down

0 comments on commit c67657f

Please sign in to comment.