Hi,
I was able to get rid of the L3 errors when using TILER 2D buffer. Patch attached. It's illegal to use caching on TILER 2D buffers, so that was causing the issues.
As for the Pyra, my main recommendation is still the same: if you more or less always want landscape oriented picture, get a landscape oriented LCD. That will avoid huge amounts of much trouble. Believe me, I've worked with the similar issues since omap2 times =).
But I understand that may not be an option. So, about TILER. I still believe it is possible to use TILER for this. The main problem with the performance issues seen is the design of the tiler code in omapdrm. It has not been designed with CPU access in mind.
What it does currently is that instead of memory mapping the whole TILER buffer, as one would do for a normal buffer, it only uses two pages, which it will remap using page faults.
This pretty much kills the performance if you do random single pixel accesses all around the buffer. It'll take minutes to go through the full 1020p frame. Of course, that gives you very bad performance even with normal buffers, so it's not a realistic use case.
Using memcpy to read/write a full line from the tiler buffer gives better performance, but it's still not very good. Probably not even good enough to be usable.
So, what can be done.
If the CPU is used to draw the frame, and it's likely that the CPU will also read from the frame, and write non-sequentially, I think it's clear that a separate back buffer needs to be used. The back buffer can be mmaped to cpu normally, with full caching. After the drawing is done, caches have to be flushed, and then the buffer can be copied to the TILER buffer.
It could be that the omap xorg driver already does this (or maybe not, no idea). X does have shadow buffer stuff there, which I think does something like that.
However, as I said above, with my testing the memcpy is still on the slow side, so even the back buffer may not be fast enough.
I see a few ways to make the copying faster:
- Optimize the current mmapping code (I don't know if there's anything to optimize, though)
- Add support to omapdrm to mmap the whole tiler buffer. I think this should be doable, but it will waste more tiler space which the current code is trying to avoid.
- Use system DMA to do the copy. I don't know what the performance difference with copying with sDMA and CPU is for normal buffers, but in this case using sDMA would avoid the whole mmapping issue totally. (Actually, the copying could maybe also be done with DSP, SGX or any other HW component that supports mem copying, but sDMA is perhaps the easiest).
Tomi