Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRMBackend: Add libliftoff log handler #1584

Merged

Conversation

samueldr
Copy link

@samueldr samueldr commented Oct 14, 2024

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:

drmModeAtomicCommit: Permission denied

To:

[gamescope] [Error] liftoff: drmModeAtomicCommit: Permission denied

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.

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.

Signed-off-by: Samuel Dionne-Riel <samuel@dionne-riel.com>
@misyltoad misyltoad merged commit 056b79e into ValveSoftware:master Oct 15, 2024
1 check passed
@samueldr samueldr deleted the feature/liftoff-log-handler branch October 15, 2024 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants