Redirect surface window as needed for page flips causes Xwayland to hang sometimes
This was reported downstream:
https://bugzilla.redhat.com/show_bug.cgi?id=2284116
The Damage list gets corrupted.
From the downstream issue:
(gdb) bt
#0 damageRegionProcessPending (pDrawable=pDrawable@entry=0x55eeb8e26b10)
at ../miext/damage/damage.c:292
#1 0x000055eeb65f0732 in damageCopyArea (pSrc=<optimized out>,
pDst=0x55eeb8e26b10, pGC=0x55eeb893b8d0, srcx=0, srcy=<optimized out>,
width=<optimized out>, height=19, dstx=0, dsty=0)
at ../miext/damage/damage.c:778
#2 0x000055eeb65cbd88 in compRestoreWindow (pWin=pWin@entry=0x55eeb8e26b10,
pPixmap=pPixmap@entry=0x55eeb906c230) at ../composite/compalloc.c:250
#3 0x000055eeb65d7136 in compCheckRedirect (pWin=pWin@entry=0x55eeb8e26b10)
at ../composite/compwindow.c:181
#4 0x000055eeb65d7cfd in compUnrealizeWindow (pWin=0x55eeb8e26b10)
at ../composite/compwindow.c:292
#5 0x000055eeb65d08ba in UnrealizeTree (pWin=0x55eeb8e26b10, fromConfigure=0)
at ../dix/window.c:2805
#6 0x000055eeb66bc92b in UnmapWindow.isra.0 (pWin=0x55eeb8e26b10,
fromConfigure=fromConfigure@entry=0) at ../dix/window.c:2863
#7 0x000055eeb659d8e1 in ProcUnmapWindow (client=<optimized out>)
at ../dix/dispatch.c:946
#8 0x000055eeb65a68f8 in Dispatch () at ../dix/dispatch.c:549
#9 0x000055eeb6527b16 in dix_main (argc=<optimized out>,
argv=<optimized out>, envp=<optimized out>) at ../dix/main.c:275
#10 main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>)
at ../dix/stubmain.c:34
Key values
(gdb) p pDamage
$4 = (DamagePtr) 0x55eeb9067dd0
(gdb) p pDamage->pNext
$5 = (DamagePtr) 0x55eeb9067dd0
(gdb) p *pDamage
$6 = {pNext = 0x55eeb9067dd0, pNextWin = 0x0, damage = {extents = {x1 = -1,
y1 = -1, x2 = -1, y2 = -1}, data = 0x55eeb6728440 <RegionEmptyData>},
damageLevel = DamageReportNonEmpty, isInternal = 0,
closure = 0x55eeb8f8e300, isWindow = 1, pDrawable = 0x55eeb8e26b10,
damageReport = 0x55eeb6540bf0 <damage_report>,
damageDestroy = 0x55eeb6536a10 <damage_destroy>, reportAfter = 0,
pendingDamage = {extents = {x1 = 0, y1 = 0, x2 = 0, y2 = 0},
data = 0x55eeb6728440 <RegionEmptyData>}, pScreen = 0x55eeb80131c0}
Reverting !1300 (merged) avoid the issue.
/cc @daenzer
Edited by Olivier Fourdan