iris: assertion failure in iris_resource_from_memobj
I'm hitting an assertion failure in iris_resource_from_memobj
with a fresh build (head at 2f85d909) and an A380 (DG2) GPU. The assertion is triggered by an OpenXR program with Monado (OpenXR runtime).
(gdb) bt
#0 __restore_sigs (set=set@entry=0x7fffffffa830) at ./arch/x86_64/syscall_arch.h:40
#1 0x00007ffff7fad382 in raise (sig=sig@entry=6) at src/signal/raise.c:11
#2 0x00007ffff7f80ec5 in abort () at src/exit/abort.c:11
#3 0x00007ffff7f80f74 in __assert_fail (expr=<optimized out>, file=<optimized out>, line=<optimized out>, func=<optimized out>) at src/exit/assert.c:7
#4 0x00007ffff59defbc in iris_resource_from_memobj (pscreen=0x7ffff7c4ec40, templ=0x7fffffffaaa0, pmemobj=0x7fffec0d68d0, offset=0)
at ../src/gallium/drivers/iris/iris_resource.c:1467
#5 0x00007ffff59df090 in iris_resource_from_memobj_wrapper (pscreen=0x7ffff7c4ec40, templ=0x7fffffffaaa0, pmemobj=0x7fffec0d68d0, offset=0)
at ../src/gallium/drivers/iris/iris_resource.c:1494
#6 0x00007ffff45a75d6 in st_texture_create_from_memory (st=0x7fffebfa83c0, memObj=0x7fffec48fe70, offset=0, target=PIPE_TEXTURE_2D, format=PIPE_FORMAT_Z16_UNORM,
last_level=0, width0=2015, height0=2240, depth0=1, layers=1, nr_samples=0, bind=1048585) at ../src/mesa/state_tracker/st_cb_texture.c:3208
#7 0x00007ffff45a790c in st_texture_storage (ctx=0x7fffebe4a140, texObj=0x7fffebe13910, levels=1, width=2015, height=2240, depth=1, memObj=0x7fffec48fe70, offset=0)
at ../src/mesa/state_tracker/st_cb_texture.c:3288
#8 0x00007ffff45a8324 in st_SetTextureStorageForMemoryObject (ctx=0x7fffebe4a140, texObj=0x7fffebe13910, memObj=0x7fffec48fe70, levels=1, width=2015, height=2240,
depth=1, offset=0) at ../src/mesa/state_tracker/st_cb_texture.c:3565
#9 0x00007ffff4576877 in texture_storage (no_error=false, dsa=true, offset=0, depth=1, height=2240, width=2015, internalformat=33189, levels=1, target=3553,
memObj=0x7fffec48fe70, texObj=0x7fffebe13910, dims=2, ctx=0x7fffebe4a140) at ../src/mesa/main/texstorage.c:517
#10 _mesa_texture_storage_memory (ctx=0x7fffebe4a140, dims=2, texObj=0x7fffebe13910, memObj=0x7fffec48fe70, target=3553, levels=1, internalformat=33189, width=2015,
height=2240, depth=1, offset=0, dsa=true) at ../src/mesa/main/texstorage.c:856
#11 0x00007ffff4ab5be8 in texturestorage_memory (dims=2, texture=7, levels=1, internalFormat=33189, width=2015, height=2240, depth=1, memory=7, offset=0,
func=0x7ffff6897dc8 "glTexureStorageMem2DEXT") at ../src/mesa/main/externalobjects.c:445
#12 0x00007ffff4ab5eb3 in _mesa_TextureStorageMem2DEXT (texture=7, levels=1, internalFormat=33189, width=2015, height=2240, memory=7, offset=0)
at ../src/mesa/main/externalobjects.c:546
#13 0x00007ffff799db2a in shared_dispatch_stub_1360 (texture=7, levels=1, internalFormat=33189, width=2015, height=2240, memory=7, offset=0)
at /home/simon/src/mesa/build/src/mapi/shared-glapi/glapi_mapi_tmp.h:29791
#14 0x00007ffff76a1d35 in client_gl_memobj_swapchain_create (xc=<optimized out>, info=0x7fffffffaf90, xscn=0x7fffec0a5910, out_cglsc=0x7fffffffaf08)
at /home/simon/src/monado/src/xrt/compositor/client/comp_gl_memobj_swapchain.c:140
#15 0x00007ffff76a15f3 in client_gl_swapchain_create (out_xsc=0x7fffffffaf80, info=0x7fffffffaf90, xc=0x7fffec09fdb0)
at /home/simon/src/monado/src/xrt/compositor/client/comp_gl_client.c:458
#16 client_gl_swapchain_create (xc=0x7fffec09fdb0, info=0x7fffffffaf90, out_xsc=0x7fffffffaf80) at /home/simon/src/monado/src/xrt/compositor/client/comp_gl_client.c:407
#17 0x00007ffff769a002 in xrt_comp_create_swapchain (out_xsc=0x7fffffffaf80, info=0x7fffffffaf90, xc=<optimized out>)
at /home/simon/src/monado/src/xrt/include/xrt/xrt_compositor.h:1150
#18 oxr_create_swapchain (log=0x7fffffffb020, sess=0x7fffec065570, createInfo=0x7fffffffb170, out_swapchain=out_swapchain@entry=0x7fffffffaff0)
at /home/simon/src/monado/src/xrt/state_trackers/oxr/oxr_swapchain.c:209
#19 0x00007ffff769a300 in oxr_swapchain_gl_create (log=<optimized out>, sess=<optimized out>, createInfo=<optimized out>, out_swapchain=0x7fffffffb018)
at /home/simon/src/monado/src/xrt/state_trackers/oxr/oxr_swapchain_gl.c:111
#20 0x00007ffff767f757 in oxr_xrCreateSwapchain (session=0x7fffec065570, createInfo=0x7fffffffb170, out_swapchain=0x7fffec0ceb20)
at /home/simon/src/monado/src/xrt/state_trackers/oxr/oxr_api_swapchain.c:104
#21 0x00007ffff7f47c86 in xrCreateSwapchain () from /usr/lib/libopenxr_loader.so.1
#22 0x000055555555c73e in _create_swapchain (instance=0x7ffff75ef110, session=0x7fffec065570, swapchain=0x7fffffffb800, num_swapchain=0, format=33189, sample_count=1,
w=2015, h=2240, usage_flags=2) at /home/simon/src/openxr-simple-playground/main.c:1127
#23 0x000055555555cb67 in create_swapchain_from_views (instance=0x7ffff75ef110, session=0x7fffec065570, swapchain=0x7fffffffb800, view_count=2, format=33189,
viewconfig_views=0x7ffff77f6160, usage_flags=2) at /home/simon/src/openxr-simple-playground/main.c:1192
#24 0x000055555555f3f5 in main (argc=1, argv=0x7fffffffe8e8) at /home/simon/src/openxr-simple-playground/main.c:1931