Bug 102258

Summary: Up to 20% perf drop in texture sampling tests with "i965/surface_state: Get the aux usage from the miptree code"
Product: Mesa Reporter: Eero Tamminen <eero.t.tamminen>
Component: Drivers/DRI/i965Assignee: Jason Ekstrand <jason>
Status: VERIFIED FIXED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: medium    
Version: git   
Hardware: Other   
OS: All   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=102289
Whiteboard:
i915 platform: i915 features:

Description Eero Tamminen 2017-08-16 13:20:37 UTC
Bisecting on SKL GT2 revealed following commit:
----------------------------------------------------
commit dd75edb42982c1420168d509a7589032f7ead289
Author:     Jason Ekstrand <jason.ekstrand@intel.com>
AuthorDate: Wed Jun 21 21:23:20 2017 -0700
Commit:     Jason Ekstrand <jason.ekstrand@intel.com>
CommitDate: Sat Jul 22 20:59:22 2017 -0700

    i965/surface_state: Get the aux usage from the miptree code
    
    Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
----------------------------------------------------

To be responsible for following SKL GT2 performance drops:
- 8% in SynMark v7 TexFilterTri
- 5% in GfxBench v4 ALU2 (both onscreen & offscreen)
- 2% in SynMark v7 TexMem*
- 1% in SynMark v7 TexFilterAniso

(Tests are run in FullHD fullscreen.)

On BXT and SKL GT4e the drop is even larger, 15-20% on the filtering tests (and 10% in texture memory tests on SKL GT4e).

Note: I don't understand how surface handling changes can have that large impact on the GfxBench ALU2 test.  Although it does do some texture accesses, it should be ALU bound (and on BXT would greatly benefit from SIMD32).
Comment 1 Mark Janes 2017-08-16 19:08:28 UTC
I see an improvement in Manhattan scores, around the same time.  Eero, can you confirm the effect of this patch on Manhattan?
Comment 2 Eero Tamminen 2017-08-17 16:25:42 UTC
(In reply to Mark Janes from comment #1)
> I see an improvement in Manhattan scores, around the same time.  Eero, can
> you confirm the effect of this patch on Manhattan?

That commit doesn't affect Manhattan (enough that I could catch it with bisecting).

The commit improving Manhattan & CarChase performance is this:
--------------------------------------------------
commit 3e57e9494c2279580ad6a83ab8c065d01e7e634e
Author:     Jason Ekstrand <jason.ekstrand@intel.com>
AuthorDate: Wed Jun 21 21:35:07 2017 -0700
Commit:     Jason Ekstrand <jason.ekstrand@intel.com>
CommitDate: Sat Jul 22 20:59:22 2017 -0700

    i965: Enable regular fast-clears (CCS_D) on gen9+
--------------------------------------------------

And this commit improves Heaven & Valley:
--------------------------------------------------
commit f5859b45b1686e8116380d870f48432495fb19c7
Author:     Topi Pohjolainen <topi.pohjolainen@intel.com>
AuthorDate: Tue Jun 27 18:10:31 2017 +0300
Commit:     Topi Pohjolainen <topi.pohjolainen@intel.com>
CommitDate: Sat Jul 22 00:14:16 2017 +0300

    i965/miptree: Switch remaining surfaces to isl
--------------------------------------------------
Comment 3 Kenneth Graunke 2017-08-18 03:45:24 UTC
Jason sent a patch to the list:
https://lists.freedesktop.org/archives/mesa-dev/2017-August/166651.html
Comment 4 Jason Ekstrand 2017-08-19 00:36:30 UTC
This is fixed by the following commit in master:

commit 61d2f3f1c24323a1c067595ec78dfbfefdc72b41
Author: Jason Ekstrand <jason.ekstrand@intel.com>
Date:   Thu Aug 17 15:27:25 2017 -0700

    i965/miptree: Return NONE from texture_aux_usage when fully resolved
    
    This little optimization improves the performance of SynMark v7
    TexFilterTri by almost 10% on Sky Lake GT4 among other improvements.
    We've been doing it for some time but somehow it got dropped during
    the miptree refactoring.
    
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    Bugzilla: https://bugs.freedesktop.org/102258
    Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Comment 5 Eero Tamminen 2017-08-21 09:36:48 UTC
Verified.  Everything is back to previous performance except for TexFilterAniso on BXT (which had a huge drop of which most got fixed with this, but not all, I assume this to be due to bug 102272).
Comment 6 Eero Tamminen 2017-08-22 13:37:18 UTC
(In reply to Jason Ekstrand from comment #4)
> This is fixed by the following commit in master:
> 
> commit 61d2f3f1c24323a1c067595ec78dfbfefdc72b41
> Author: Jason Ekstrand <jason.ekstrand@intel.com>
> Date:   Thu Aug 17 15:27:25 2017 -0700
> 
>     i965/miptree: Return NONE from texture_aux_usage when fully resolved

Jason, any idea why the fix would drop GpuTest 0.7 FurMark performance couple of percent, but only on BXT?

(I saw it when using 1/2 HD windowed version, when running FurMark in FullHD fullscreen, I wasn't able to bisect it.  There's also similar SynMark v7 PSPom drop at the same time, but I wasn't able to bisect it with ezBench.

PSPom perf raised with the original bug 3-4%, but not FurMark one, that may be due to hashing mode impact on FurMark.)
Comment 7 Jason Ekstrand 2017-08-22 16:41:21 UTC
(In reply to Eero Tamminen from comment #6)
> Jason, any idea why the fix would drop GpuTest 0.7 FurMark performance
> couple of percent, but only on BXT?

Most likely because it does add a tiny bit of CPU overhead.  I thought about how to reduce the CPU overhead of this code but it's not incredibly obvious how to do it.

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.