mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
vpp: add the pic_mode backup to check difference [1/1]
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>
This commit is contained in:
@@ -439,6 +439,7 @@ static DEFINE_MUTEX(video_layer_mutex);
|
|||||||
static u32 layer_cap;
|
static u32 layer_cap;
|
||||||
|
|
||||||
static struct disp_info_s glayer_info[MAX_VD_LAYERS];
|
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;
|
static u32 reference_zorder = 128;
|
||||||
|
|
||||||
@@ -3063,6 +3064,7 @@ static inline void proc_vd2_vsc_phase_per_vsync(
|
|||||||
static void pip_toggle_frame(struct vframe_s *vf)
|
static void pip_toggle_frame(struct vframe_s *vf)
|
||||||
{
|
{
|
||||||
u32 first_picture = 0;
|
u32 first_picture = 0;
|
||||||
|
bool force_toggle = false;
|
||||||
|
|
||||||
if (vf == NULL)
|
if (vf == NULL)
|
||||||
return;
|
return;
|
||||||
@@ -3139,6 +3141,21 @@ static void pip_toggle_frame(struct vframe_s *vf)
|
|||||||
#endif
|
#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) {
|
if (pip_property_changed) {
|
||||||
first_picture = 1;
|
first_picture = 1;
|
||||||
pip_property_changed = 0;
|
pip_property_changed = 0;
|
||||||
@@ -3147,7 +3164,8 @@ static void pip_toggle_frame(struct vframe_s *vf)
|
|||||||
vf->type_backup = vf->type;
|
vf->type_backup = vf->type;
|
||||||
|
|
||||||
/* enable new config on the new frames */
|
/* 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->bufWidth != vf->bufWidth) ||
|
||||||
(cur_pipbuf->width != vf->width) ||
|
(cur_pipbuf->width != vf->width) ||
|
||||||
(cur_pipbuf->height != vf->height) ||
|
(cur_pipbuf->height != vf->height) ||
|
||||||
@@ -3175,6 +3193,9 @@ static void pip_toggle_frame(struct vframe_s *vf)
|
|||||||
nextpip_frame_par, vinfo,
|
nextpip_frame_par, vinfo,
|
||||||
true, 1);
|
true, 1);
|
||||||
|
|
||||||
|
memcpy(&gPic_info[1], &vf->pic_mode,
|
||||||
|
sizeof(struct vframe_pic_mode_s));
|
||||||
|
|
||||||
if (iret == VppFilter_Success_and_Changed)
|
if (iret == VppFilter_Success_and_Changed)
|
||||||
pip_property_changed = 1;
|
pip_property_changed = 1;
|
||||||
|
|
||||||
@@ -3932,14 +3953,20 @@ static void vsync_toggle_frame(struct vframe_s *vf, int line)
|
|||||||
vf->type_backup = vf->type;
|
vf->type_backup = vf->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cur_dispbuf && vf &&
|
if (cur_dispbuf &&
|
||||||
(cur_dispbuf->ratio_control &
|
(cur_dispbuf->ratio_control &
|
||||||
DISP_RATIO_ADAPTED_PICMODE) &&
|
DISP_RATIO_ADAPTED_PICMODE)) {
|
||||||
(cur_dispbuf->ratio_control ==
|
if (vf && (cur_dispbuf->ratio_control
|
||||||
vf->ratio_control) &&
|
== vf->ratio_control)
|
||||||
memcmp(&cur_dispbuf->pic_mode, &vf->pic_mode,
|
&& memcmp(&cur_dispbuf->pic_mode,
|
||||||
sizeof(struct vframe_pic_mode_s)))
|
&vf->pic_mode,
|
||||||
force_toggle = true;
|
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)
|
if ((last_process_3d_type != process_3d_type)
|
||||||
|| (last_el_status != vf_with_el))
|
|| (last_el_status != vf_with_el))
|
||||||
@@ -3988,6 +4015,9 @@ static void vsync_toggle_frame(struct vframe_s *vf, int line)
|
|||||||
if (iret == VppFilter_Success_and_Changed)
|
if (iret == VppFilter_Success_and_Changed)
|
||||||
video_property_changed = 1;
|
video_property_changed = 1;
|
||||||
|
|
||||||
|
memcpy(&gPic_info[0], &vf->pic_mode,
|
||||||
|
sizeof(struct vframe_pic_mode_s));
|
||||||
|
|
||||||
/* apply new vpp settings */
|
/* apply new vpp settings */
|
||||||
frame_par_ready_to_set = 1;
|
frame_par_ready_to_set = 1;
|
||||||
|
|
||||||
@@ -12764,6 +12794,7 @@ static int __init video_init(void)
|
|||||||
/* make vd1 below vd2 */
|
/* make vd1 below vd2 */
|
||||||
for (i = 0; i < MAX_VD_LAYERS; i++) {
|
for (i = 0; i < MAX_VD_LAYERS; i++) {
|
||||||
vpp_disp_info_init(&glayer_info[i], 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].wide_mode = 1;
|
||||||
glayer_info[i].zorder = reference_zorder - 2 + i;
|
glayer_info[i].zorder = reference_zorder - 2 + i;
|
||||||
glayer_info[i].cur_sel_port = i;
|
glayer_info[i].cur_sel_port = i;
|
||||||
|
|||||||
Reference in New Issue
Block a user