ecore_drm2 - work with broken kernels that EBUSY on drm page flip
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sat, 7 Jan 2017 04:16:06 +0000 (13:16 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sat, 7 Jan 2017 04:23:02 +0000 (13:23 +0900)
commit46a1bc2d225a42829f1e278f4432b2d8af3e0725
treeea4de7dfe2fa7b1c434d325cb589699db363f2f3
parent78bd2ea6f5fd158d2df59f86deb1b7c778f44457
ecore_drm2  - work with broken kernels that EBUSY on drm  page flip

so thelatest rpi kernels available e.g. in raspbian contain no fixes
for this yet so thatmeans basically ALL users would be affected, so
best to have a small workaround in ecore_drm2 to try the page flip a
few times until it works. this actually works. i try a usleep for 100
then try again. up to 500 times max then give up. actual numbers show
that betwee 1 to about 60 tries gets the flip to happen when these
glitches happen. log an error when this happens so we know it's
happening and a workaround is kicking in.

technically this would be much nicer if swapping had a dedicated
thread that could stall in this case and keep trying, but the odd
times it happens (seems to happen on average maybe once every 30
seconds) it wouldnt stall the mainloop or rendering and JUSt stall a
dedicated swapper thread. this requires a lot mor work to implement
though and we'd have to then ensure swaps ARe async with the swap
result coming back as an event etc... so a lot more work.

this at least makes rendering on the rpi stable and i can dig into
other issues like libproxy throws exceptions and causes a whole
process abort() as a result, or the latest mesa pkgs have totally
broken partial gl rnedering with all non-rendered areas being black
(it used to work though... until i updated).

@fix
src/lib/ecore_drm2/ecore_drm2_fb.c