示例#1
0
static int set_disp_mode_auto(void)
{
    int ret=-1;
#ifndef AVOS
    const vinfo_t *info = get_current_vinfo();
#else
    vinfo_t* info=&lvideo_info;
#endif    
    HDMI_Video_Codes_t vic;     //Prevent warning
    //msleep(500);

    vic = hdmitx_edid_get_VIC(&hdmitx_device, info->name, (hdmitx_device.disp_switch_config==DISP_SWITCH_FORCE)?1:0);
    hdmitx_device.cur_VIC = HDMI_Unkown;
    ret = hdmitx_set_display(&hdmitx_device, vic); //if vic is HDMI_Unkown, hdmitx_set_display will disable HDMI
    if(ret>=0){
        hdmitx_device.cur_VIC = vic;
        hdmitx_device.audio_param_update_flag = 1;
        hdmi_authenticated = -1;
        hdmitx_device.auth_process_timer = AUTH_PROCESS_TIME;
        set_test_mode();
    }
    if(hdmitx_device.cur_VIC == HDMI_Unkown){
        if(hpdmode==2){
            hdmitx_edid_clear(&hdmitx_device); /* edid will be read again when hpd is muxed and it is high */
            hdmitx_device.mux_hpd_if_pin_high_flag = 0;
        }
        if(hdmitx_device.HWOp.Cntl){
            hdmitx_device.HWOp.Cntl(&hdmitx_device, HDMITX_HWCMD_TURNOFF_HDMIHW, (hpdmode==2)?1:0);    
        }
    }
    return ret;
}    
示例#2
0
/*****************************
*    hdmitx attr management :
*    enable
*    mode
*    reg
******************************/
static  int  set_disp_mode(const char *mode)
{
    int ret=-1;
    HDMI_Video_Codes_t vic;
    vic = hdmitx_edid_get_VIC(&hdmitx_device, mode, 1);

    if(vic != HDMI_Unkown){
        hdmitx_device.mux_hpd_if_pin_high_flag = 1;
        if(hdmitx_device.vic_count == 0){
               if(hdmitx_device.unplug_powerdown){
                   return 0;
                }
            }
        }

    hdmitx_device.cur_VIC = HDMI_Unkown;
    ret = hdmitx_set_display(&hdmitx_device, vic);
    if(ret>=0){
        hdmitx_device.cur_VIC = vic;
        hdmitx_device.audio_param_update_flag = 1;
    }

    if(hdmitx_device.cur_VIC == HDMI_Unkown){
        if(hpdmode == 2){
            hdmitx_edid_clear(&hdmitx_device); /* edid will be read again when hpd is muxed and it is high */
            hdmitx_device.mux_hpd_if_pin_high_flag = 0; 
        }
        if(hdmitx_device.HWOp.Cntl){
            hdmitx_device.HWOp.Cntl(&hdmitx_device, HDMITX_HWCMD_TURNOFF_HDMIHW, (hpdmode==2)?1:0);    
        }
    }
    
    return ret;
}
示例#3
0
static unsigned char is_dispmode_valid_for_hdmi(void)
{
    HDMI_Video_Codes_t vic;
#ifndef AVOS
    const vinfo_t *info = get_current_vinfo();
#else
    vinfo_t* info=&lvideo_info;
#endif    
    vic = hdmitx_edid_get_VIC(&hdmitx_device, info->name, (hdmitx_device.disp_switch_config==DISP_SWITCH_FORCE)?1:0);
    return (vic != HDMI_Unkown);
}
示例#4
0
static  int  set_disp_mode(const char *mode)
{
    int ret=-1;
    HDMI_Video_Codes_t vic;
    vic = hdmitx_edid_get_VIC(&hdmitx_device, mode, 1);
    hdmitx_device.cur_VIC = HDMI_Unkown;
    ret = hdmitx_set_display(&hdmitx_device, vic);
    if(ret>=0){
        hdmitx_device.cur_VIC = vic;  
    }
    return ret;
}
示例#5
0
static ssize_t show_disp_cap(struct device * dev, struct device_attribute *attr, char * buf)
{   
    int i,pos=0;
    char* disp_mode_t[]={"480i","480p","576i","576p","720p","1080i","1080p","720p50hz","1080i50hz","1080p50hz",NULL};
    char* native_disp_mode = hdmitx_edid_get_native_VIC(&hdmitx_device);
    HDMI_Video_Codes_t vic;
    for(i=0; disp_mode_t[i]; i++){
        vic = hdmitx_edid_get_VIC(&hdmitx_device, disp_mode_t[i], 0);
        if( vic != HDMI_Unkown){
            pos += snprintf(buf+pos, PAGE_SIZE,"%s",disp_mode_t[i]);
            if(native_disp_mode&&(strcmp(native_disp_mode, disp_mode_t[i])==0)){
                pos += snprintf(buf+pos, PAGE_SIZE,"*\n");
            }
            else{
                pos += snprintf(buf+pos, PAGE_SIZE,"\n");
            }                
        }
    }
    return pos;    
}
示例#6
0
 int set_disp_mode_auto(int mode)
{
    int ret=-1;
   char  mode_name[][16]=
   {
   	"480i","480i","480p","576i","576i","576p","720p","1080i","1080p","720p50hz","1080i50hz","1080p50hz","invalid"	
   };
    HDMI_Video_Codes_t vic;
    if(mode>=12)
    {
    	printf("invalid tvout mode \n");
	return -1;
    }
	
    vic = hdmitx_edid_get_VIC(&hdmitx_device,mode_name[mode]/* info->name*/, (hdmitx_device.disp_switch_config==DISP_SWITCH_FORCE)?1:0);
    hdmitx_device.cur_VIC = HDMI_Unkown;
    ret = hdmitx_set_display(&hdmitx_device, vic); //if vic is HDMI_Unkown, hdmitx_set_display will disable HDMI
    if(ret>=0){
        hdmitx_device.cur_VIC = vic;    
    }
    return ret;
}