Skip to content

Commit

Permalink
vpp: hold the vpp setting when meet the non-dw afbc frame [1/1]
Browse files Browse the repository at this point in the history
PD#SWPL-7513

Problem:
When meet the non-dw afbc frame, vpp can not display with
scaling down as expected.

Solution:
Hold the current vpp setting and wait provider to switch
non-afbc.

Verify:
x301

Change-Id: I3c0e678d2da42376f3a77e334b8c5ce48460273b
Signed-off-by: Brian Zhu <brian.zhu@amlogic.com>
  • Loading branch information
Brian Zhu authored and kongsuozt committed Apr 28, 2019
1 parent 29159de commit 1ace6fc
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 8 deletions.
42 changes: 34 additions & 8 deletions drivers/amlogic/media/video_sink/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ static u32 frame_detect_fps = 60000;
static u32 frame_detect_receive_count;
static u32 frame_detect_drop_count;

static u32 vpp_hold_setting_cnt;

#ifdef FIQ_VSYNC
#define BRIDGE_IRQ INT_TIMER_C
#define BRIDGE_IRQ_SET() WRITE_CBUS_REG(ISA_TIMERC, 1)
Expand Down Expand Up @@ -3172,7 +3174,7 @@ static void pip_toggle_frame(struct vframe_s *vf)
}

if (pip_property_changed) {
first_picture = 1;
force_toggle = true;
pip_property_changed = 0;
}
if (cur_pipbuf != vf)
Expand Down Expand Up @@ -3795,11 +3797,11 @@ static void vsync_toggle_frame(struct vframe_s *vf, int line)
if (video_property_changed) {
property_changed_true = 2;
video_property_changed = 0;
first_picture = 1;
force_toggle = true;
}
if (property_changed_true > 0) {
property_changed_true--;
first_picture = 1;
force_toggle = true;
}

if ((debug_flag & DEBUG_FLAG_BLACKOUT)
Expand Down Expand Up @@ -4022,14 +4024,31 @@ static void vsync_toggle_frame(struct vframe_s *vf, int line)
(is_dolby_vision_on() &&
is_dolby_vision_stb_mode()), 1);

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;
if ((iret == VppFilter_Success_and_Changed)
|| (iret == VppFilter_Changed_but_Hold))
video_property_changed = 1;

if (iret == VppFilter_Changed_but_Hold) {
video_notify_flag |=
VIDEO_NOTIFY_NEED_NO_COMP;
vpp_hold_setting_cnt++;
if (debug_flag & DEBUG_FLAG_BLACKOUT)
pr_info("toggle_frame vpp hold setting cnt: %d\n",
vpp_hold_setting_cnt);
} else {/* apply new vpp settings */
if ((next_frame_par->vscale_skip_count <= 1)
&& (vf->type & VIDTYPE_SUPPORT_COMPRESS)) {
video_notify_flag |=
VIDEO_NOTIFY_NEED_NO_COMP;
if (debug_flag & DEBUG_FLAG_BLACKOUT)
pr_info("disable no compress mode\n");
}
vpp_hold_setting_cnt = 0;
frame_par_ready_to_set = 1;
}

if (((vf->width > 1920) && (vf->height > 1088)) ||
((vf->type & VIDTYPE_COMPRESS) &&
Expand Down Expand Up @@ -5595,6 +5614,13 @@ static void vsync_notify(void)
video_notify_flag &=
~(VIDEO_NOTIFY_PROVIDER_GET | VIDEO_NOTIFY_PROVIDER_PUT);
}
if (video_notify_flag & VIDEO_NOTIFY_NEED_NO_COMP) {
/* FIXME: can not use fixed provider name */
vf_notify_provider_by_name("vdin0",
VFRAME_EVENT_RECEIVER_NEED_NO_COMP,
(void *)&vpp_hold_setting_cnt);
video_notify_flag &= ~VIDEO_NOTIFY_NEED_NO_COMP;
}
#ifdef CONFIG_CLK81_DFS
check_and_set_clk81();
#endif
Expand Down
1 change: 1 addition & 0 deletions drivers/amlogic/media/video_sink/video_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#define VIDEO_NOTIFY_PROVIDER_PUT 0x04
#define VIDEO_NOTIFY_FRAME_WAIT 0x08
#define VIDEO_NOTIFY_POS_CHANGED 0x10
#define VIDEO_NOTIFY_NEED_NO_COMP 0x20

struct video_dev_s {
int vpp_off;
Expand Down
13 changes: 13 additions & 0 deletions drivers/amlogic/media/video_sink/vpp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1487,6 +1487,7 @@ static int vpp_set_filters_internal(
}

if ((vf->type & VIDTYPE_COMPRESS) &&
!(vf->type & VIDTYPE_NO_DW) &&
(vf->canvas0Addr != 0) &&
(!next_frame_par->nocomp)) {
if ((next_frame_par->vscale_skip_count > 1)
Expand Down Expand Up @@ -1687,6 +1688,10 @@ static int vpp_set_filters_internal(
next_frame_par->vscale_skip_count;
}

if ((next_frame_par->vscale_skip_count > 1)
&& (vf->type & VIDTYPE_COMPRESS)
&& (vf->type & VIDTYPE_NO_DW))
ret = VppFilter_Changed_but_Hold;
return ret;
}
/*
Expand Down Expand Up @@ -2890,6 +2895,7 @@ static int vpp_set_filters_no_scaler_internal(
}

if ((vf->type & VIDTYPE_COMPRESS) &&
!(vf->type & VIDTYPE_NO_DW) &&
(vf->canvas0Addr != 0) &&
(!next_frame_par->nocomp)) {
if ((next_frame_par->vscale_skip_count > 1)
Expand Down Expand Up @@ -2954,6 +2960,10 @@ static int vpp_set_filters_no_scaler_internal(
next_frame_par->VPP_line_in_length_ >>= 1;
}

if ((next_frame_par->vscale_skip_count > 1)
&& (vf->type & VIDTYPE_COMPRESS)
&& (vf->type & VIDTYPE_NO_DW))
ret = VppFilter_Changed_but_Hold;
return ret;
}

Expand Down Expand Up @@ -3122,6 +3132,9 @@ int vpp_set_filters(
vinfo->width, vinfo->height,
vinfo, vpp_flags, next_frame_par, vf);

/* bypass sr since the input w/h may be wrong */
if (ret == VppFilter_Changed_but_Hold)
bypass_sr = true;
/*config super scaler after set next_frame_par is calc ok for pps*/
if (local_input.layer_id == 0)
vpp_set_super_scaler(
Expand Down
1 change: 1 addition & 0 deletions include/linux/amlogic/media/video_sink/vpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ enum vppfilter_state_e {
VppFilter_Fail = -1,
VppFilter_Success = 0,
VppFilter_Success_and_Changed,
VppFilter_Changed_but_Hold,
};

enum f2v_vphase_type_e {
Expand Down

0 comments on commit 1ace6fc

Please sign in to comment.