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

Display (Linux): detect all enabled or connected connectors #1301

Merged
merged 1 commit into from
Sep 29, 2024

Conversation

ziyao233
Copy link
Contributor

Background: I found fastfetch on one of my ARM board cannot display CVBS port related information.

DRM connectors have two properties, "enabled" and "status", standing for "enabled by userspace" and "a display has been connected". Connector status cannot be reliably detected sometimes, in this case status will be set to unknown and it is still okay to enable it. Some drivers are also able to enable disconnected connectors.

So it is both meaningful to detect connectors in two states,

  • An enabled connector, where it must have been operating in some configuration required by userspace
  • A connected connector, where driver is sure a display has been connected to the port, this is the obvious case.

In the original implementation, only information of connected connectors are detected and an enabled connector without hotplug detection capability, like a Composite video connector, will be silently ignored. Switch to the new strategy to detect these connectors correctly.

References: https://github.com/torvalds/linux/blob/3efc57369a0ce8f76bf0804f7e673982384e4ac9/include/drm/drm_connector.h#L58-L89

DRM connectors have two properties, "enabled" and "status", standing for
"enabled by userspace" and "a display has been connected". Connector
status cannot be reliably detected sometimes, in this case status will
be set to unknown and it is still okay to enable it. Some drivers are
also able to enable disconnected connectors.

So it is both meaningful to detect connectors in two states,

- An enabled connector, where it must have been operating in some
  configuration required by userspace
- A connected connector, where driver is sure a display has been
  connected to the port, this is the obvious case.

In the original implementation, only information of connected connectors
are detected and an enabled connector without hotplug detection
capability, like a Composite video connector, will be silently ignored.
Switch to the new strategy to detect these connectors correctly.

References: https://github.com/torvalds/linux/blob/3efc57369a0ce8f76bf0804f7e673982384e4ac9/include/drm/drm_connector.h#L58-L89
Signed-off-by: Yao Zi <[email protected]>
@ziyao233
Copy link
Contributor Author

btw, neofetch recognizes the CVBS port but does not consider its status/enabled properties.

@ziyao233 ziyao233 closed this Sep 28, 2024
@ziyao233 ziyao233 reopened this Sep 28, 2024
@CarterLi
Copy link
Member

CarterLi commented Sep 29, 2024

I think checking enabled is enough. Disabled displays (despite connected) should not be reported by fastfetch. So the behavior on Linux is consistant with the behavior on Windows.

@CarterLi
Copy link
Member

By the way, doesn't the wayland or X11 detection method work for you?

@CarterLi
Copy link
Member

I think checking enabled is enough. Disabled displays (despite connected) should not be reported by fastfetch. So the behavior on Linux is consistant with the behavior on Windows.

Let's change to detect enabled displays only in the next version.

@CarterLi CarterLi merged commit 51796de into fastfetch-cli:dev Sep 29, 2024
@ziyao233
Copy link
Contributor Author

By the way, doesn't the wayland or X11 detection method work for you?

There is no display server started, composite video output is enabled directly using libdrm.

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