On Wed, 05 Mar 2014 20:32:42 +0100
Andreas Baierl <l...@imkreisrum.de> wrote:

> Am 04.03.2014 11:56, schrieb Andreas Baierl:
> > Hi all,
> > it seems, that the G2D kernel driver has some issue:
> >
> > libvdpau-sunxi uses G2D_CMD_BITBLT for creating surfaces, so at the 
> > end of mixer_blt, there is g2d_wait_cmd_finish() called.
> > As soon as (timeout==0) gets TRUE in 
> > https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-3.4/drivers/char/sunxi_g2d/g2d.c#L120
> >  
> > , g2d stops working.
> > It's not possible to interact with /dev/g2d anymore until you reboot 
> > (or possibly un-/reload the module).
> >
> > I'm not sure how to exactly reproduce that. It mostly occurs the 
> > second time i start VDR with libvdpau-sunxi and OSD.
> >
> > Regards
> > rellla
> >
> I don't know if it's related to the above, but unloading the kernel 
> module g2d_23 after it stopped working with the "wait g2d irq pending 
> flag timeout" message shows me the following log:
> 
> [  735.058259] [DISP] layer allocated: 0,102
> [  735.065332] [DISP] layer allocated: 0,103
> [  735.227857] wait g2d irq pending flag timeout
> [  783.215100] [DISP] layer released: 0,102
> [  783.222385] [DISP] layer released: 0,103
> [  792.500779] [DISP] layer released: 0,101
> [  792.541549] UMP<2>: Session closed
> [  795.070534] G2D: g2d_module_exit
> [  795.080032] G2D: Driver unloaded succesfully.
> [  795.092261] ------------[ cut here ]------------
> [  795.105471] WARNING: at drivers/base/core.c:196 
> device_release+0x78/0x84()
> [  795.122342] Device 'g2d' does not have a release() function, it is 
> broken and must be fixed.
> [  795.135209] Modules linked in: disp_ump mali_drm drm g2d_23(-) 
> sunxi_cedar_mod sw_ahci_platform mali ump
> [  795.162378] [<c0014a4c>] (unwind_backtrace+0x0/0x138) from 
> [<c0031e10>] (warn_slowpath_common+0x4c/0x64)
> [  795.183234] [<c0031e10>] (warn_slowpath_common+0x4c/0x64) from 
> [<c0031ebc>] (warn_slowpath_fmt+0x30/0x40)
> [  795.203586] [<c0031ebc>] (warn_slowpath_fmt+0x30/0x40) from 
> [<c0309ae0>] (device_release+0x78/0x84)
> [  795.223412] [<c0309ae0>] (device_release+0x78/0x84) from [<c028ba3c>] 
> (kobject_release+0x98/0x1bc)
> [  795.244079] [<c028ba3c>] (kobject_release+0x98/0x1bc) from 
> [<bf04f54c>] (g2d_module_exit+0x34/0x68 [g2d_23])
> [  795.266065] [<bf04f54c>] (g2d_module_exit+0x34/0x68 [g2d_23]) from 
> [<c006c00c>] (sys_delete_module+0x1ac/0x28c)
> [  795.287740] [<c006c00c>] (sys_delete_module+0x1ac/0x28c) from 
> [<c000ea80>] (ret_fast_syscall+0x0/0x30)
> [  795.304222] ---[ end trace ec0a564270cd7879 ]---

It just says that the driver does not provide the release() function.

These drivers are were poorly coded and apparently were never supposed
to be even loaded/unloaded at runtime. I fixed some of the really grave
show stopper problems earlier, but did not touch the rest:
- "sunxi-g2d: Fix mismatch between request_irq and free_irq"
     https://github.com/linux-sunxi/linux-sunxi/commit/bf2445b68175d0f2
- "sunxi: cedar: Fix oops on loading/unloading the cedar module"
     https://github.com/linux-sunxi/linux-sunxi/commit/4457f3998a6f57af

The Allwinner G2D driver bundles its own funky memory allocation API
for the userland and it would make sense to make sure that all the
resources are released properly. However since I have never tried to
use this allocator, I just don't want to touch it and have no means to
test it. I would be even in favour of just dropping this memory
allocation and mapping code, but supposedly this might be used by
Android (by the mythical users of the linux-sunxi kernels).

For Linux it makes a lot of sense to have a new driver for G2D
hardware, leaving the old driver alone just for Android use.

-- 
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 linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to