Rockbox

Tasklist

FS#2871 - faster LCD update for H300 with ASM

Attached to Project: Rockbox
Opened by Brandon Low (lostlogic) - Wednesday, 28 December 2005, 21:11 GMT
Last edited by Linus Nielsen Feltzing (linusnielsen) - Wednesday, 28 December 2005, 22:50 GMT
Task Type Patches
Category
Status Closed
Assigned To No-one
Operating System
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

using inline assembly, I've nearly halved the time
needed for lcd_update on the whole screen on the H340.
Thanks to amiconn for his help and tips on this. The
first 0-7 bytes and the last 0-7 bytes are still
transferred the same way they were before, but the bulk
of the data is transfered 8 words at a time using 4
registers for storage. Using a simple test plugin
which displays start and end times this showed 40s for
1000 updates vs. 21s for 1000 updates after the patch.

Further optimization suggested by amiconn was to
reverse the write order to avoid 1 swap per 2 words,
there is also space for improvement by writing more of
the function in assembly. I don't think the gains
would be worth it to do the leading and trailing
unaligned bytes in assembly, but it is certainly an option.
This task depends upon

Closed by  Linus Nielsen Feltzing (linusnielsen)
Wednesday, 28 December 2005, 22:50 GMT
Reason for closing:  Accepted
Comment by Brandon Low (lostlogic) - Wednesday, 28 December 2005, 21:59 GMT

Had the forumula for handling non-aligned data wrong.
Thanks again to amiconn for knowing memory math better than
me. Fortunately (maybe) it works either way, but will be
faster for certain rectangle updates the new way.
Comment by Linus Nielsen Feltzing (linusnielsen) - Wednesday, 28 December 2005, 22:50 GMT

Thanks, Brandon!

Loading...