Bug 84958 - [BDW] Screen stop at certain frame when running Synmark2 cases while FPS is updating
Summary: [BDW] Screen stop at certain frame when running Synmark2 cases while FPS is u...
Status: VERIFIED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: git
Hardware: All Linux (All)
: medium major
Assignee: Chris Wilson
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
: 85060 (view as bug list)
Depends on:
Blocks: 85060
  Show dependency treegraph
 
Reported: 2014-10-13 07:29 UTC by lili
Modified: 2014-11-20 17:11 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Xorg.log (15.97 KB, text/plain)
2014-10-13 07:29 UTC, lili
no flags Details
Context before OglDeferred (213.83 KB, text/plain)
2014-11-05 17:15 UTC, Chris Wilson
no flags Details
Context (broken) after OglDeferred (213.98 KB, text/plain)
2014-11-05 17:15 UTC, Chris Wilson
no flags Details

Description lili 2014-10-13 07:29:53 UTC
Created attachment 107762 [details]
Xorg.log

Environment:
-----------------------------------
Platform:BDW
Libdrm:(master)libdrm-2.4.52
Mesa:c90cd077bd9c1c103d8ef36d6286599af5b3645e
Xserver:(server-1.15-branch)xorg-server-1.15.0
Xf86_video_intel:(master)2.99.910
Cairo:(master)8e11a42e3e9b679dce97ac45cd8b47322536a253
Libva:(master)ffdcb500fe50f927a55e35ab19434157fc90f39b
Libva_intel_driver:(master)f393de526b37a964572b1e5ea326bef826890d2c

Bug detailed description:
----------------------------------------------
The screen cannot update(froze at certain frame) issue when running Synmark2 cases,This issue exist on BDW platform,it doesn't exist on IVB/HSW/BYT-M.

For this issue,we have done the below verification:
1.Changed to X11R7 and the Kernel to Q2 and Q3 version,it still happens.By now there is no good point. Please refer to Xorg.log.

2.We tried GFX SW stack as below,still see BDW test machine screen freeze at certain frame.
Mesa and kernel using the latest version . xf86-video-intel: (master)2.99.910(2014-03-24) . xorg-server: (server-1.15-branch)xorg-server-1.15.0(2014-03-24)

Test with below cases:
- OglDeferred
- OglDeferredAA
- OglDrvRes
- OglDrvShComp
- OglDrvState
- OglTerrainFlyInst
- OglTerrainPanInst
- OglVSInstancing

Reproduce steps:
---------------------------------------------
1, xinit
2, ./synmark2 OglDeferred
Comment 1 Eero Tamminen 2014-10-15 13:27:54 UTC
Issue is not visible with latest kernel & Mesa on top of Ubuntu 14.04 X server (1.15.1) and X video driver (2.99.910), but updating X server and X video driver makes it visible (or having latest X & X intel video driver with old Mesa & kernel).
-> seems like X issue, moving.  

It's BDW specific and has been there at least from Spring.

The issue is that although tests render correctly and report fine FPS numbers, those rendered frames aren't shown on screen.  If SynMark2 validates the window content (reads & compares it against correct version), that frame shows on display just fine.  I.e. one cannot use test-automation to detect the issue, it needs to be verified from screen externally/manually.

Only the first (= validated/read) frame in test is visible after context creation.  Tests themselves haven't stopped as they report good FPS values when test completes.  In SynMark context re-creation test one can see several frames, but that test re-creates the context on every frame.

In which tests this happens, can change after reboot, and when 3D stack is updated, so it could be (context creation?) timing related.

Wendy, didn't you see this also in some other test than SynMark (Lightmark 2008?).
Comment 2 wendy.wang 2014-10-15 13:41:04 UTC
Yes, besides Synmark2_v6 cases, we test lightsmark v2008 whose screen also will stop at 1st frame, but lighsmark was good on 2014-09-03 gfx sw stack(while Synmark2_v6 still bad on that day)

