Hi all, I just fixed the scaler issue, but don't really know how to make/publish a patch - I read a bit about it, but since even the tabs are important, I'd prefer that someone else does it.
The problem itself - when using standard V4L2 loop for image acquisition from a camera and using scaler at the same time for digital zooming (with DISP_CMD_LAYER_SET_SRC_WINDOW for instance) the picture will flicker with contents of the address previously set via DISP_CMD_LAYER_SET_PARA. These are usually at 0, since framebuffer is set via DISP_CMD_VIDEO_SET_FB ioctl in the main V4L2 loop. Also, since usually there are multiple V4L2 buffers (I use 3-5), we cannot set some fixed addresses via DISP_CMD_LAYER_SET_PARA, as they're constantly changing. For digital zooming this is a big problem, since scaler uses these addresses to do reinit, and it will flicker because of scaler reconfiguration. The simplest way is to remove scaler reconfig in disp_scaler.c, but this is extremely dirty (comment out DE_SCAL_Config_Src() in Scaler_Set_SclRegn() function), and probably doesn't get good scaling results. Much better fix would be to properly update scaler addresses when video framebuffer is refreshed - this way scaler will properly reconfigure itself and there will be no flicker: So in disp_video.c the function BSP_disp_video_set_fb() should look like: __s32 BSP_disp_video_set_fb(__u32 sel, __u32 hid, __disp_video_fb_t *in_addr) { __disp_scaler_t *scaler; // added for fix hid = HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[sel].max_layers); if (g_video[sel][hid].enable) { memcpy(&g_video[sel][hid].video_new, in_addr, sizeof(__disp_video_fb_t)); g_video[sel][hid].have_got_frame = TRUE; g_video[sel][hid].display_cnt = 0; //--------------------------------------------------------------- // Fix for fb blinking during digital zoom issue: scaler = &(gdisp.scaler[sel]); scaler->in_fb.addr[0] = in_addr->addr[0]; scaler->in_fb.addr[1] = in_addr->addr[1]; scaler->in_fb.addr[2] = in_addr->addr[2]; //--------------------------------------------------------------- return DIS_SUCCESS; } else return DIS_FAIL; } This is the best and cleanest fix I could think of in order not to mess up the scaler reconfig code. If anyone is interested in making an official patch out of this, he's welcome to. -- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.