int hdmi_print_buf(char* buf, int len) { if(AVOS_Print_Flag&DBGHLP_LOG_HDMI){ AVOS_printf("%s", buf); } return 0; }
int hdmi_print(int printk_flag, const char *fmt, ...) { va_list args; int avail = PRINT_TEMP_BUF_SIZE; char buf[PRINT_TEMP_BUF_SIZE]; int pos,len=0; /* if(printk_flag){ va_start(args, fmt); vprintk(fmt, args); va_end(args); } if(hdmi_log_buf_size==0) return 0; */ va_start(args, fmt); len += vsnprintf(buf+len, avail-len, fmt, args); va_end(args); if ((avail-len) <= 0) { buf[PRINT_TEMP_BUF_SIZE - 1] = '\0'; } if(printk_flag){ AVOS_printf("%s", buf); } else{ pos = hdmi_print_buf(buf, len); } //printk("hdmi_print:%d %d\n", hdmi_log_wr_pos, hdmi_log_rd_pos); return pos; }
static int uVideoFmt_SetVideoType(control_t* cntl, cond_item_t* param) { int ret=0; uvideofmt_t* uvideofmt = (uvideofmt_t*)(cntl->private_data); int fmt = (int)(param[0]); int outputmode = (int)(param[1]); /* Add Method code here, Set ret to be -1 if fail */ int displayctl_fd, resolution_data; video_appmode_t video_appmode = { DISPCTL_MODE_1080P, 0, 0, 0, DISPCTL_MODE_1080P }; page_t *page = af_find_page(SYSTEM_DEFAULT_PAGE); if (this_curVideoFmt!=fmt || this_outputmode!= outputmode) { /* when NTSC/PAL CVBS output is enabled in first 3 video dacs, * enable pedestal. Component 480i has pedestal disabled. */ #ifdef AML_NIKE fmt = 6; #endif #ifndef EDGE_ADJUST set_display_edge_adjust(0,0,0,0); #endif af_osd_layer_destroy(OSD_LAYER_HW_LAYER0); switch(outputmode) { case 0://Analog clear_mio_mux(5, (1<<0) | (1<<2) | (1<<3) | (1<<4) | (1<<7)); //disable RGB data //clear_mio_mux(4, (1<<20) | (1<<22) | (1<<24));//6bits clear_mio_mux(4, (0x3f<<20));//8bits #ifdef APOLLO_PMP_TVOUT clear_mio_mux(4, 0x7c000000); //disable hdmi output , #endif resolution_data = set_analog_output(fmt, &video_appmode); break; case 2://HDMI clear_mio_mux(5, (1<<0) | (1<<2) | (1<<3) | (1<<4) | (1<<7)); //disable RGB data //clear_mio_mux(4, (1<<20) | (1<<22) | (1<<24));//6bits clear_mio_mux(4, (0x3f<<20));//8bits resolution_data = set_hdmi_output(fmt, &video_appmode); set_mio_mux(4, 0x7c000000); //mux GPIOC_28 to hsync, mux GPIOC_29 to vsync, mux GPIOC_30 to DE, mux GPIOC_31 to pixel clock, mux GPIOC_32~GPIOC_55 to HDMI data lines, Codec_PowerDown_Entile_Codec(0); break; #if (defined APOLLO_PMP_LCD) || (defined NIKE_PMP_LCD) case 1://Panel #ifdef EDGE_ADJUST set_display_edge_adjust(0,0,0,0); #endif clear_mio_mux(4, 0x7c000000); //disable hdmi output , //enable Tcon //set_mio_mux(5, (1<<0) | (1<<2) | (1<<3) | (1<<4) | (1<<7) | (1<<8) | (1<<9)); set_mio_mux(5, (1<<0) | (1<<2) | (1<<3) | (1<<4) | (1<<7)); //enable RGB data //set_mio_mux(4, (1<<20) | (1<<22) | (1<<24));//6bits set_mio_mux(4, (0x3f<<20));//8bits resolution_data = set_lcd_output(fmt, &video_appmode); power_off_USBb(); break; #endif default: AVOS_printf("Please select the valid output mode!\n"); break; } GF_SetHdmode(cntl, &video_appmode.hdmode); af_set_current_resolution(resolution_data); af_init_osd(page); } this_curVideoFmt_Set(fmt); if(outputmode<=2&&outputmode>=0) { this_outputmode_Set(outputmode); } /////////////////////////////////////////// int video_fd; video_fd=open("/dev/video",O_RDONLY); //video_appmode_t video_appmode = {DISPCTL_MODE_480P, VIDEO_APPVMODE_480_480, VIDEO_APPHMODE_720, 0, DISPCTL_MODE_VGA}; video_appmode_t video_appmode2 = {DISPCTL_MODE_480P, VIDEO_APPVMODE_480_480, VIDEO_APPHMODE_720, 0, DISPCTL_MODE_VGA}; ioctl(video_fd, VIDEOIO_SETAPPMODE, &video_appmode2); WRITE_MPEG_REG(VENC_VDAC_SETTING,0); power_on_vdac(); /////////////////////////////////////////// AVTimeDly(100); /* end */ return ret; }