Skip to contentSkip to conversation

2.5 atyfb on Sparc question

DISCUSSION Petr Vandrovec 2 participants 2 messages Aug 8, 2002 Framebuffer layer

lore
Share & tools
lore
#0 lore raw
Quoted 5 lines · James Simmons
Quoted 5 lines · James Simmons
Quoted 4 lines
Quoted 3 lines

I also hope that performance problems will be solved before we are
forced to not use putcs.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

It will be :-) I need to one align the data. Second I plan to implement the patch recently posted here.

Patch still showed about 100% slowdown against 2.4.x, if I interpreted yesterday's table correctly. It is better than 1000% slowdown, but still...

I could believe a slow down of 2x but 1000 I don't think so.

Message from Antonio Daplas
(http://www.geocrawler.com/lists/3/SourceForge/9276/0/9249087/)
says:
2.5 old (with offscreen buffers) 10.708
2.5 new 4.378
2.4 2.098

His first message
(http://www.geocrawler.com/lists/3/SourceForge/9276/25/9237029/)
listed 13.586 for old 2.5 code.

So you are right, old code was not 1000% slowdown, only 500%. But main problem is not speed of old code, but speed of new code. And if numbers are right, new code is still 100% slower than 2.4.x code was.
Petr Vandrovec

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#1 lore raw
Quoted 8 lines · Petr Vandrovec

Message from Antonio Daplas
(http://www.geocrawler.com/lists/3/SourceForge/9276/0/9249087/)
says:
2.5 old (with offscreen buffers) 10.708
2.5 new 4.378
2.4 2.098

Quoted 8 lines

His first message
(http://www.geocrawler.com/lists/3/SourceForge/9276/25/9237029/)
listed 13.586 for old 2.5 code.

So you are right, old code was not 1000% slowdown, only 500%. But main problem is not speed of old code, but speed of new code. And if numbers are right, new code is still 100% slower than 2.4.x code was.
Petr Vandrovec

The numbers are correct. However I'm only talking about software drawing here. With a few more optimizations with the code, the scroll time was further cut down to 3.780s. Also, 16bpp and 32bpp is now faster in 2.5 than in 2.4, although 24bpp is still a bit slower because of problems of its weird alignmment.

However, ALL hardware accelerated code is much faster than the old one, and will be much, much faster if hardware sync on demand is implemented. (I really want this James :)

The extra processing of the font bitmap in putcs() outweighs the benefit of "bulk" writing the data in 8bpp, but becomes insignificant as we go to higher color depths, or as we take advantage of hardware acceleration.

I'm attaching diffs for cfbimgblt.c, cfbfillrect.c, cfbcopyarea.c and fbcon-accel.c. This is against vanilla 2.5.27.

fbcon-accel.c:
process 4 characters at a time, if possible, to squeeze a few more CPU
cycles

cfbimgblt.c
divided into fast_imageblit (for 8, 16, 32 bpp), slow_imageblit (24
bpp) and bitwise_imageblit (default).

slow_imageblit involves packaging 4 pixels (or 8 if we have color depths

Quoted 1 line

32) which are written as double words (1 - 8bpp, 2 - 16bpp, 3 -

24bpp).

cfbcopyarea.c
uses fast_memmove and fb_memmove for 24 bpp. Anthing wrong with this
fb string functions? I seem not to see any performance degradation by using them.

cfbfillarea.c
Similar concept as slow_imageblit, packages 4-pixels in 24 bpp that are
written as 3 double words to the framebuffer.

Also is the double word access alignment a strict or optional
requirement?

Any comments?

Tony

drivers/video/cfbcopyarea.c +29 -2
diff -Naur linux-2.5.27/drivers/video/cfbcopyarea.c linux/drivers/video/cfbcopyarea.c
@@ -83,7 +83,7 @@
 		lineincr = -linesize;
 	}
 
-	if ((BITS_PER_LONG % p->var.bits_per_pixel) == 0) {
+	if ((BITS_PER_LONG % p->var.bits_per_pixel) == 0) {   
 		int ppw = BITS_PER_LONG / p->var.bits_per_pixel;
 		int n = ((area->width * p->var.bits_per_pixel) >> 3);
 
@@ -103,7 +103,6 @@
 			n -= end_index;
 		}
 		n /= bpl;
-
 		if (n <= 0) {
 			if (start_mask) {
 				if (end_mask)
@@ -219,4 +218,32 @@
 			}
 		}
 	}
+	else {
+		int n = ((area->width * p->var.bits_per_pixel) >> 3);
+		int n16 = (n >> 4) << 4;
+		int n_fract = n - n16;
+		int rows;
+
+		if (area->dy < area->sy
+		    || (area->dy == area->sy && area->dx < area->sx)) {
+			for (rows = height; rows--; ) {
+				if (n16)
+					fast_memmove(dst1, src1, n16);
+				if (n_fract)
+					fb_memmove(dst1+n16, src1+n16, n_fract);
+				dst1 += linesize;
+				src1 += linesize;
+			}
+		}
+		else {
+			for (rows = height; rows--; ) {
+				if (n16)
+					fast_memmove(dst1, src1, n16);
+				if (n_fract)
+					fb_memmove(dst1+n16, src1+n16, n_fract);
+				dst1 -= linesize;
+				src1 -= linesize;
+			}
+		}
+	}			
 }
drivers/video/cfbfillrect.c +56 -29

126 lines not on this page · raw message

drivers/video/cfbimgblt.c +235 -56

323 lines not on this page · raw message

drivers/video/fbcon-accel.c +108 -7

138 lines not on this page · raw message