wlserver: Re-hook pausing on session pause #1585
Open
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.
During the refactor in 88eb1b4, the handle_session_active function lost the ultimate role of causing a pause when the session became inactive.
The duty of pausing the session was given the
DirtyState
function on the backend, which now uses the same "moral" condition to set the paused state (g_DRM.paused = !wlsession_active();
)...... except that now
DirtyState
state is only called when the session is resumed. In turn, this means that on session suspend, nothing ends-up pausing the DRM backend anymore!This change unconditionally calls
DirtyState
, which in turn does the accounting for pausing the backend. Actually, it conditionally passesfalse
to the argument to force nothing.This fixes what ends-up causing
drmModeAtomicCommit: Permission denied
when moving to another VT from gamescope's.Hi again! 👋
Hot off the heels of #1584 I was writing-up a bug report to solve the cause of the symptom I was observing.
As it turns out, while showing where my knowledge about the situation ended, I realized the solution was within the scope of my knowledge.
I'm not 100% sure of the actual current implementation (passing the
active
flag toDirtyState
), there may be something more apt to do nowadays to actually pause the renderer, but looking at the change that AFAIUI introduced this regression, this is recovering the initial intent.Anyways, the fact all the hard work was already done made it trivial to add the feature to “Handle seat disable/resume for VT switching”.
Don't hesitate to discuss changes, or even directly send them here if anything trivial.
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.I'm using the symptom (the libliftoff message) as a success metric.
Going from:
To:
Note that there are messages that are being shown on pause that wouldn't beforehand. I believe it may come from my "misuse" of simply calling
DirtyState
. That might be inconsequential in the end.