xf86: VGA arbiter lock on CloseScreen() still needed ?
Enrico Weigelt, metux IT consult
info at metux.net
Tue Apr 29 11:13:04 UTC 2025
Hello folks,
I'm currently working on simplifying hooking into ScreenRec proc's:
Instead of anybody directly manipulating the individual proc vectors
and forming a daisy chain, now using the generic callback mechanism
we already have in many other places. The big difference here is that
those callbacks are now called independently from each other, there
isn't any guaranteed execution order - except that they're all been
called until we reach the original screen proc (filled by the driver).
In most cases, that's really simple and straightforward, making the
code simpler to follow and better modularization / separation of
concernts. When fully done, it's also now possible hook/unhook at
runtime (eg. enable/disable extensions on the fly, etc)
But there's one exception that's puzzling me:
VGAarbiterCloseScreen()
After some boring cleanup work, it's calling the original proc with
arbiter lock held (and releasing it afterwards). Unfortunately, that's
incompatible with how the callbacks work (only called *before* we're
reaching the driver's CloseScreen() proc).
[ could add another post-CloseScreen() hook where the unlocking is
done, but dont really like that idea for just one special case ]
What could go wrong if I'd just remove the arbiter locking here ?
Some other process switching to another card at the same time, so the
driver now might reconfigure the wrong card ?
I wonder whether the vga arbiter is still practically needed anymore:
IIRC, the whole thing became necessary, because there might be multiple
cards which are still accessed via the same legacy VGA aperture (and not
using KMS), instead of their own ones.
Do even we still practically support such HW setups, where we really
have multiple cards that we need via to talk to via legacy VGA interface ?
If the answer is no, do we still need to keep vga arbiter support at all ?
And if it's yes, wouldn't it be better letting the (few) individual
drivers explicitly call into the arbiter support code, when really
needed ?
thx
--mtx
--
---
All racism is bad. All lives matter.
---
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info at metux.net -- +49-151-27565287
More information about the xorg-devel
mailing list