Bug 64213

Summary: [bisected] HD4000 performance regression in Epic Citadel (Unreal Engine WebGL demo)
Product: Mesa Reporter: Vedran Rodic <vrodic>
Component: Drivers/DRI/i965Assignee: Eric Anholt <eric>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: eric, kenneth
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: fix epic citadel (unreal engine web gl demo)
better version of patch that shows the crux of the matter (as suggested by Alexander Monakov on #intel-gfx)

Description Vedran Rodic 2013-05-04 12:50:47 UTC
Created attachment 78841 [details]
fix epic citadel (unreal engine web gl demo)

Environment details:

Linux vedran-ThinkPad-X230 3.8.0-19-generic #30-Ubuntu SMP Wed May 1 16:35:23 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Ubuntu 13.04

Xorg edgers X userland, Mesa from GIT



I'm using Firefox 23 nightly to run Epic Citadel, the WebGL demo of Unreal Engine 

http://www.unrealengine.com/html5/

Latest Mesa has a major performance regression (arround 1 FPS compared to a quite smooth framerate from Mesa 9.1.1)

I did a bisect and it turns out that this is the bad commit:

http://cgit.freedesktop.org/mesa/mesa/commit/?id=55ecc448b9d05e9f1e5ceb88ab35606e80e3adee

Attached is a patch for current GIT. The commit can't be directly reverted, so this is probably incorrect, but fixes the issue for me.
Comment 1 Vedran Rodic 2013-05-04 13:11:52 UTC
Created attachment 78842 [details]
better version of patch that shows the crux of the matter (as suggested by Alexander Monakov on #intel-gfx)
Comment 2 Kenneth Graunke 2013-05-04 18:50:06 UTC
Now that we're using Y-tiling, MapTextureImage can't use the BLT path, so it falls back to GTT mapping, which is really slow.  It makes ReadPixels eat 65% of the CPU when it used to use hardly any.

I see a couple of solutions to this:
1. Implement map/unmap via BLORP
2. Implement Y-tiling support for BLTs on Gen7+
3. Only Y-tile compressed formats for now?

#1 requires hooking into blorp at a lower level than is done currently, so it's non-trivial but looks doable.  #2 means MI_LOAD_REGISTER_IMM'ing a register, with all the known issues there.  #3 is easy, but I'd have to measure the performance cost.

Eric, thoughts?  Other ideas?
Comment 3 Eric Anholt 2013-05-07 00:39:33 UTC
Patch series on the list that gets things back to where they probably were before.  Note that for actual decent performance you need to go to about:config  and set"layers.acceleration.force-enabled".  I've been chatting with the moz folks and they seem pretty open to whitelisting us pending a bit of perf testing, so hopefully this will get better soon.
Comment 4 Vedran Rodic 2013-05-08 12:11:18 UTC
Confirmed fixed. 

layers.acceleration.force-enabled helps a lot 43.6 FPS compared to 18.9 before.

And Y tiling definitely helps, I tried mesa git with X tiling forced (modified intel_mipmap_tree) just to test, and I got 41.8 FPS. 

Thanks

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.