2014-09-03 whole gfx sw stack:
Libdrm:		(master)libdrm-2.4.56-21-g8c2ae1695913990cbe6c6a8aa294f354eba33bd0
 Mesa:		(master)2adf7ee92e19ca978d6dac29fead59f14d033f3e
 Xserver:		(master)xorg-server-1.16.0-152-g3a51418b2db353519a1779cf3cebbcc9afba2520
 Xf86_video_intel:		(master)2.99.914-86-g48a33fc379b17eed195875222ad773c911d9dff1
 Cairo:		(master)8e11a42e3e9b679dce97ac45cd8b47322536a253
 Libva:		(master)c356638098e55453d2fac8bbb92eafc8cc32d6f4
 Libva_intel_driver:		(master)865f288d6821dfea5a9dc2a0525eba69ef786b23
 Kernel:   (drm-intel-nightly)2b1159961e4bc38a9090f8ec0ab6f16701dbdf81
Comment 3 Chris Wilson 2014-10-24 15:53:58 UTC
 ./synmark2 OglDeferred
Exception caught in OglDeferred: The GL_NV_primitive_restart extension is required.

 ./synmark2 OglDrvRes    
Exception caught in OglDrvRes: Cannot create test named: 'OglDrvRes', probably due to unknown test name specification.

What version of synmark are you using?
Comment 4 Eero Tamminen 2014-10-24 17:13:12 UTC
v6.  DrvRes was named DrvRes1 in older version and it unnecessarily wanted primitive restart extension in newer GL versions although it's there in core (fixed in v6).
Comment 5 Chris Wilson 2014-10-25 19:24:43 UTC
The problem is that something is left in the render context that isn't being reset by X - doing a restore of the default context on the context switch back to X fixes it. Only question is what! I might just do a context diff before after to see what is changed by mesa.
Comment 6 Chris Wilson 2014-11-05 14:10:47 UTC
fwiw, gem_render_copy also fails the same way afterwards.
Comment 7 Chris Wilson 2014-11-05 17:14:44 UTC
Recording the "golden" ctx after reset and using that is sufficient to prevent the bug. This is the difference in ctx state when running gem_render_copy before/after ./synmark2 OglDeferred

--- before.txt  2014-11-05 17:07:52.897903909 +0000
+++ after.txt   2014-11-05 17:09:21.825902317 +0000
@@ -4,7 +4,7 @@
 [0008] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
 [0010] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
 [0018] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
-[0020] 0x00000000 0x11001011 0x000023a8 0x00001626 0x0000228c 0x00000000 0x00002288 0xa4b67000
+[0020] 0x00000000 0x11001011 0x000023a8 0x0b0ab248 0x0000228c 0x00000000 0x00002288 0xa4b67000
 [0028] 0x00002284 0x00000000 0x00002280 0xa4b66000 0x0000227c 0x00000000 0x00002278 0xa4b65000
 [0030] 0x00002274 0x00000000 0x00002270 0xa4b64000 0x00000000 0x00000000 0x00000000 0x00000000
 [0038] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
@@ -12,18 +12,18 @@
 [0048] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
 [0050] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x110010d7 0x00002028 0xffff0880
 [0058] 0x0000209c 0xfeff4000 0x000020c0 0xefdf6080 0x00002178 0x00000001 0x0000217c 0x00145855
-[0060] 0x000021f0 0x00000000 0x00002310 0x00000003 0x00002314 0x00000000 0x00002318 0x00000001
-[0068] 0x0000231c 0x00000000 0x00002320 0x00000000 0x00002324 0x00000000 0x00002300 0x00000000
+[0060] 0x000021f0 0x00000000 0x00002310 0x0001e8a7 0x00002314 0x00000000 0x00002318 0x0000a2ed
+[0068] 0x0000231c 0x00000000 0x00002320 0x007839ac 0x00002324 0x00000000 0x00002300 0x00000000
 [0070] 0x00002304 0x00000000 0x00002308 0x00000000 0x0000230c 0x00000000 0x00002328 0x00000000
