
Originally Posted by
agd5f
The tear-free code is more of a proof of concept than anything else. I doubt it'll actually get merged to master.
It basically inserts a stall in the command stream to wait until the vline trigger is past the active area of the display. The problem is you don't really want to stall the engine if you can avoid it, plus, depending how large your command stream is, you may not finish rendering by the time the crtc starts scanning again anyway. The real solution is compositing and pageflipping. You'd basically do all of your rendering to a different buffer than you are currently scanning and then insert a page flip at the end of the command stream. As soon as the rendering was done, the buffer pointers would flip and the crtc would scan out of the newly rendered buffer at the next retrace. That way you are never rendering and scanning out of the same buffer at the same time.