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

surface: Don't crash due to weird state after resume #699

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Drakulix
Copy link
Member

@Drakulix Drakulix commented Aug 8, 2024

@jacobgkau Should fix resume issues from #694 (unable to confirm myself)

Copy link
Member

@jacobgkau jacobgkau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this installed on the Mira B4 w/ 4060 Ti, resume still isn't working correctly.

The first change of behavior is I now get a mouse cursor on top of an otherwise blank screen after resuming; the cursor doesn't move around smoothly, but if I move the mouse, the cursor will pop to a new location a few seconds later.

With this fix, I am able to get to a TTY after the resume (which I wasn't able to do before). If I restart cosmic-greeter.service, then I can log back into the GUI successfully.

Here's the system journal after the resume: after-resume-d580294.txt

I see these logs after suspend is started but before it's finished suspending:

Aug 09 20:54:51 pop-os cosmic-comp[2028]: Failed to submit rendering: Failed to submit result for display
                                          
                                          Caused by:
                                              0: The underlying drm surface encountered an error: DRM access error: Page flip commit failed on device `Some("/dev/dri/card1")` (Permission denied (os error 13))
                                              1: DRM access error: Page flip commit failed on device `Some("/dev/dri/card1")` (Permission denied (os error 13))
                                              2: Permission denied (os error 13)

After resume, I see this line repeated a lot in one place:

Aug 09 20:55:42 pop-os cosmic-session[1958]: [2024-08-09T20:55:42Z WARN  iced_futures::subscription::tracker] Error sending event to subscription: TrySendError { kind: Full }

And then one of these just before I switch to a TTY:

Aug 09 20:56:28 pop-os cosmic-comp[2028]: Failed to submit rendering: Failed to submit result for display
                                          
                                          Caused by:
                                              0: The underlying drm surface encountered an error: Device is currently paused, operation rejected
                                              1: Device is currently paused, operation rejected

I'm approving this since it's an improvement in behavior, but it seems more work is still required, possibly in cosmic-comp.

@Drakulix
Copy link
Member Author

With this installed on the Mira B4 w/ 4060 Ti, resume still isn't working correctly.

Here's the system journal after the resume: after-resume-d580294.txt

Difficult to decode what exactly is happening here.

I see these logs after suspend is started but before it's finished suspending:

Aug 09 20:54:51 pop-os cosmic-comp[2028]: Failed to submit rendering: Failed to submit result for display
                                          
                                          Caused by:
                                              0: The underlying drm surface encountered an error: DRM access error: Page flip commit failed on device `Some("/dev/dri/card1")` (Permission denied (os error 13))
                                              1: DRM access error: Page flip commit failed on device `Some("/dev/dri/card1")` (Permission denied (os error 13))
                                              2: Permission denied (os error 13)

That seems correct, as the currently queued render likely fails while the session is being deactivate, the error code also matches up here. cosmic-comp will catch this and given this line doesn't repeat it clearly also doesn't try to redraw, so success on the suspend side of things.

After resume, I see this line repeated a lot in one place:

Aug 09 20:55:42 pop-os cosmic-session[1958]: [2024-08-09T20:55:42Z WARN  iced_futures::subscription::tracker] Error sending event to subscription: TrySendError { kind: Full }

Seems like a separate cosmic-session bug we should track.

And then one of these just before I switch to a TTY:

Aug 09 20:56:28 pop-os cosmic-comp[2028]: Failed to submit rendering: Failed to submit result for display
                                          
                                          Caused by:
                                              0: The underlying drm surface encountered an error: Device is currently paused, operation rejected
                                              1: Device is currently paused, operation rejected

This one is puzzling. I wonder if the log message actually originates from before suspend, as it would make sense that the surface still exists but the device is already paused.

Otherwise I don't know how we would get into this state, as we first resume the device and then startup all the surfaces again (and at that point only one thread is involved).

@Drakulix
Copy link
Member Author

Pushed a commit to address the last log message.

@jacobgkau If you have the time to retest, that would be very appreciated. The system journal would again help with debugging.

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