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

[KMS DRM] don't restore video mode on process exit when running in parallel with Wayfire #264

Open
qrp73 opened this issue Jun 20, 2024 · 1 comment

Comments

@qrp73
Copy link

qrp73 commented Jun 20, 2024

Steps to reproduce:

  1. Download and compile kmscube: git clone https://gitlab.freedesktop.org/mesa/kmscube.git
  2. Boot into Raspi Bookworm Light (tty only)
  3. Run kmscube
  4. Press Enter to exit process

Note,that this works as expected, on process exit it restore video mode and you can see console text with no issue.

  1. Boot into Raspi Bookworm with Wayfire desktop
  2. Switch to tty with Alt+Ctrl+F1
  3. Run kmscube
  4. Press Enter to exit process

Expected result: video mode is restored and command line appears

Actual result: empty screen, pressed text don't appears on the screen, but you can type clear command and Enter in blind mode and it leads to video mode restore

I tried to save video mode and restore it before process exit and it helps. So there is obvious issue with restore video mode, because process is exited and it's expected to return into original console instead of keep it in unknown mode with no picture.

@qrp73 qrp73 changed the title KMS DRM don't restore video mode on process exit when running in parallel with Wayfire [KMS DRM] don't restore video mode on process exit when running in parallel with Wayfire Jun 21, 2024
@6by9
Copy link

6by9 commented Jun 21, 2024

Whilst not totally desirable, this is expected.

The kernel fbdev emulation that puts the console on the screen is triggered by the close of the last file handle on the relevant /dev/dri/cardN node.

Switching tty using ctrl-alt-fN doesn't make Wayfire close any file handles, although presumably it relinquishes DRM MASTER as otherwise nothing else can use DRM.

kmscube runs and uses KMS, but does not restore anything afterwards (very few apps will). There are still file handles from Wayfire open to the card, so the framebuffer emulation isn't restored and you get a blank screen. There will be a couple of triggers that do reinstate the framebuffer, with your clear obviously being one.

I guess ideally the KMS handling wants to look for whether anyone has claimed master permissions to trigger the framebuffer emulation, but I suspect there are good reasons why mainline haven't tackled that.

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

No branches or pull requests

2 participants