General improvements to XConfig (Focused on FB drivers and QEMU/KVM).#57
Merged
Conversation
The QXL/SPICE X drivers have had known issues (segfaults) both on X.Org/XLibre and Linux/BSD/..., this change makes XConfig skip that driver and use the basic FB ones instead. I've also simplified the setup of the frame-buffer drivers, removing the unnecessary and restrictive (in terms of available modes) SCFB X Server config. With these new changes when no other driver is setup, instead of defaulting only to SCFB, which is not available on non UEFI systems, XConfig keeps both the VESA and SCFB drivers installed, and lets the server arbitrate between them based on their availability.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRefactors XConfig’s graphics configuration to prefer safer framebuffer-based drivers (SCFB/VESA) instead of QXL/SPICE on virtualized setups, unifies framebuffer setup handling across presets, and cleans up package/input driver management, including removal of deprecated NVIDIA 304 support. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
This would probably need modification in ghostbsd-build.
Yes, this is a good idea.
I did remove it from ghostbsd-build. I might have forgotten to remove it here. Yes it can be remove.
That too is a good idea.
I thought we did need evdev for touch screens. Is it not the case anymore? |
ericbsd
approved these changes
May 24, 2026
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Now that SCFB/VESA configuration is unified, check for and simplify any remaining code paths or options that still assume separate
setup_scfb/setup_vesabehavior so the logic is consistently single-sourced. - When switching to framebuffer defaults on QEMU/KVM, ensure the selection logic is based on runtime capability detection (e.g., EFI vs legacy and presence of KMS) rather than only hypervisor presets so that physical hardware and other hypervisors aren’t unintentionally forced into suboptimal drivers.
- If you standardize on
pkg-staticand local/xdriversrepos, consider centralizing all package install/remove calls in one helper so that future changes to the repo URI or pkg tool only need to be updated in a single place.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Now that SCFB/VESA configuration is unified, check for and simplify any remaining code paths or options that still assume separate `setup_scfb`/`setup_vesa` behavior so the logic is consistently single-sourced.
- When switching to framebuffer defaults on QEMU/KVM, ensure the selection logic is based on runtime capability detection (e.g., EFI vs legacy and presence of KMS) rather than only hypervisor presets so that physical hardware and other hypervisors aren’t unintentionally forced into suboptimal drivers.
- If you standardize on `pkg-static` and local `/xdrivers` repos, consider centralizing all package install/remove calls in one helper so that future changes to the repo URI or pkg tool only need to be updated in a single place.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
l'm creating this PR for general improvements and fixes to XConfig after my interactions with user's issues and reading the script.
The first problem was the issues users faced on QEMU, which was caused by XConfig defaulting to the QXL/SPICE driver that has known issues and crashes on both X.Org/XLibre and on Linux/BSD..., until that is solved by either upstream XConfig should default to the frame-buffer derives.
Next, XConfig uses an odd algorithm when using / falling back to FB drivers (VESA, SCFB).
So this is how VESA and SCFB should be chosen:
VESA: Should be chosen when the system has booted in legacy BIOS mode / has not access to the EFI FB through VT, it should be never force enabled when a kernel KMS driver is loaded (Would cause an irrecoverable black screen in that scenario).
SCFB: Should be chosen when the system has booted in UEFI mode and has access to the EFI FB.
When these drivers are installed, the X server automatically arbitrates between the two, if the system is booted in either UEFI or BIOS modes, so instead of force enabling only the SCFB driver, when no other driver is found, the script should instead keep both of the *-vesa-* and *-scfb-* drivers and let the server choose what it finds fit.
I have already applied this change for the setup_scfb / setup_vesa options and distilled them into setup_fb, but I think this should be applied for the bhyve/hyperv/safe options too, in all these cases the system can be booted both in BIOS/UEFI* mode so both VESA and SCFB drivers should be available for the server to choose from. A dedicated config is not needed in these cases. and the ones provided actually do more harm my limiting the available resolutions and modes.
Some other misc points I found:
pkg repoduring the image generation and added to the pkg repo configuration with afile:///URI and disabled by default, this would simplify the script and for installing packages from /xdrivers it could simply been enabled when doingpkg installwith the-rflag.pkg-staticmight be a better choice in this script in place ofpkgpkg removeactions in a single call ofpkgcan speed up the deletion by removing thepkginvocation overhead. This can be done by adding the packages to be removed to a string and then "committing" the removal of them with a single call of pkg.Summary by Sourcery
Improve XConfig’s default graphics configuration and cleanup legacy driver handling.
New Features:
Bug Fixes:
Enhancements: