2008-01-07

Accelerating Qtopia

Back to the Badge Qtopia screen driver project again. Using the svgalib based screen driver example, we’ve created a custom paint engine that intercepts all painting operations. By adding loads of qDebug statements I can get a (dead slow) driver that creates a log of exactly what takes place – a good basis for understanding what to accelerate and how.

Speaking of acceleration, the QScreen class contained some easy to reach methods: solidFill and blit. These map pretty well to the operations implemented in hardware – the problem with the blit operation is that the source image is located in the processors memory while the destination is in the video memory. This reveals the big engineering challenge here – the bandwidth between the video memory and processor memory is limited. This is really not an uncommon scenario, and often something that you choose to do. By not having the GPU and CPU sharing the same memory bus both processors can work independently without disturbing each other. The issue is just how to pass data between the two. (This is exactly why modern PC graphics cards have huge memories – to avoid having to pass textures and such over the PCI bus all the time).

Transformations


Running some of the Qtopia demos using the verbose driver reveal quite a lot about acceleration and what to avoid. For example, gradients, rotation and scaling will be hard to do something about – at least initially. Another though thing is painter paths...

Painter paths with gradient

3 Comments:

At 4:28 PM, Blogger Ariya Hidayat said...

Unless the source image is a texture common in games etc, likely compression will help to speed up the transfer. I'll be happy to supply the (de)compression code :-)

 
At 4:44 PM, Anonymous Anonymous said...

"By adding loads of qDebug statements I can get a (dead slow) driver that creates a log of exactly what takes place"

Did you consider kcachegrind?

 
At 5:38 PM, Blogger Johan Thelin said...

Ariya, the Badge already has a decompression block making it possible to blit from compressed memory. You can even preload flash memory available from Badge with your graphics eliminating the need to move it by the CPU even once (great for fonts).

To anonymous - it is an Arm - does cachegrind support that platform?

 

Post a Comment

<< Home