u32 first_picture = 0;
unsigned long flags = 0;
bool vf_with_el = false;
+ bool force_toggle = false;
if (vf == NULL)
return;
vf->type_backup = vf->type;
}
+ if (cur_dispbuf && vf &&
+ (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;
+
+ if ((last_process_3d_type != process_3d_type)
+ || (last_el_status != vf_with_el))
+ force_toggle = true;
+
/* enable new config on the new frames */
- if ((first_picture) || (cur_dispbuf &&
- ((cur_dispbuf->bufWidth != vf->bufWidth) ||
- (cur_dispbuf->width != vf->width) ||
- (cur_dispbuf->height != vf->height) ||
- (cur_dispbuf->bitdepth != vf->bitdepth) ||
- (cur_dispbuf->trans_fmt != vf->trans_fmt) ||
- (last_process_3d_type != process_3d_type) ||
- (cur_dispbuf->ratio_control != vf->ratio_control) ||
- ((cur_dispbuf->type_backup & VIDTYPE_INTERLACE) !=
- (vf->type_backup & VIDTYPE_INTERLACE)) ||
- (last_el_status != vf_with_el) ||
- (cur_dispbuf->type != vf->type)
- ))) {
+ if (first_picture || force_toggle ||
+ (cur_dispbuf &&
+ ((cur_dispbuf->bufWidth != vf->bufWidth) ||
+ (cur_dispbuf->width != vf->width) ||
+ (cur_dispbuf->height != vf->height) ||
+ (cur_dispbuf->bitdepth != vf->bitdepth) ||
+ (cur_dispbuf->trans_fmt != vf->trans_fmt) ||
+ (cur_dispbuf->ratio_control != vf->ratio_control) ||
+ ((cur_dispbuf->type_backup & VIDTYPE_INTERLACE) !=
+ (vf->type_backup & VIDTYPE_INTERLACE)) ||
+ (cur_dispbuf->type != vf->type)))) {
last_process_3d_type = process_3d_type;
atomic_inc(&video_sizechange);
wake_up_interruptible(&amvideo_sizechange_wait);
"normal-noscaleup",
"4-3 ignore", "4-3 letter box", "4-3 pan scan", "4-3 combined",
"16-9 ignore", "16-9 letter box", "16-9 pan scan",
- "16-9 combined"
+ "16-9 combined", "Custom AR", "AFD"
};
if (wide_setting < ARRAY_SIZE(wide_str)) {
return count;
}
+static ssize_t pic_mode_info_show(struct class *cla,
+ struct class_attribute *attr, char *buf)
+{
+ int ret = 0;
+
+ if (cur_dispbuf) {
+ u32 adapted_mode = (cur_dispbuf->ratio_control
+ & DISP_RATIO_ADAPTED_PICMODE) ? 1 : 0;
+ u32 info_frame = (cur_dispbuf->ratio_control
+ & DISP_RATIO_INFOFRAME_AVAIL) ? 1 : 0;
+
+ ret += sprintf(buf + ret, "ratio_control=0x%x\n",
+ cur_dispbuf->ratio_control);
+ ret += sprintf(buf + ret, "adapted_mode=%d\n",
+ adapted_mode);
+ ret += sprintf(buf + ret, "info_frame=%d\n",
+ info_frame);
+ ret += sprintf(buf + ret,
+ "hs=%d, he=%d, vs=%d, ve=%d\n",
+ cur_dispbuf->pic_mode.hs,
+ cur_dispbuf->pic_mode.he,
+ cur_dispbuf->pic_mode.vs,
+ cur_dispbuf->pic_mode.ve);
+ ret += sprintf(buf + ret, "screen_mode=%d\n",
+ cur_dispbuf->pic_mode.screen_mode);
+ ret += sprintf(buf + ret, "custom_ar=%d\n",
+ cur_dispbuf->pic_mode.custom_ar);
+ ret += sprintf(buf + ret, "AFD_enable=%d\n",
+ cur_dispbuf->pic_mode.AFD_enable);
+ return ret;
+ }
+ return sprintf(buf, "NA\n");
+}
static struct class_attribute amvideo_class_attrs[] = {
__ATTR(axis,
__ATTR_RO(video_state),
__ATTR_RO(fps_info),
__ATTR_RO(video_layer1_state),
+ __ATTR_RO(pic_mode_info),
__ATTR_NULL
};
MODULE_PARM_DESC(force_vskip_cnt, "force_vskip_cnt");
module_param(force_vskip_cnt, uint, 0664);
+unsigned int disable_adapted;
+MODULE_PARM_DESC(disable_adapted, "disable_adapted");
+module_param(disable_adapted, uint, 0664);
+
#if 0
#define DECL_PARM(name)\
static int name;\
MODULE_PARM_DESC(cur_vf_type, "cur_vf_type");
module_param(cur_vf_type, uint, 0444);
+unsigned int custom_ar;
+MODULE_PARM_DESC(custom_ar, "custom_ar");
+module_param(custom_ar, uint, 0664);
+
/*
*test on txlx:
*Time_out = (V_out/V_screen_total)/FPS_out;
orig_aspect = aspect_factor;
screen_aspect = 0x90;
+ } else if (wide_mode == VIDEO_WIDEOPTION_CUSTOM) {
+ if (custom_ar != 0)
+ aspect_factor = custom_ar & 0x3ff;
+ wide_mode = VIDEO_WIDEOPTION_NORMAL;
+ } else if (wide_mode == VIDEO_WIDEOPTION_AFD) {
+ if (aspect_factor == 0x90)
+ wide_mode = VIDEO_WIDEOPTION_FULL_STRETCH;
+ else
+ wide_mode = VIDEO_WIDEOPTION_NORMAL;
}
if (super_debug)
video_source_crop_bottom = video_crop_bottom_resv;
video_source_crop_right = video_crop_right_resv;
}
+
+ if ((vf->ratio_control & DISP_RATIO_ADAPTED_PICMODE)
+ && !disable_adapted) {
+ wide_mode = vf->pic_mode.screen_mode;
+ video_source_crop_top = vf->pic_mode.vs;
+ video_source_crop_left = vf->pic_mode.hs;
+ video_source_crop_bottom = vf->pic_mode.ve;
+ video_source_crop_right = vf->pic_mode.he;
+ if (vf->pic_mode.AFD_enable
+ && (vf->ratio_control & DISP_RATIO_INFOFRAME_AVAIL))
+ wide_mode = VIDEO_WIDEOPTION_AFD;
+ if (wide_mode == VIDEO_WIDEOPTION_CUSTOM)
+ custom_ar = vf->pic_mode.custom_ar;
+ }
vpp_wide_mode = wide_mode;
vpp_flags |= wide_mode | (aspect_ratio << VPP_FLAG_AR_BITS);