Hardware scrolling on the Pi
Jon Abbott (1421) 2601 posts |
WhIlst testing ADFFS 2.72 on a Pi last night, I noticed a bug where on return from a legacy mode, hardware scrolling is still enabled. I’m not sure how to fix that particular issue, as GraphicsV doesn’t currently support mode specific drivers and the Features are obviously being checked before my mode emulator shuts down. The issue being that my GraphicsV driver supports hardware scrolling and the Pi’s GraphicsV driver doesn’t. That got me thinking. Can we not implement hardware scrolling on the Pi, by presenting the screen as several rectangles; one rectangle covering from the start of video memory and another covering the wrapped address area? Where the wrap doesn’t occur at the end of a raster, add a third and forth rectangle to cover the pixels to the wrap and to the end of the line. |
Jeffrey Lee (213) 6046 posts |
It’d need a fair bit of effort to implement it – we’d have to stop using the framebuffer that the mailbox interface sets up, and switch to using dispmanx buffers instead (you can have multiple displays of the same buffer on-screen at once). The same method can be used on OMAP hardware (since we can just set up multiple overlays to point to the same framebuffer) – although the limited number of overlays which are available makes it a bit trickier (especially since only one of the overlays supports paletted modes). A potentially better alternative for OMAP4 and 5 is to use the TILER hardware, which is effectively a full-blown MMU. So we could just double-map the memory from the GPU’s perspective, similar to how the OS double-maps it for CPU use. |
Jon Abbott (1421) 2601 posts |
The framebuffer is already a dispmanx buffer, but I’m guessing that’s being created via the mailbox. Would it not be a case of enabling hardware scrolling and then changing the mailbox call to instead call some code which creates 1 to 4 dispmanx layers depending on if/where the video memory wraps. Is there any documentation on our implementation of dispmanx? I think I just need vc_dispmanx_element_add() and vc_dispmanx_element_remove() to knock up a proof of concept. |
Jeffrey Lee (213) 6046 posts |
Maybe. I’m not sure exactly what the mailbox calls do.
Our implementation is internal to BCMVideo – so you’d either need to modify it directly, or create a separate implementation (I believe multiple clients can open connections to the same videocore service via VCHIQ) |