-[0078] 0x0000232c 0x00000000 0x00002330 0x00000000 0x00002334 0x00000000 0x00002338 0x00000000
-[0080] 0x0000233c 0x00000000 0x00002340 0x00000000 0x00002344 0x00000000 0x000022c8 0x00000000
-[0088] 0x000022cc 0x00000000 0x000022d8 0x00000000 0x000022dc 0x00000000 0x00002358 0xb5bc048f
+[0078] 0x0000232c 0x00000000 0x00002330 0x00000000 0x00002334 0x00000000 0x00002338 0x008dcc38
+[0080] 0x0000233c 0x00000000 0x00002340 0x00837b77 0x00002344 0x00000000 0x000022c8 0x893c7d60
+[0088] 0x000022cc 0x00000005 0x000022d8 0x5515d3dd 0x000022dc 0x00000001 0x00002358 0xf7d6ec29
 [0090] 0x00002580 0x00000000 0x00002500 0x00000000 0x00002504 0x00000000 0x00002508 0x00000000
 [0098] 0x00002400 0x00000000 0x00002404 0x00000000 0x00002408 0x00000000 0x0000240c 0x00000000
 [00a0] 0x00002410 0x00000000 0x00002414 0x00000000 0x00002418 0x00000000 0x00002420 0x00000000
 [00a8] 0x00002430 0x00000000 0x00002434 0x00000000 0x00002438 0x00000000 0x0000243c 0x00000000
-[00b0] 0x00002440 0x00000000 0x00002290 0x00000000 0x00002294 0x00000000 0x000022f0 0x00000000
-[00b8] 0x000022f4 0x00000000 0x000022f8 0x00000000 0x000022fc 0x00000000 0x00002170 0x00000000
+[00b0] 0x00002440 0x00000000 0x00002290 0x00000000 0x00002294 0x00000000 0x000022f0 0x8971ecd0
+[00b8] 0x000022f4 0x00000005 0x000022f8 0x552281f6 0x000022fc 0x00000001 0x00002170 0x00000000
 [00c0] 0x00002150 0xffde6000 0x00002154 0x00000450 0x00002158 0x00000001 0x0000215c 0x00000000
 [00c8] 0x000024b4 0x00000000 0x000024b8 0x00000000 0x00002480 0x00000000 0x00002484 0x00000000
 [00d0] 0x0000248c 0x00000000 0x00002490 0x00000000 0x00002494 0x00000000 0x0000241c 0x00000000
@@ -40,7 +40,7 @@
 [0128] 0x00002450 0x00000000 0x00002454 0x00000000 0x00002174 0x00000000 0x00000000 0x00000000
 [0130] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
 [0138] 0x06800000 0x00000000 0x00000000 0x69040000 0x6101000e 0x00000001 0x00000000 0x00000000
-[0140] 0xffde6001 0x00000000 0xffde6001 0x00000000 0x00000001 0x00000000 0xffde6001 0x00000000
+[0140] 0xffde6001 0x00000000 0xffde6001 0x00000000 0x00000781 0x00000000 0xffde6001 0x00000000
 [0148] 0xfffff001 0x00001001 0xfffff001 0x00001001 0x79120000 0x00000000 0x79130000 0x00000000
 [0150] 0x79140000 0x00000000 0x79150000 0x00000000 0x79160000 0x00000000 0x79190002 0x00000000
 [0158] 0x00000000 0x00000000 0x791a0002 0x00000000 0x00000000 0x00000000 0x791b0002 0x00000000
@@ -67,7 +67,7 @@
 [0200] 0x00000000 0x11001001 0x00006b1c 0xffff0000 0x00000000 0x00000000 0x00000000 0x00000000
 [0208] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
 [0210] 0x78140000 0x00000800 0x78230000 0x00000aa0 0x780e0000 0x000009c1 0x78180000 0x00000001
-[0218] 0x784e0001 0x00000000 0x00000000 0x784c0000 0x19992453 0x78050006 0x00000000 0x00000000
+[0218] 0x784e0001 0x00000000 0x00000000 0x784c0000 0x00000000 0x78050006 0x00000000 0x00000000
 [0220] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x78070003 0x00000000 0x00000000
 [0228] 0x00000000 0x00000000 0x78060003 0x00000000 0x00000000 0x00000000 0x00000000 0x78040001
 [0230] 0x00000000 0x00000001 0x781f0002 0x30400820 0x00000000 0x00000000 0x78510009 0x00000000
