Skip to content

Comments

Add drm atomic modeset support#184

Merged
kdj0c merged 8 commits intokmscon:mainfrom
kdj0c:atomic
Jan 12, 2026
Merged

Add drm atomic modeset support#184
kdj0c merged 8 commits intokmscon:mainfrom
kdj0c:atomic

Conversation

@kdj0c
Copy link
Contributor

@kdj0c kdj0c commented Dec 19, 2025

All DRM drivers have now support for atomic commit, which is more reliable than the legacy DRM API.
Re-organize the code, to do one atomic commit for all displays, and separate page flips from real modeset.

@Vladimir-csp
Copy link
Contributor

Does this reuse mode instead of unconditional modeset event on every VT switch?

@kdj0c
Copy link
Contributor Author

kdj0c commented Dec 25, 2025

Normally with Atomic modesetting, the driver is able to reprogram only what is needed.
So if the same mode is used, it shouldn't do a full modeset on VT switch.
That also depends on the driver implementation.

@kdj0c kdj0c force-pushed the atomic branch 6 times, most recently from efa9225 to b20b1a8 Compare January 6, 2026 11:57
Jocelyn Falempe added 8 commits January 11, 2026 00:34
Split uterm_display_bind() in two steps.
In the atomic drm use case, all displays of a video card must be
setup together. So first enable all displays and then call the seat
and terminal callback to make use of the available displays.

The reason is that a GPU might be able to handle a 4K display on DP1
or on DP2, but not both at the same time. So the displays can't be
setup independantly.

Signed-off-by: Jocelyn Falempe <[email protected]>
All drm drivers supports atomic modesetting.
Hopefully it won't break anything.
There is still the fbdev backend for fallback compatibility.

Signed-off-by: Jocelyn Falempe <[email protected]>
 * use log_err() instead of log_error()
 * use ret value instead of errno.

Signed-off-by: Jocelyn Falempe <[email protected]>
Use atomic commit to setup the display. All drm drivers
support it now.
This allows to test the commit before applying the mode, and is more
reliable than the old method.

Using https://github.com/dvdhrm/docs/blob/master/drm-howto/modeset-atomic.c
as a base for atomic modesetting.

Signed-off-by: Jocelyn Falempe <[email protected]>
It is no more used, after the switch to atomic modesetting

Signed-off-by: Jocelyn Falempe <[email protected]>
This makes it a bit easier to debug multi-display issue.

Signed-off-by: Jocelyn Falempe <[email protected]>
When terminal is initialized, and font added, but no display is
attached yet, a warning is logged, but this is expected.
So remove this warning, as it is normal behavior.

Signed-off-by: Jocelyn Falempe <[email protected]>
When switching VT, between Gnome and kmscon, the gnome cursor can
stay. Clear the CRTC_ID property of all cursor plane, to make sure
they are disabled.

Signed-off-by: Jocelyn Falempe <[email protected]>
@kdj0c kdj0c merged commit b2a147b into kmscon:main Jan 12, 2026
2 checks passed
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