Thread (4 messages) flat view 4 messages, 2 authors, 2002-08-07

RFC: Optimizing putcs()

From: Antonino Daplas <hidden>
Date: 2002-08-05 22:00:40

With fbcon-accel and the new drawing functions in linux-2.5, console
performance degraded compared to the linux-2.4 implementation.  This is
because putcs() has to to do 1 fb_imageblit() per character to be
drawn.  

This can be optimized by letting putcs() initially construct the row of
text to be drawn into an offscreen buffer, then do a single
fb_imageblit() in the end.  Performance wil increase for several
reasons:

	1. Drawing can be done in "bursts" instead of "trickles"

	2. For drivers that support accelerated drawing functions, the
offscreen buffer can be optionally placed in graphics (or AGP) memory,
which is better suited for most hardware that can only do blit's from
video memory to video memory.
	
	3.  Some level of asynchronicity can be achieved, ie, the hardware can
be blitting while fbcon-accel is constructing bitmaps.  This would
require "walking" the offscreen buffer, and support for hardware
graphics sync'ing on demand.

I have included a patch for 2.5.27 that implements it in fbcon-accel. 
It's preliminary, but I have tested it with cfb_imageblit and with
hardware imageblit, with buffers in System or Video memory.  

The code is also present for hardware syncing on demand, though
unimplemented.

For drivers that uses cfb_imageblit or similar, a code such as the one
below can be inserted during initialization:

info->pixmap.addr = (unsigned long) kmalloc(BUFFER_SIZE, GFP_KERNEL);
info->pixmap.size = BUFFER_SIZE;
info->pixmap.offset = 0;
info->pixmap.buf_align = 1;
info->pixmap.scan_align = 1;

Some benchmarks:

time cat /usr/src/linux/MAINTAINERS (40K text file)
mode: 1024x768@8bpp, y-panning disabled.

cfb_imageblit - no offscreen buffer (default)

real    0m13.586s
user    0m0.001s
sys     0m13.585s

cfb_imageblit - with offscreen buffer in system memory

real    0m10.708s
user    0m0.001s
sys     0m10.707s

hardware imageblit - no offscreen buffer

real    0m6.036s
user    0m0.001s
sys     0m6.035s

hardware imageblit - with offscreen buffer in graphics memory

real    0m3.160s
user    0m0.001s
sys     0m3.160s

hardware imageblit - graphics offscreen buffer + hardware sync on demand

real    0m1.843s
user    0m0.000s
sys     0m1.843s

Tony

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help