@@ -92,7 +92,7 @@
 [02c8] 0x0000e490 0x00000000 0x0000e494 0x00000000 0x0000e498 0x00000000 0x0000e458 0x00000000
 [02d0] 0x0000e558 0x00000000 0x0000e658 0x00000000 0x0000e758 0x00000000 0x0000e45c 0x00000000
 [02d8] 0x0000e55c 0x00000000 0x0000e65c 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
-[02e0] 0x00000000 0x11001005 0x00005580 0xffff0000 0x00005584 0xffff0000 0x00005524 0x00000000
+[02e0] 0x00000000 0x11001005 0x00005580 0xffff0000 0x00005584 0xffff0000 0x00005524 0x3f800000
 [02e8] 0x7907001f 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
 [02f0] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
 [02f8] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
@@ -213,7 +213,7 @@
 [0690] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
 [0698] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
 [06a0] 0x780a0003 0x00000000 0x00000000 0x00000000 0x00000000 0x78080083 0x0000400c 0xffde6960
-[06a8] 0x00000000 0x00000024 0x04004000 0x00000000 0x00000000 0x00000000 0x08004000 0x00000000
+[06a8] 0x00000000 0x00000024 0x04784020 0x007b0000 0x00000000 0x00003000 0x08004000 0x00000000
 [06b0] 0x00000000 0x00000000 0x0c004000 0x00000000 0x00000000 0x00000000 0x10004000 0x00000000
 [06b8] 0x00000000 0x00000000 0x14004000 0x00000000 0x00000000 0x00000000 0x18004000 0x00000000
 [06c0] 0x00000000 0x00000000 0x1c004000 0x00000000 0x00000000 0x00000000 0x20004000 0x00000000
@@ -230,42 +230,42 @@
 [0718] 0x00000000 0x00000000 0x74004000 0x00000000 0x00000000 0x00000000 0x78004000 0x00000000
 [0720] 0x00000000 0x00000000 0x7c004000 0x00000000 0x00000000 0x00000000 0x80004000 0x00000000
 [0728] 0x00000000 0x00000000 0x78090043 0x02000000 0x22220000 0x02f60000 0x11230000 0x02850004
-[0730] 0x11230000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
-[0738] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
+[0730] 0x11230000 0x00000030 0x11110000 0x04400000 0x11130000 0x0440000c 0x11130000 0x04400018
+[0738] 0x11130000 0x04850024 0x11230000 0x00000040 0x11110000 0x00000050 0x11110000 0x00000000
 [0740] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
 [0748] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
 [0750] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
 [0758] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
 [0760] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
-[0768] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x680b0001
-[0770] 0x780c0000 0x00000000 0x784a0000 0x00000000 0x78490043 0x00000000 0x00000000 0x00000001
-[0778] 0x00000000 0x00000002 0x00000000 0x00000003 0x00000000 0x00000004 0x00000000 0x00000005
-[0780] 0x00000000 0x00000006 0x00000000 0x00000007 0x00000000 0x00000008 0x00000000 0x00000009
-[0788] 0x00000000 0x0000000a 0x00000000 0x0000000b 0x00000000 0x0000000c 0x00000000 0x0000000d
+[0768] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x680b0000
+[0770] 0x780c0000 0x00000000 0x784a0000 0x00000000 0x78490043 0x00000000 0x00000000 0x00000101
+[0778] 0x00000000 0x00000102 0x00000001 0x00000103 0x00000001 0x00000004 0x00000000 0x00000005
+[0780] 0x00000000 0x00000006 0x00000000 0x00000007 0x00000000 0x00000108 0x00000001 0x00000109
+[0788] 0x00000001 0x0000000a 0x00000000 0x0000000b 0x00000000 0x0000000c 0x00000000 0x0000000d
 [0790] 0x00000000 0x0000000e 0x00000000 0x0000000f 0x00000000 0x00000010 0x00000000 0x00000011
 [0798] 0x00000000 0x00000012 0x00000000 0x00000013 0x00000000 0x00000014 0x00000000 0x00000015
 [07a0] 0x00000000 0x00000016 0x00000000 0x00000017 0x00000000 0x00000018 0x00000000 0x00000019
 [07a8] 0x00000000 0x0000001a 0x00000000 0x0000001b 0x00000000 0x0000001c 0x00000000 0x0000001d
 [07b0] 0x00000000 0x0000001e 0x00000000 0x0000001f 0x00000000 0x00000020 0x00000000 0x00000021
 [07b8] 0x00000000 0x784b0000 0x0000000f 0x11001095 0x00008300 0x00000001 0x00008304 0x00000001
