Le 24/05/2018 ? 12:34, Baruch Siach a ?crit : > Another option is to forward port the rockchip-vcodec shim driver for the MPP > framework. I'm aware of Myy Miouyouyou's work[1] in this area. But this driver > seems unusable as well. Testing v4.17-rc6, the PM code fails to enable the > video power domain (the hvec power domain enables correctly, though). The > error is: > > rockchip-pm-domain ff730000.power-management:power-controller: failed to get ack on domain 'pd_video', val=0x8021c I currently didn't test this driver on that version. Though, the latest "non-crashing" branch was the branch "retry" . Anyway, it took me a lot of (too much) time to understand how the driver worked at the first place (What MMIO address it is writing, which data comes where, ...). The pages of TRM providing the useful registers description being removed to avoid infringing some NDA with the VPU chipmaker (at least it was the explanation I got), I didn't make it far by analysing the VPU code, which is closely related to MPP. IIRC (I'm at work, cannot check the code right now) The way that driver worked, in the 4.4 kernel, was : * MPP sets up a big data structure corresponding to the VPU registers and sends it to the VPU driver, though an ioctl. * The VPU driver receives the data structure and interprets it as a uint32_t table, corresponding to the registers and do some magic things with some indices, setups the IOMMU so that the VPU can write the resulting frame, through a DMA operation, to some memory buffer provided by the user, and starts the decoding process. * MPP sends an ioctl to the VPU in order to know the ETA of the VPU job. * The VPU sends back the ETA to MPP in return to that ioctl call. Now, that driver has a lot of weird IOMMU code that should be there. For example, it does DMA SG tables remapping by hand, taking into account IOMMU alignment restrictions... That code is now deprecated in the new kernels which should use the proper IOMMU helpers put in place. Also, if you look at the rockchip kernel, there's another V4L2 driver written by part of the Chromium and Rockchip team, which describes everything in a clear fashion so now I'm aiming to retest the whole thing, based on these information. If that works, I'll try to mimic that V4L2 driver, in a way that works with mainline kernels (which moved the whole video formats handling into the user-space library it seems). Here's the file describing the registers https://github.com/rockchip-linux/kernel/blob/release-4.4/drivers/media/platform/rockchip-vpu/rk3288_vpu_regs.h and the whole new code is here : https://github.com/rockchip-linux/kernel/tree/release-4.4/drivers/media/platform/rockchip-vpu -- Myy