Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#11834 - Increase speed of SDL screen updates

Attached to Project: Rockbox
Opened by Thomas Jarosch (thomasjfox) - Friday, 24 December 2010, 14:52 GMT+2
Last edited by Thomas Martitz (kugel.) - Monday, 27 December 2010, 23:09 GMT+2
Task Type Patches
Category Simulator
Status Closed
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version Release 3.7.1
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

Hello,

attached is a patch to greatly speed up SDL screen updates
used by the simulator and RaaA (f.e. on the Nokia N900 ;)).

The current code calls SDL_FillRectangle() for every pixel, which is very slow.

We can speed things up greatly by using SDL_BlitSurface()
if the LCD_DEPTH is >= 8 and the pixel format is normal RGB.

Also don't call SDL_LockSurface() in the pixel-by-pixel code
as it's only needed if we are manipulating pixels directly.

Things to note:
- Right now it only works for LCD_DEPTH >= 8 and LCD_PIXELFORMAT == RGB565
- LCD_SoftStretch used for zooming is marked as unstable in the SDL API.

Best regards,
Thomas
   0001-Speed-up-SDL-screen-updates.patch (3.6 KiB)
 b/firmware/target/hosted/sdl/lcd-sdl.c    |   37 +++++++++++++++++++++++++-----
 b/firmware/target/hosted/sdl/system-sdl.c |   10 +++++---
 2 files changed, 38 insertions(+), 9 deletions(-)

This task depends upon

Closed by  Thomas Martitz (kugel.)
Monday, 27 December 2010, 23:09 GMT+2
Reason for closing:  Accepted
Additional comments about closing:  r28914. Thanks
Comment by Thomas Jarosch (thomasjfox) - Friday, 24 December 2010, 19:43 GMT+2
The #if statement in lcd-sdl.c should be like this:

#if LCD_DEPTH >= 8 && (LCD_PIXELFORMAT == RGB565) \
&& !defined(LCD_STRIDEFORMAT) && !defined(HAVE_LCD_SPLIT)

The previous version had a bug so it took the slow path on the N900.

Loading...