Add rdp interlacing optimization to the display module #724
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Libdragon is rendering internally at a 480p even in interlaced mode, but the TV output is still 480i,
so this special mode makes use of the RDP's interlacing as well for the optimization.
But to actually make proper use of it, it needs a tight phased frame schedule between the RDP and VI to make sure that the frames drawn are latest and complete.
Moreover since the AA/dedithering algorithms use adjasent lines which may still be rendering by the RDP,
the phased schedule needs to account for that and only use fully drawn framebuffers for the VI.
Using this VI/RDP interlacing halvs the required fillrate to draw a frame and ideally doubles the framerate in high-res mode.
It only works if the Y scale is exactly 1.0 (i.e vertical resolution + borders should be = 640 (in NTSC) or 576 (in PAL)) and the number of buffers should be 3.
If you use this interlacing mode, make sure to enable rdpq_enable_interlaced() after rdpq_attach() as well.
Use display_interlace_rdp_field() to know which field you should draw each frame.