V3DLib icon indicating copy to clipboard operation
V3DLib copied to clipboard

Editing framebuffer device

Open nitko12 opened this issue 2 years ago • 1 comments

Hi guys,

for a few days now, I've been trying to drive an epaper display as a second framebuffer copying the main one, but the time it takes to copy and process that data using a cpu is too much for it to be practical.

I've been wondering then would it be possible to access framebuffer data (I presume it's in the GPU mem) by qpu-s and offload the processing to them?

All examples I've seen, including this lib, use a mailbox allocated GPU mem, so how should I go about accessing the preallocated fb memory, could the mailbox with different settings do that?

Any tips would be appreciated :)

P.S. I know this ain't really an issue but I couldn't find any other contact from you guys.

nitko12 avatar Feb 16 '23 08:02 nitko12

Hi nitko, I'm currently looking at creating a fork of this library so I've spent a great deal of time looking at the the inner workings and the VC4 documentation. So far to me it seems the GPU doesn't really have direct access to the frame buffer, and certainly not through the QPUs. However, it seems some fragment shader programs can implicitly write to the frame buffer by filling up the TLB (Tile Buffer), or you could use the V3D control lists to copy the entire TLB at once. Neither option is currently supported by V3DLib. I also haven't been able to discover where the frame buffer actually is, but it appears to be some location in main memory. In theory you could use a QPU to DMA the frame buffer into the VPM and then use DMA again to write it out elsewhere, but I haven't looked into frame buffer stuff because that's not really within the scope of this project. It really might just be as simple as I described and the frame buffer base address is just out there.

As far as using the mailbox goes, it's still quite opaque to me what actually happens there since most of the source code provided by Broadcom doesn't really say much about what mailbox properties do what. Wim should have more insight in this, but unfortunately he hasn't been around for a while. Personally I'd prefer to just get rid of the mailbox system entirely and access the hardware directly, which should be possible in theory but it might require a special driver.

LoekHabets avatar Jun 21 '23 12:06 LoekHabets