Skip to content

xfree86: refactor BSD console setup#1865

Open
metux wants to merge 11 commits intomasterfrom
wip/bsd_init
Open

xfree86: refactor BSD console setup#1865
metux wants to merge 11 commits intomasterfrom
wip/bsd_init

Conversation

@metux
Copy link
Contributor

@metux metux commented Jan 27, 2026

Replace ugly ifdef-zoo and frequent switching over current console backend type, splitting it all off into separate console drivers and use function pointers where we can directly call into the currently active console driver.

At this stage just doing it for BSD (the only platform that needs several ones). Later iterations will also do it for the other platforms, so we can consolidate the corresponding DDX entry points and move all console drivers to one common place.
The individual platforms then will just have a little bit of glue/setup code left, for probing from the list of their supported console drivers. Adding new console drivers will be pretty easy now.

@metux metux requested review from a team, algrid, b-aaz, cepelinas9000 and josephcrowell January 27, 2026 10:58
@metux metux force-pushed the wip/bsd_init branch 2 times, most recently from b61501b to c8fa26b Compare February 2, 2026 10:59
@X11Libre X11Libre deleted a comment from github-actions bot Feb 2, 2026
@X11Libre X11Libre deleted a comment from github-actions bot Feb 2, 2026
@X11Libre X11Libre deleted a comment from github-actions bot Feb 2, 2026
@X11Libre X11Libre deleted a comment from github-actions bot Feb 2, 2026
metux added 11 commits February 3, 2026 15:27
These callbacks will be used platform specific code for VT backend specific
functions, so we get rid of complicated #ifdef-zoos and demuxing.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Factor out the logic for acquiring a VT into separate function instead
of wild goto's.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Instead of returning the fd, assign it into xf86Info.consoleFd directly
from within the console probe functions (they're already assigning other
fields anyways) and turn the return value into bool (just report success).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Moving the console post-open steps (eg. acquire_vt()) into the indivual
console driver's open proc, so we don't need the extra switch() and
related #ifdef zoo anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
* move console type specific close logic into separate functions
* install them into xf86_console_proc_close on init

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
factor it out into per console-driver functions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Yet another step on factoring out console type specific code so
separate drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Yet another step on factoring out console type specific code so
separate drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
factor it out into per console-driver functions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Factor it out to separate per-console-driver functions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Prefer stdbool over our own historical Bool.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
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.

1 participant