-[07c0] 0x00008308 0x00000001 0x0000830c 0x00000000 0x00008310 0x00000000 0x00008314 0x00000000
-[07c8] 0x00008318 0x00000000 0x0000831c 0x00000000 0x00008320 0x00000000 0x00008324 0x00000000
+[07c0] 0x00008308 0x00000001 0x0000830c 0x00000001 0x00008310 0x00000001 0x00008314 0x00000001
+[07c8] 0x00008318 0x00000001 0x0000831c 0x00000001 0x00008320 0x00000001 0x00008324 0x00000001
 [07d0] 0x00008328 0x00000000 0x0000832c 0x00000000 0x00008330 0x00000000 0x00008334 0x00000000
 [07d8] 0x00008338 0x00000000 0x0000833c 0x00000000 0x00008340 0x00000000 0x00008344 0x00000000
 [07e0] 0x00008348 0x00000000 0x0000834c 0x00000000 0x00008350 0x00000000 0x00008354 0x00000000
 [07e8] 0x00008358 0x00000000 0x0000835c 0x00000000 0x00008360 0x00000000 0x00008364 0x00000000
 [07f0] 0x00008368 0x00000000 0x0000836c 0x00000000 0x00008370 0x00000000 0x00008374 0x00000000
 [07f8] 0x00008378 0x00000000 0x0000837c 0x00000000 0x00008380 0x00000000 0x00008384 0x00000000
-[0800] 0x00008400 0x00000000 0x00008404 0x00000000 0x00008408 0x00000000 0x0000840c 0x00000000
+[0800] 0x00008400 0x00000000 0x00008404 0x00000000 0x00008408 0x00000000 0x0000840c 0x000000c3
 [0808] 0x00008410 0x00000000 0x00008414 0x00000000 0x00008418 0x00000000 0x0000841c 0x00000000
-[0810] 0x00008420 0x00000000 0x00008424 0x00000000 0x00008428 0x00000000 0x0000842c 0x00000000
+[0810] 0x00008420 0x000000c3 0x00008424 0x000000c3 0x00008428 0x00000000 0x0000842c 0x00000000
 [0818] 0x00008430 0x00000000 0x00008434 0x00000000 0x00008438 0x00000000 0x0000843c 0x00000000
 [0820] 0x00008440 0x00000000 0x00008444 0x00000000 0x00008448 0x00000000 0x0000844c 0x00000000
 [0828] 0x00008450 0x00000000 0x00008454 0x00000000 0x00008458 0x00000000 0x0000845c 0x00000000
 [0830] 0x00008460 0x00000000 0x00008464 0x00000000 0x00008468 0x00000000 0x0000846c 0x00000000
 [0838] 0x00008470 0x00000000 0x00008474 0x00000000 0x00008478 0x00000000 0x0000847c 0x00000000
 [0840] 0x00008480 0x00000000 0x00008484 0x00000000 0x00008390 0x00000000 0x00008394 0x00000000
-[0848] 0x00008398 0x00000000 0x0000839c 0xa1000000 0x000083a0 0x00000000 0x000083a8 0xffff0000
+[0848] 0x00008398 0x00000000 0x0000839c 0xa0000000 0x000083a0 0x00000000 0x000083a8 0xffff0000
 [0850] 0x000083a4 0xffff0000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
 [0858] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
 [0860] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
@@ -2304,3 +2304,6 @@
 [47e8] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
 [47f0] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
 [47f8] 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
+Test assertion failure function scratch_buf_check, file gem_render_copy.c:117:
+Failed assertion: val == color
+Expected 0xffff00ff, found 0xfff0ff00 at (502,502)
Comment 8 Chris Wilson 2014-11-05 17:15:15 UTC
Created attachment 108973 [details]
Context before OglDeferred
Comment 9 Chris Wilson 2014-11-05 17:15:34 UTC
Created attachment 108974 [details]
Context (broken) after OglDeferred
Comment 10 Chris Wilson 2014-11-05 17:19:26 UTC
About the only thing that change are the timestamp and pixel counters, along with VF instancing. They don't seem to be of any relevance (and can be LRIed back to 0 without fixing anything).

