[Mesa-dev] [PATCH] i965: Prefer Meta over the BLT for BlitFramebuffer.

Kenneth Graunke kenneth at whitecape.org
Wed Feb 25 00:18:43 PST 2015


On Wednesday, February 18, 2015 10:55:32 AM Pohjolainen, Topi wrote:
> On Tue, Feb 17, 2015 at 05:39:33PM -0800, Kenneth Graunke wrote:
> > There's some debate about whether we should use Meta or BLORP,
> > but either should run circles around the BLT engine.
> > 
> > In particular, this means that Gen8+ will use the 3D engine for blits,
> > like we do on Gen6-7.
> > 
> > Improves performance in "copypixrate -blit -back" (from Mesa demos)
> > by 232.037% +/- 3.15795% (n=10) on Broadwell GT3e.
> 
> I've been also experimenting with the same test by disabling blorp for
> fb-blits on IVB. I'm a little confused since even without your patch the blit
> goes through meta instead of the BLT engine. It is the test for scissor
> that prevents intel_blit_framebuffer_with_blitter() from doing the blit:
> 
> ...
>  /* If the source and destination are the same size with no mirroring,
>        * the rectangles are within the size of the texture and there is no
>        * scissor, then we can probably use the blit engine.
>        */
>       if (!(srcX0 - srcX1 == dstX0 - dstX1 &&
>             srcY0 - srcY1 == dstY0 - dstY1 &&
>             srcX1 >= srcX0 &&
>             srcY1 >= srcY0 &&
>             srcX0 >= 0 && srcX1 <= readFb->Width &&
>             srcY0 >= 0 && srcY1 <= readFb->Height &&
>             dstX0 >= 0 && dstX1 <= drawFb->Width &&
>             dstY0 >= 0 && dstY1 <= drawFb->Height &&
>             !(ctx->Scissor.EnableFlags))) {
>          perf_debug("glBlitFramebuffer(): non-1:1 blit.  "
>                     "Falling back to software rendering.\n");
> ...
> 
> I wonder where the performance difference actually comes from, could it
> be the intel_prepare_render() that intel_blit_framebuffer_with_blitter()
> calls before bailing out. With your patch that won't get called anymore.

Topi and I looked at this a little bit more tonight.  It turns out that
in a copypixrate -blit -back run, there were 35205 BLT and 58790 Meta
glBlitFramebuffer operations.  In other words, ~40% used the BLT.

So the performance improvement really does come from switching from BLT
to Meta after all...and in fact, our 232% improvement came while only
touching 40% of the blits.  Definitely a win.

That was on Broadwell.  I just checked Ivybridge, and got these numbers:
BLORP - 65292, Meta - 53685, BLT - 39771.
(-O2 vs -O0 matters a lot here, YMMV)

So I'm pretty convinced this is right.  
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150225/38b2a687/attachment.sig>


More information about the mesa-dev mailing list