i965 miptree MCS aux_buf allocation failure with old kernels
Submitted by Anssi Hannula
Assigned to Intel 3D Bugs Mailing List
Created attachment 144147 glxinfo
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.
Attachment 144147, "glxinfo":