Created attachment 144147 [details]
intel_miptree_choose_aux_usage() selects ISL_AUX_USAGE_MCS if intel_miptree_supports_mcs() returns true.
This will cause callchain intel_miptree_alloc_aux() => intel_alloc_aux_buffer() => brw_bo_map(x,y,MAP_RAW|MAP_WRITE) => brw_bo_map_wc(), which checks bufmgr->has_mmap_wc and returns NULL on !bufmgr->has_mmap_wc. There is no fallback in brw_bo_map() for the MAP_RAW case.
This will cause intel_miptree_create() to fail which causes intel_miptree_create_for_renderbuffer() to fail.
I guess either either the miptree creation should be retried without MCS or intel_miptree_supports_mcs() should detect the missing mmap_wc support and return false.
Attached is a quick hack patch that adds mmap_wc check in intel_miptree_supports_mcs(), and it seems to fix the testcase I used (mesa-issue-qt3d.cc).
Without the patch the testcase either crashes (git master) or flashes rapidly (git master + two patches from bug #110601 to workaround the crashes).
The testcase mesa-issue-qt3d.cc is also attached, plus an apitrace and glxinfo with git master.
This was tested on a ValleyView Gen7 (8086:0f31) with kernel 3.10.35.
Created attachment 144148 [details] [review]
Add MMAP_WC check before using MCS
Created attachment 144149 [details]
Testcase Qt C++ program
Created attachment 144150 [details]
I actually have a series that allows the GL drivers to fallback to not having compression if auxiliary surface allocation fails. Does this branch fix your issue? https://gitlab.freedesktop.org/nchery/mesa/tree/sent/refactor/aux-assign
Yes, it indeed does fix this bug, thanks.
An better performing fix (and possibly the right fix) would involve falling back to a supported mapping. Though, I'm not sure if there would be anything blocking that solution.
I think we can drop MAP_RAW if MMAP_WC isn't supported - using a tiled mapping is kind of weird, but we're just filling the whole buffer anyway. We used to do it before 3b4f432d9bbdf86bb6e0e84c6053959aa3194daa.
Created attachment 144171 [details] [review]
Fallback to non-raw mapping
Indeed, the attached patch that simply fallbacks to non-MAP_RAW seems to also work, at least with my testcase.
The patch fallbacks to non-raw in all cases, no idea if that is wanted or just for MCS.
-- 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/1810.