[cairo] Added mmx fast path for fbComposeCopyAreammx

Frederic Plourde frederic.plourde at polymtl.ca
Mon Mar 10 12:21:45 PDT 2008

Hi !

  While profiling some parts of the mmx codepath, I noticed that simple RGB
blitting (fbComposeCopyArea) from a8r8g8b8 to x8r8g8b8 sources was not being
accelerated at all by mmx!! I noticed it was because no mmx_fast_path was
declared for this very case :

{ PIXMAN_OP_SRC, PIXMAN_a8r8g8b8,  PIXMAN_null,	PIXMAN_x8r8g8b8,
fbCompositeCopyAreammx, 0 }...

...case which I simply added in pixman-pict.c

it might look weird to drive pixman_blt_mmx  between two incoherent sources (RGB
against ARGB), but since both surfaces are processed as 32 bpp, I don't see why
we couldn't use some speedup here simply adding this mmx_fast_path case.

Here's a speedup chart that supports this optimization :
A mean perf gain of 1.5X was observed for the image-rgb cases instead of 0.99 as
seen before this optim.

The associated patch is attached. I'd be please, Soeren, if took a look at it
thanx !


diff --git a/pixman/pixman-pict.c b/pixman/pixman-pict.c
index 4a97df9..9d34708 100644
--- a/pixman/pixman-pict.c
+++ b/pixman/pixman-pict.c
@@ -1473,6 +1473,7 @@ static const FastPathInfo mmx_fast_paths[] =

     { PIXMAN_OP_SRC, PIXMAN_a8r8g8b8,  PIXMAN_null,	PIXMAN_a8r8g8b8,
fbCompositeCopyAreammx, 0 },
     { PIXMAN_OP_SRC, PIXMAN_a8b8g8r8,  PIXMAN_null,	PIXMAN_a8b8g8r8,
fbCompositeCopyAreammx, 0 },
+    { PIXMAN_OP_SRC, PIXMAN_a8r8g8b8,  PIXMAN_null,	PIXMAN_x8r8g8b8,
fbCompositeCopyAreammx, 0 },
     { PIXMAN_OP_SRC, PIXMAN_x8r8g8b8,  PIXMAN_null,	PIXMAN_x8r8g8b8,
fbCompositeCopyAreammx, 0 },
     { PIXMAN_OP_SRC, PIXMAN_x8b8g8r8,  PIXMAN_null,	PIXMAN_x8b8g8r8,
fbCompositeCopyAreammx, 0 },
     { PIXMAN_OP_SRC, PIXMAN_r5g6b5,    PIXMAN_null,     PIXMAN_r5g6b5,
fbCompositeCopyAreammx, 0 },
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pixman_OPT_MMX_addFastPath_to_fbCompositeCopyAreammx.patch
Type: application/octet-stream
Size: 808 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20080310/e78cdcc0/attachment.obj 

More information about the cairo mailing list