Example #1
0
/*
 * uboot_display_already() uses to judge whether display has already
 * be set in uboot.
 * Here, first read the value of reg P_ENCP_VIDEO_MAX_PXCNT and
 * P_ENCP_VIDEO_MAX_LNCNT, then compare with value of tvregsTab[mode]
 */
static int uboot_display_already(tvmode_t mode)
{
    tvmode_t source = vmode_to_tvmode(get_resolution_vmode());
    if(source == mode)
        return 1;
    else
        return 0;
    /*
    const  reg_t *s = tvregsTab[mode];
    unsigned int pxcnt_tab = 0;
    unsigned int lncnt_tab = 0;

    while(s->reg != MREG_END_MARKER) {
        if(s->reg == P_ENCP_VIDEO_MAX_PXCNT) {
            pxcnt_tab = s->val;
        }
        if(s->reg == P_ENCP_VIDEO_MAX_LNCNT) {
            lncnt_tab = s->val;
        }
        s++;
    }

    if((pxcnt_tab == aml_read_reg32(P_ENCP_VIDEO_MAX_PXCNT)) &&
       (lncnt_tab == aml_read_reg32(P_ENCP_VIDEO_MAX_LNCNT))) {
        return 1;
    } else {
        return 0;
    }
    */
}
Example #2
0
/*
 * uboot_display_already() uses to judge whether display has already
 * be set in uboot.
 * Here, first read the value of reg P_ENCP_VIDEO_MAX_PXCNT and
 * P_ENCP_VIDEO_MAX_LNCNT, then compare with value of tvregsTab[mode]
 */
static int uboot_display_already(enum tvmode_e mode)
{
	enum tvmode_e source = TVMODE_MAX;

	source = vmode_to_tvmode(get_logo_vmode());
	if (source == mode)
		return 1;
	else
		return 0;
}
static int tv_set_current_vmode(vmode_t mod)
{
	if ((mod&VMODE_MODE_BIT_MASK)> VMODE_SXGA)
		return -EINVAL;

	info->vinfo = &tv_info[mod & VMODE_MODE_BIT_MASK];
	if(mod&VMODE_LOGO_BIT_MASK)  return 0;
#if MESON_CPU_TYPE >= MESON_CPU_TYPE_MESON8
	switch_vpu_mem_pd_vmod(info->vinfo->mode, VPU_MEM_POWER_ON);
	request_vpu_clk_vmod(info->vinfo->video_clk, info->vinfo->mode);
#endif
	tvoutc_setmode(vmode_to_tvmode(mod));
//	change_vdac_setting(get_current_vdac_setting(),mod);
	return 0;
}
Example #4
0
static int tv_set_current_vmode(enum vmode_e mode)
{
	if ((mode & VMODE_MODE_BIT_MASK) > VMODE_MAX)
		return -EINVAL;
#ifdef CONFIG_AML_VOUT_FRAMERATE_AUTOMATION
	/*
	 * if plug hdmi during fps (stream is playing)
	 * then adjust mode to fps vmode
	 */
	if (!want_hdmi_mode(mode)) {
		if (DOWN_HPLL == fine_tune_mode)
			update_tv_info_duration(fps_target_mode, UP_HPLL);
	}
	fps_auto_adjust_mode(&mode);
	update_vmode_status(get_name_from_vmode(mode));
	vout_log_info("%s[%d]fps_target_mode=%d\n",
		      __func__, __LINE__, mode);

	info->vinfo = update_tv_info_duration(mode, fine_tune_mode);
#else
	info->vinfo = get_tv_info(mode & VMODE_MODE_BIT_MASK);
#endif
	if (!info->vinfo) {
		vout_log_info("don't get tv_info, mode is %d\n", mode);
		return 1;
	}
	vout_log_info("mode is %d,sync_duration_den=%d,sync_duration_num=%d\n",
		      mode, info->vinfo->sync_duration_den,
		      info->vinfo->sync_duration_num);
	if (mode & VMODE_LOGO_BIT_MASK)
		return 0;

	vout_change_mode_preprocess(mode);

#ifdef CONFIG_AML_VPU
	switch_vpu_mem_pd_vmod(info->vinfo->mode, VPU_MEM_POWER_ON);
	request_vpu_clk_vmod(info->vinfo->video_clk, info->vinfo->mode);
#endif
	tv_out_reg_write(VPP_POSTBLEND_H_SIZE, info->vinfo->width);
	tv_out_setmode(vmode_to_tvmode(mode));

#ifdef CONFIG_AML_VOUT_FRAMERATE_AUTOMATION
	vout_log_info("new mode =%s set ok\n", get_name_from_vmode(mode));
#endif

	return 0;
}
Example #5
0
static int tv_set_current_vmode(vmode_t mod)
{
    if ((mod&VMODE_MODE_BIT_MASK)> VMODE_MAX)
	return -EINVAL;
    info->vinfo = get_tv_info(mod & VMODE_MODE_BIT_MASK);
    if(!info->vinfo) {
        printk("don't get tv_info, mode is %d\n", mod);
        return 1;
    }
//	info->vinfo = &tv_info[mod & VMODE_MODE_BIT_MASK];
    printk("mode is %d,sync_duration_den=%d,sync_duration_num=%d\n", mod,info->vinfo->sync_duration_den,info->vinfo->sync_duration_num);
    if(mod&VMODE_LOGO_BIT_MASK)  return 0;
#if MESON_CPU_TYPE >= MESON_CPU_TYPE_MESON8
    switch_vpu_mem_pd_vmod(info->vinfo->mode, VPU_MEM_POWER_ON);
    request_vpu_clk_vmod(info->vinfo->video_clk, info->vinfo->mode);
#endif
    tvoutc_setmode(vmode_to_tvmode(mod));
//	change_vdac_setting(get_current_vdac_setting(),mod);
    return 0;
}