Bug 96239

Summary: [radeonsi tessellation] [R9 290/390] Random "texture flickering" (Shadow of Mordor, Tomb Raider, Unigine Heaven 4.0)
Product: Mesa Reporter: Jan Ziak (http://atom-symbol.net) <0xe2.0x9a.0x9b>
Component: Drivers/Gallium/radeonsiAssignee: Default DRI bug account <dri-devel>
Status: RESOLVED FIXED QA Contact: Default DRI bug account <dri-devel>
Severity: normal    
Priority: medium CC: bas, vedran
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Shadow of Mordor screenshot
Tomb Raider with tessellation
ci-64-tess-blocks.patch
Tomb Raider ci-64-tess-blocks screenshot
S_03093C_OFFCHIP_BUFFERING(offchip_blocks) if >= CIK

Description Jan Ziak (http://atom-symbol.net) 2016-05-27 08:20:52 UTC
Created attachment 124124 [details]
Shadow of Mordor screenshot

See the screenshot attached to this bug.

GPU: R9 390
OpenGL version string: 4.3 (Core Profile) Mesa 11.3.0-devel (git-8314dd7)

$ export MESA_GLSL_VERSION_OVERRIDE=430

This may be related to the off-chip tessellation patches, but the issue doesn't depend on whether tessellation is enabled or disabled.
Comment 1 Jan Ziak (http://atom-symbol.net) 2016-05-27 10:22:51 UTC
Created attachment 124125 [details]
Tomb Raider with tessellation

Tomb Raider without tessellation: OK
Tomb Raider with tessellation: random flickering
Comment 2 prazola 2016-05-28 18:20:47 UTC
I confirm the bug. It affects tessellation on heaven benchmark 4.0.
r9 390.
Comment 3 Clésio Luiz 2016-05-28 18:50:32 UTC
This affect me too, in a R9 290, radeonsi driver, using padoka PPA with Kubuntu 16.04.

When you disable tesselation in those games the problem goes away.
Comment 4 Bas Nieuwenhuizen 2016-05-28 23:52:26 UTC
Created attachment 124151 [details] [review]
ci-64-tess-blocks.patch

Does the attached patch help? If not I would appreciate it if someone could find the first commit that fails (using e.g. bisect).

Also, I noticed all reporters use hawaii/grenada pro chips. If anyone with a different chip also has this issue, please let me know.
Comment 5 Rafael Castillo 2016-05-29 02:13:16 UTC
i can confirm this patches generates 0 issues on TAHITI R9-280 and CAPE VERDE HD7700, so it seems it is specific to hawaii/grenada pro
Comment 6 Jan Ziak (http://atom-symbol.net) 2016-05-29 08:48:55 UTC
(In reply to Bas Nieuwenhuizen from comment #4)
> Created attachment 124151 [details] [review] [review]
> ci-64-tess-blocks.patch
> 
> Does the attached patch help? If not I would appreciate it if someone could
> find the first commit that fails (using e.g. bisect).
> 
> Also, I noticed all reporters use hawaii/grenada pro chips. If anyone with a
> different chip also has this issue, please let me know.

Unfortunately, ci-64-tess-blocks.patch is making the issue more severe. The frequency of "black triangles on screen" in Tomb Raider is higher.
Comment 7 Jan Ziak (http://atom-symbol.net) 2016-05-29 08:50:49 UTC
Created attachment 124154 [details]
Tomb Raider ci-64-tess-blocks screenshot
Comment 8 Jan Ziak (http://atom-symbol.net) 2016-05-29 10:50:39 UTC
(In reply to Bas Nieuwenhuizen from comment #4)
> Does the attached patch help? If not I would appreciate it if someone could
> find the first commit that fails (using e.g. bisect).

Checking out for example f91c85b29b8261ab3f44d292ed2130d4f577d976 and starting Tomb Raider restarts the X server on my machine.
Comment 9 Jan Ziak (http://atom-symbol.net) 2016-05-29 12:23:27 UTC
Created attachment 124155 [details] [review]
S_03093C_OFFCHIP_BUFFERING(offchip_blocks) if >= CIK

This patch fixes the issue on my R9 390.

The code is just a guesswork. Maybe it should be (2*offchip_blocks-1) instead?
Comment 10 Jan Ziak (http://atom-symbol.net) 2016-05-29 12:27:40 UTC
Passing +1 to S_03093C_OFFCHIP_BUFFERING() explains why changing offchip_blocks from 256 to 64 increases the severity of the issue.
Comment 11 Bas Nieuwenhuizen 2016-05-30 08:18:28 UTC
Thanks a lot for finding the cause of the issue.

I pushed e9d3246a7a74282fbbf95ed077e3c3b7750c8ddd to git, that patch should fix the issue.
Comment 12 Jan Ziak (http://atom-symbol.net) 2016-05-30 08:28:34 UTC
Fixed. Shadow of Mordor renders OK.

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.