Bug 109609

Summary: [SKL/CFL GT2] Up to 20% perf drop in Sacha Willems' Vulkan Triangle demo
Product: Mesa Reporter: Eero Tamminen <eero.t.tamminen>
Component: Drivers/DRI/i965Assignee: Kenneth Graunke <kenneth>
Status: VERIFIED FIXED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: minor    
Priority: medium    
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 109535    

Description Eero Tamminen 2019-02-11 17:40:56 UTC
Summary
-------

Between following Mesa commits:
  - 2018-12-13 17:49:48 9ebc00f32e: i965: Enable nir_opt_idiv_const for 32 and 64-bit integers
  - 2018-12-14 17:40:27 5c454661c6: i965/gen9: Add workarounds for object preemption

There's 10-20% perf drop in Sacha Willems' Vulkan Triangle demo.

Setup
-----

- SKL (i5) or CFL GT2 (desktop) device
- Ubuntu 18.04 w/ Unity
- drm-tip git kernel v4.20 or newer
- X server with modifier support enabled (newer than v1.20.0)
- Mesa git version


Test-case
---------

 ./triangle --fullscreen --benchmark --benchwarmup 3 --benchruntime 20


Notes
-----

* No other tests were impacted either
* Regression isn't visible at all on SKL GT3e / GT4e NUCs, nor on KBL GT2 NUC, BXT or earlier GENs
* Triangle demo is run at FullHD fullscreen, with Vsync disabled i.e. NOT using mailbox mode as that seems to get Vsynched although Vsync is supposed to be disabled (see patch attached to bug 109216)
Comment 1 Kenneth Graunke 2019-02-14 16:39:32 UTC
I can reproduce a 20% difference, but it's...actually a 20% improvement.  My system is a Kabylake GT2 (Dell XPS 15 9650), Kernel 4.20.2-arch1-1-ARCH, xserver 1.20.3.

It looks like a2ec78883f4 is slow, and 0b44644ca68 (genxml: Consistently use a numeric "MOCS" field) is 20% faster.  Needless to say, this is not expected, that patch was supposed to just change the mechanism for programming MOCS, not the actual values of MOCS used anywhere.
Comment 2 Kenneth Graunke 2019-02-14 17:04:16 UTC
Fix on list:
https://gitlab.freedesktop.org/mesa/mesa/merge_requests/255
Comment 3 Kenneth Graunke 2019-02-14 20:18:49 UTC
Fixed by

commit 39aee57523a02552e7eae7df5da488e535aeb1eb
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Thu Feb 14 08:55:37 2019 -0800

    anv: Put MOCS in the correct location
Comment 4 Eero Tamminen 2019-02-19 12:05:06 UTC
Verified, Vulkan triangle perf on regressing 3 platforms improved back to original level.  Results on other platforms and other test-cases were within daily variance.

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.