Skip to contentSkip to conversation

problem: reading from (rivafb) framebuffer is really slow

DISCUSSION Felix von Leitner 3 participants 3 messages May 18, 2001

lore
Share & tools
lore
#0 lore raw

When benchmarking DirectFB, I found that a typical software alpha blending rectangle fill is completely dominated (I'm talking 90% of the CPU cycles here) by the time it takes to read pixels from the framebuffer.

The pixels are read linearly in chunks of aligned 32-bit words. It's a Geforce 2 GTS in 1024x768 with 32-bit color depth using rivafb. This looks quite crass to me. Any ideas? Maybe rivafb does not initialize AGP and the card is in PCI mode or something?

Felix

#1 lore raw
Quoted 4 lines

When benchmarking DirectFB, I found that a typical software alpha blending rectangle fill is completely dominated (I'm talking 90% of the CPU cycles here) by the time it takes to read pixels from the framebuffer.

I would expect that. Guess why X11 is designed not to do this.

Quoted 4 lines

The pixels are read linearly in chunks of aligned 32-bit words. It's a Geforce 2 GTS in 1024x768 with 32-bit color depth using rivafb. This looks quite crass to me. Any ideas? Maybe rivafb does not initialize AGP and the card is in PCI mode or something?

Writes across the PCI bus are posted, and potentially merged. Read posting is rather harder to do. This is one reason to keep copies of data or to use DMA or textures from AGP space to speed up access to the data you need.

In general pci write = fast, pci read = slow. High performance subsystems you write to their pci memory they DMA back to your main memory.

Alan

#2 lore raw
In reply to Felix von Leitner
Quoted 5 lines

When benchmarking DirectFB, I found that a typical software alpha blending rectangle fill is completely dominated (I'm talking 90% of the CPU cycles here) by the time it takes to read pixels from the framebuffer.

Note the SOFTWARE alpha blending rectangle fill. You are passing alot of data over the bus. So slooooooooow. If you implement a accelerated function you will not have this problem.