The oddest is reg 0x5524 which is an OA register that becomes fixed to 1.0 after using mesa. I haven't been able to LRI that register to see if it is the culprit, or work out how it gets set in the first place.
Comment 11 Chris Wilson 2014-11-05 19:46:21 UTC
Hmm, VF instancing is the key. Apparently the command to disable instancing with VF_SGVS is by itself insufficient:

diff --git a/src/sna/gen8_render.c b/src/sna/gen8_render.c
index 9187b38..06cb736 100644
--- a/src/sna/gen8_render.c
+++ b/src/sna/gen8_render.c
@@ -805,6 +805,7 @@ gen8_emit_cc_invariant(struct sna *sna)
 static void
 gen8_emit_vf_invariant(struct sna *sna)
 {
+       int n;
 #if 1
        OUT_BATCH(GEN8_3DSTATE_VF | (2 - 2));
        OUT_BATCH(0);
@@ -818,6 +819,12 @@ gen8_emit_vf_invariant(struct sna *sna)
 
        OUT_BATCH(GEN8_3DSTATE_VF_STATISTICS | 0);
 
+       for (n = 0; n < 33; n++) {
+               OUT_BATCH(GEN8_3DSTATE_VF_INSTANCING | (3 - 2));
+               OUT_BATCH(n);
+               OUT_BATCH(0);
+       }
+
Comment 12 Chris Wilson 2014-11-05 21:08:57 UTC
commit 0532a3313ad9c76a6e1d28e8a1c2ea495583fead
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Nov 5 20:11:54 2014 +0000

    sna/gen8: Clear instancing enabled bit between batches
    
    gen8 sets the instancing bit relative to the vertex element, but we were
    clearing it for the vertex buffer. As the maximum number of vertex
    elements is fixed, just clear them all when emitting our header. Note
    that VF_SGVS is not sufficient by itself to disable all side-effects of
    instancing.
    
    Thanks to Kenneth Graunke for pointing out the change from vertex buffer
    to vertex element of the instancing enable bit.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84958
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk
Comment 13 wendy.wang 2014-11-06 06:36:24 UTC
Build Xf86-video-intel driver to 
commit 0532a3313ad9c76a6e1d28e8a1c2ea495583fead
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Nov 5 20:11:54 2014 +0000

Other gfx drivers keep at:
 Libdrm:		(master)libdrm-2.4.58-4-g00847fa48b83a85b0cb882594a12ed1511f780db
 Mesa:		(master)9e2473763d43f97e46561530e091473dc1e5780d
 Xserver:		(master)xorg-server-1.16.99.901-3-g63bb5c5ef16edf652179770294dcca4fc07dc992
 Cairo:		(master)adbeb3d53c6c6e8ddcc63988200da4c5c9627717
 Libva:		(master)ccd93de5a707e92a629cccd595757c8d436fa3cc
 Libva_intel_driver:		(master)24cba20a119c96556ae4dc9a90043896ea70e567
 Kernel:   (drm-intel-nightly)f56717bdf29eb7d6a9ec15f095ea2a6858895473

Test with below cases on BDW RVP Fab4 +GT2 CPU.
- OglDeferred
- OglDeferredAA
- OglDrvRes
- OglDrvShComp
- OglDrvState
- OglTerrainFlyInst
- OglTerrainPanInst
- OglVSInstancing

All the test frame working, FPS values also correct, so close this bug as verified.
Comment 14 Eero Tamminen 2014-11-06 11:39:00 UTC
Thanks, we also checked the effect on our machines and it indeed seems fixed.

Effect of the fix on FPS wasn't as bad as we had feared for.  It's largest for Batch tests (at worst 1/3), but neglible on more relevant ones.  DRI3 will hopefully fix that when it gets stable enough for use.
Comment 15 Eero Tamminen 2014-11-20 17:11:42 UTC
*** Bug 85060 has been marked as a duplicate of this bug. ***


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.