On Tue, 22 Apr 2014 06:14:40 -0700 (PDT)
Ivan Kozic <[email protected]> wrote:

> 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 linux-sunxi wiki has some information about submitting patches:
    http://linux-sunxi.org/Mailing_list#Submitting_patches

Maybe this wiki page could be extended to provide some super simplistic
explanation of the minimal actions that are needed to be taken.

Anyway, without having your fix presented as a patch, it is rather
cumbersome to correctly apply your changes to the kernel sources and
test them.

> 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.

Can we have a small test program, which reproduces the problem?

> 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.

For somebody else to make a patch and sign-off it, this somebody else
at least has to reproduce the problem and verify that the fix helps.

>From what I can see, this code path is not taken at all for the XV
overlay in the xf86-video-fbturbo driver and also in libvdpau-sunxi.
Which suggests at least some redundancy in the disp ioctls.

Thanks for bringing this up, just a little bit more details would be
welcome.

-- 
Best regards,
Siarhei Siamashka

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to