AnsweredAssumed Answered

Is it possible to set  custom DMA buffer as the overlay framebuffer?

Question asked by dv1 on Feb 21, 2015

Hello, on the i.MX6, in addition to the default framebuffer, there is one that is used as an overlay. The device node is /dev/fb1 here. The framebuffer's name is "ipu0-1st-ovfb".

I want to use this overlay to display VPU-decoded frames with complete zerocopy. By complete I mean zero blits: the video pixels shall be drawn when the display is refreshed. This ensures optimal bandwidth usage.

 

However, there is one problem to this: the overlay buffer is fixed, and has a fixed physical address. This is fundamentally incompatible with the way media frameworks like GStreamer operate, and in particular, how the VPU works. The VPU requires a set of buffers to be allocated and registered, and form up the VPU's buffer pool. The VPU itself automatically chooses which buffer to decode a frame into. It cannot be told to always decode a frame into one specific buffer (like, the overlay framebuffer). This would anyway never work with bitstreams like h.264, which have complex requirements that require multiple other frames to be present in the buffers (for prediction).

 

So, I see no way to avoid the one blit  / DMA transfer from the VPU framebuffer to the overlay framebuffer, unless it is somehow possible to instruct the i.MX6 to use a different buffer's physical address as the backing store for the overlay.

 

Any ideas?

 

Oh, also, I know of V4L, but (a) it is not available on CuBox-i / HummingBoard devices , (b) I'd prefer a solution where the video output mechanism adjusts itself to the physical addresses of incoming DMA buffers, and not the other way round (that is, does not require decoders etc. to use a specific set of buffers).

Outcomes