Bug 111150 - [BRW] WRC 5 asserts with gallium nine and iris.
Summary: [BRW] WRC 5 asserts with gallium nine and iris.
Status: RESOLVED MOVED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Gallium/StateTracker/galliumnine (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
: 111162 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-07-16 13:45 UTC by Illia Iorin
Modified: 2019-09-18 17:53 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Illia Iorin 2019-07-16 13:45:22 UTC
When I launch WRC 5 with master mesa(b393b2ce955) I get the message:
../src/gallium/drivers/iris/iris_resource.c:855: iris_resource_get_handle: Assertion `aux_state == ISL_AUX_STATE_RESOLVED || aux_state == ISL_AUX_STATE_PASS_THROUGH' failed.

Bisect leads to this commit:
__________
commit e81392868e6827360762fff38baf2c10c1f3b7f0
Author: Nanley Chery <nanley.g.chery@intel.com>
Date:   Wed May 1 14:57:23 2019 -0700    iris/resource: Drop redundant checks for aux support
    
Drop some checks that are already done by ISL.
    
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
__________

This commit dropped the following condition:

/* Gen9+ only supports CCS for Y-tiled buffers. */
if (surf->tiling != ISL_TILING_Y0)
    return false;

It prohibited ccs when spec allows it so the condition was indeed correctly removed.

Next I investigated why aux_state is ISL_AUX_STATE_CLEAR in iris_resource_get_handle. It is because NineSurface9_ctor calls nine_context_clear_render_target and it sets aux_state to ISL_AUX_STATE_CLEAR and again it looks logical for me. I don’t know what should be done. Also removing optimization doesn’t fix the game it just leads to a black screen and game being stuck. Discussion about this bug can be found there: 
https://github.com/iXit/wine-nine-standalone/issues/46
Comment 1 Nanley Chery 2019-07-16 17:59:33 UTC
Is the tiling of the surface X-tiled? 

My guess is that this commit enables CCS for X-tiled images used for display. This now causes us to fast-clear the image in NineSurface9_ctor. When resource_get_handle is called (from D3DWindowBuffer_create?) we're not flushing/resolving as expected when PIPE_HANDLE_USAGE_EXPLICIT_FLUSH flag is passed in as an argument.

Does adding the following in iris_resource_get_handle fix it?

if ((usage & PIPE_HANDLE_USAGE_EXPLICIT_FLUSH) && res->aux.usage != 0)
   iris_flush_resource(ctx, res);
Comment 2 Illia Iorin 2019-07-17 10:17:41 UTC
Yes, tilling is X-tiled.
This flush fixes the assertion failure but it didn't fix the game being stuck.  I’ll try to make a trace.
Comment 3 Nanley Chery 2019-07-17 22:06:56 UTC
*** Bug 111162 has been marked as a duplicate of this bug. ***
Comment 4 Nanley Chery 2019-07-17 22:31:40 UTC
(In reply to Illia Iorin from comment #2)
> Yes, tilling is X-tiled.

I created a merge request for this issue here:
https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1371

Please let me know if it fixes the issue.

> This flush fixes the assertion failure but it didn't fix the game being
> stuck.  I’ll try to make a trace.

I think we should file another bug for the game being stuck. It's not clear that the two are related.
Comment 5 Illia Iorin 2019-07-18 09:13:05 UTC
> I created a merge request for this issue here:
> https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1371
> 
> Please let me know if it fixes the issue.

This mr fixes the issue. I tried to put the flash exact after nine_context_clear_render_target in NineSurface9_ctor and it fixes the issue too.
Comment 6 Matías Zúñiga 2019-07-18 18:49:07 UTC
(In reply to Nanley Chery from comment #3)
> *** Bug 111162 has been marked as a duplicate of this bug. ***

Sorry, i didn't find this bug before posting.

The merge request also fixes the problem for me
Comment 7 Nanley Chery 2019-07-23 23:15:42 UTC
(In reply to Matías Zúñiga from comment #6)
> (In reply to Nanley Chery from comment #3)
> > *** Bug 111162 has been marked as a duplicate of this bug. ***
> 
> Sorry, i didn't find this bug before posting.
> 
> The merge request also fixes the problem for me

No problem. I just updated the MR to fix the issue in iris. Please let me know if it still helps. 

I'm not sure what issues are remaining in gallium nine (if any).
Comment 8 Matías Zúñiga 2019-07-25 04:48:16 UTC
(In reply to Nanley Chery from comment #7)
> (In reply to Matías Zúñiga from comment #6)
> > (In reply to Nanley Chery from comment #3)
> > > *** Bug 111162 has been marked as a duplicate of this bug. ***
> > 
> > Sorry, i didn't find this bug before posting.
> > 
> > The merge request also fixes the problem for me
> 
> No problem. I just updated the MR to fix the issue in iris. Please let me
> know if it still helps. 

Yeah, still working

> I'm not sure what issues are remaining in gallium nine (if any).

League Of Legends didnt work for me (it works with other Gallium drivers), but I cant get any information on were it crashes (to make League work, a patched version of wine is needed. that patch makes core-dumps unreadable, so i can't get a backtrace). I will open a report when i get useful information
Comment 9 Illia Iorin 2019-07-25 08:44:30 UTC
(In reply to Nanley Chery from comment #7)

> I just updated the MR to fix the issue in iris. Please let me know if it still helps. 

Updated MR fixes assert in WRC5.
Comment 10 GitLab Migration User 2019-09-18 17:53:26 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/128.


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.