void Flush_Screen() { #if USE_OSD if(!ipu_inited) return; if((display_mode & DISP_ALL) == DISP_DIRECT) { if(pFunction) { pFunction(NULL); __dcache_writeback_all(); } }else{ if(ipu_inited) { PEND_IPU(); if(pFunction) { pFunction(lcd_get_current_cframe()); __dcache_writeback_all(); } if((unsigned int)lcd_get_current_phyframe() != useframebuf) lcd_change_frame(); } } #endif }
int jz47_put_image_with_framebuf (struct vf_instance_s* vf, mp_image_t *mpi, double pts) { //lcd_ioctl((void *)0,IOCTL_PENDING_IPU_END); //printf("+\n"); PEND_IPU(); //printf("-\n"); #if USE_OSD if(pFunction) pFunction(lcd_get_current_cframe()); #endif if((unsigned int)lcd_get_current_phyframe() != useframebuf) lcd_change_frame(); IPU_REG_OUT(IPU_Y_ADDR,PHY(mpi->planes[0])); IPU_REG_OUT(IPU_U_ADDR,PHY(mpi->planes[1])); IPU_REG_OUT(IPU_V_ADDR,PHY(mpi->planes[2])); IPU_REG_OUT(IPU_Y_STRIDE_ADDR,PHY(mpi->stride[0])); IPU_REG_OUT(IPU_UV_STRIDE_ADDR,(mpi->stride[1] << 16) |mpi->stride[2]); useframebuf = (unsigned int)lcd_get_change_phyframe(); //add_frame_buf(useframebuf); IPU_REG_OUT(IPU_OUT_ADDR,framebuf_offset + useframebuf); __dcache_writeback_all(); START_IPU(); return 1; }
int jz47_put_image_with_direct_ipu_nobuffer (struct vf_instance_s* vf, mp_image_t *mpi, double pts) { #ifdef VERIFY_CRC32 SwsContext *c = vf->priv->ctx; crc32_verify (mpi->planes[0], c->srcH, c->srcW, mpi->stride[0]); crc32_verify (mpi->planes[1], c->srcH / 2, c->srcW / 2, mpi->stride[1]); crc32_verify (mpi->planes[2], c->srcH / 2, c->srcW / 2, mpi->stride[2]); #endif #if USE_OSD if(pFunction) pFunction(NULL); #endif img_param.y_buf = (unsigned int)mpi->planes[0]; img_param.u_buf = (unsigned int)mpi->planes[1]; img_param.v_buf = (unsigned int)mpi->planes[2]; stride.y = mpi->stride[0]; stride.u = mpi->stride[1]; stride.v = mpi->stride[2]; if((unsigned int)mpi->planes[0] < (unsigned int)0xa0000000) __dcache_writeback_all(); ipu_ioctl((void *)0, IOCTL_IPU_CHANGE_BUFF); return 1; }
void exception_init(void) { write_c0_status(0x10000400); memcpy((void *)(A_K0BASE ), except_common_entry, 0x20); memcpy((void *)(A_K0BASE + 0x180), except_common_entry, 0x20); memcpy((void *)(A_K0BASE + 0x200), except_common_entry, 0x20); __dcache_writeback_all(); __icache_invalidate_all(); }
static int boot_of(void) { int fd, rc, len, i, checksum = 0; void (*kernel_entry)(int, void*, void*); printf("Mounting disk..."); rc = disk_mount_all(); if (rc <= 0) error(EDISK, rc, true); /* TODO: get this from the NAND flash instead of SD */ fd = open("/ccpmp.bin", O_RDONLY); if(fd < 0) return EFILE_NOT_FOUND; lseek(fd, 4, SEEK_SET); rc = read(fd, (char*)&len, 4); /* CPU is LE */ if(rc < 4) return EREAD_IMAGE_FAILED; len += 8; printf("Reading %d bytes...", len); lseek(fd, 0, SEEK_SET); rc = read(fd, (void*)0x80004000, len); if(rc < len) return EREAD_IMAGE_FAILED; close(fd); for(i=0; i<len; i++) checksum += ((unsigned char*)0x80004000)[i]; *((unsigned int*)0x80004000) = checksum; printf("Starting the OF..."); /* OF requires all clocks on */ __cpm_start_all(); disable_interrupt(); __dcache_writeback_all(); __icache_invalidate_all(); for(i=8000; i>0; i--) asm volatile("nop\n"); kernel_entry = (void*) 0x80004008; kernel_entry(0, "Jan 10 2008", "15:34:42"); /* Reversed from the SPL */ return 0; /* Shouldn't happen */ }
void atexitfunc(void) { KEY_STATUS KS; char buffer[256]; if (strlen(_buffer) > 0) { PutString(0, 7, _buffer); __dcache_writeback_all(); _lcd_set_frame(); do { kbd_get_status(&KS); } while ((KS.status & CONTROL_BUTTON_SELECT) == 0); } }
void Flush_OSDScrean() { #if USE_OSD if(!ipu_inited) return; // F("ipu_inited = %d\n",ipu_inited); if((display_mode & DISP_ALL) == DISP_DIRECT) { if(pFunction) { pFunction(NULL); __dcache_writeback_all(); } }else { if(ipu_inited) { PEND_IPU(); if(pFunction) { pFunction(lcd_get_current_cframe()); //memset(lcd_get_current_cframe(),0xff,get_screen_width() * 20); __dcache_writeback_all(); } if((unsigned int)lcd_get_current_phyframe() != useframebuf) lcd_change_frame(); //F("lcd_get_current_cframe() = %x\n",lcd_get_current_cframe()); //F("useframebuf = %x\n",useframebuf); //F("lcd_get_change_phyframe = %x\n",lcd_get_change_phyframe()); } } #endif }
void ds2_plug_exit(void) { //printf("In run_plugin\n"); disenable_nds(); //printf("In run_plugin 0\n"); disable_irq_all(); __dcache_writeback_all(); __icache_invalidate_all(); *(volatile unsigned short int*)cpld_ctr_addr = (1<<fifo_clear_bit); *(fpgaport*)cpld_ctr_addr = reset_main_nonds; *(fpgaport*)cpld_state_addr = BIT(8) | BIT(cpu_rtc_clk_enable_bit); //printf("In run_plugin 1 %08x\n", *(fpgaport*)cpld_ctr_addr); _do_reset(); }
int trace(int line, char* file) { KEY_STATUS KS; char buffer[256]; memset(buffer, ' ', 80); snprintf(buffer, sizeof(buffer), "%s <%d>", file, line); strcpy(_buffer, buffer); PutString(1, 5, buffer); __dcache_writeback_all(); _lcd_set_frame(); _kbd_get_status(&KS); if (KS.status & CONTROL_BUTTON_START) { exit(0); } mdelay(500); return EXIT_SUCCESS; }
void ds2_init(void) { pfunc *p; write_c0_status(0x10000400); memcpy((void *)A_K0BASE, except_common_entry, 0x20); memcpy((void *)(A_K0BASE + 0x180), except_common_entry, 0x20); memcpy((void *)(A_K0BASE + 0x200), except_common_entry, 0x20); __dcache_writeback_all(); __icache_invalidate_all(); init_perihery(); InitExcept(); _intc_init(); detect_clock(); // gpio_init(); // serial_init(); pm_init(); //dgprintf("\n\nOS initial!\n"); // OSInit(); /* Invoke constroctor functions when needed. */ #if 1 for (p=&__CTOR_END__[-1]; p >= __CTOR_LIST__; p--) { printf("create class %08x\n",p); (*p)(); } //dgprintf("Before main function\n"); #endif //Start system ticker _StartSysTimer(); //enable global interrupt sti(); }
void drawDraw() { int i, j; WORD* p = FrameBuffer - 8; for (i = 0; i < LCD_MAIN_H; i++) { for (j = 0; j < 8; j++) { *p++ = 0; } p += LCD_MAIN_W; for (j = 0; j < 8; j++) { *p++ = 0; } p += SCREEN_WIDTH - LCD_MAIN_W - 16; } __dcache_writeback_all(); _lcd_set_frame(); lcd_flip(); FrameBuffer = _lcd_get_frame() + SCREN_OFFSET; }
int jz47_put_image_with_direct_ipu_buffer (struct vf_instance_s* vf, mp_image_t *mpi, double pts) { #ifdef VERIFY_CRC32 SwsContext *c = vf->priv->ctx; crc32_verify (mpi->planes[0], c->srcH, c->srcW, mpi->stride[0]); crc32_verify (mpi->planes[1], c->srcH / 2, c->srcW / 2, mpi->stride[1]); crc32_verify (mpi->planes[2], c->srcH / 2, c->srcW / 2, mpi->stride[2]); #endif #if USE_OSD if(pFunction) pFunction(NULL); #endif if(yuv_next) { mpi_copy(yuv_next,mpi); yuv_next = yuv_next->nextframe; } if(yuv_cur) { // set Y(mpi->planes[0]), U(mpi->planes[1]), V addr (mpi->planes[2]) img_param.y_buf = yuv_cur->y_framebuf; // set U addr register (mpi->planes[1]) img_param.u_buf = yuv_cur->u_framebuf; // set V addr register (mpi->planes[2]) img_param.v_buf = yuv_cur->v_framebuf; // set Y(mpi->stride[0]) U(mpi->stride[1]) V(mpi->stride[2]) stride stride.y = yuv_cur->ystride; stride.u = yuv_cur->ustride; stride.v = yuv_cur->vstride; yuv_cur = yuv_cur->nextframe; __dcache_writeback_all(); ipu_ioctl((void *)0, IOCTL_IPU_CHANGE_BUFF); } return 1; }
void Init_Direct_Mode(mp_image_t *mpi) { if ((LCD_OUT & display_mode) == TV_OUT) { img_param.ipu_d_fmt |= (OUT_FMT_YUV422 | (1 << 16)); img_param.in_bpp = 16; } else { if(get_screen_bpp()==32){ img_param.ipu_d_fmt |= OUT_FMT_RGB888; img_param.in_bpp = 32; }else if(get_screen_bpp()==16){ img_param.ipu_d_fmt |= OUT_FMT_RGB565; img_param.in_bpp = 16; }else{ img_param.ipu_d_fmt |= OUT_FMT_RGB888; img_param.in_bpp = 32; } } if(display_mode & DECODE_BUFFER) { img_param.y_buf = mpi->planes[0]; img_param.u_buf = mpi->planes[1]; img_param.v_buf = mpi->planes[2]; stride.y = mpi->stride[0]; stride.u = mpi->stride[1]; stride.v = mpi->stride[2]; __dcache_writeback_all(); jz47_put_image_with_ipu = jz47_put_image_with_direct_ipu_nobuffer; printf("direct buf\n"); }else { CreateImage(mpi->width,mpi->height,mpi->chroma_width,mpi->chroma_height,mpi->bpp); mpi_copy(yuv_cur,mpi); img_param.y_buf = yuv_cur->y_framebuf; img_param.u_buf = yuv_cur->u_framebuf; img_param.v_buf = yuv_cur->v_framebuf; stride.y = yuv_cur->ystride; stride.u = yuv_cur->ustride; stride.v = yuv_cur->vstride; yuv_cur = yuv_cur->nextframe; jz47_put_image_with_ipu = jz47_put_image_with_direct_ipu_buffer; printf("create buf\n"); } printf("stride.y = %d\n",stride.y); printf("stride.u = %d\n",stride.u); printf("stride.v = %d\n",stride.v); printf("display_mode = %x\n",display_mode); if(init_pm_level == -1) { init_pm_level = -1; init_pm_level = kernel_ioctl(&init_pm_level,KERNEL_PM_CONTROL); int lcd_level = 0; lcd_level = kernel_ioctl(&lcd_level,KERNEL_BACKLIGHT_CTRL); codecs_t *codec = mplayer_get_code_info(1); int isrun_fast = 0; isrun_fast = (mpi->width * mpi->height >= 1280*720); if (!isrun_fast) isrun_fast = Is_Fast_Codes(codec->dll,mpi,"vc1",1024*576); if (!isrun_fast) isrun_fast = Is_Fast_Codes(codec->dll,mpi,"wmv3",1024*576); if (!isrun_fast) isrun_fast = Is_Fast_Codes(codec->dll,mpi,"h264",720*480); F("mplayer enter fast mode codecs = %s width = %d height = %d isrun_fast =%d\n",codec->dll,mpi->width,mpi->height,isrun_fast); if(isrun_fast) { int enablelcd = 0; kernel_ioctl(&enablelcd,KERNEL_LCD_CTRL); int curlevel = 4; kernel_ioctl(&curlevel,KERNEL_PM_CONTROL); //5 = 432000000 enablelcd = 1; kernel_ioctl(&enablelcd,KERNEL_LCD_CTRL); } lcd_ioctl(&img_param, IOCTL_DMA1_TO_IPU); usec_sleep(20000); kernel_ioctl(&lcd_level,KERNEL_BACKLIGHT_CTRL); }else { lcd_ioctl(&img_param, IOCTL_DMA1_TO_IPU); } }
void display_flip() { lcd_flip(); __dcache_writeback_all(); _lcd_set_frame(); }