DRMBackend: Add libliftoff log handler #1584
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This serves to attribute the origin of any spurious logging libliftoff would be doing. Otherwise, it simply writes to stderr, and sometimes without any hint that it is coming from libliftoff.
Hi! 👋
Hopefully the change satisfies the coding style. Don't hesitate to discuss changes, or even directly send them here if anything trivial.
Rationale
I spent some time chasing down what printed some log, namely
drmModeAtomicCommit: Permission denied
. Note that this is not aiming to change the conditions where that error would show-up. Though now it is properly attributed to a logging scope. (More on that other log elsewhere, later.)This also gives a convar (TIL about gamescopectl) to arbitrarily switch the libliftoff log level, which I guess may end-up useful at some point?
How this was tested
Manually, using a Jovian NixOS system (SteamOS UI and system semantics) on my Steam Deck. It was on top of gamescope
3.15.11
, but it shouldn't really matter compared to the current revision on master. The exact symptom / print is not relevant. The fact it now gets printed by the logging facilities is.Going from:
To:
Since this will invariably float up in search:
Off-topic hint for
drmModeAtomicCommit: Permission denied
It's most likely related to gamescope not being (currently) the bus master. I do not know the many ways it can happen, but there is definitely more than one cause to seeing this symptom.
In one known situation, changing the VT will cause this to be logged. In that situation (AFAIUI) the gamescope process is temporarily not the bus master anymore.