mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
LinuxKMS: Improve diagnostics when opening the linux framebuffer fails
Collect all the error messages and don't just print the last time. The first one is most likely the interesting one.
This commit is contained in:
parent
168c38899a
commit
0d8ecc6bc6
3 changed files with 9 additions and 5 deletions
|
@ -131,6 +131,7 @@
|
|||
"linebreak",
|
||||
"lineedit",
|
||||
"listview",
|
||||
"LINUXFB",
|
||||
"lvalue",
|
||||
"microcontroller",
|
||||
"microcontrollers",
|
||||
|
|
|
@ -163,7 +163,7 @@ udevadm trigger
|
|||
|
||||
## Legacy LinuxFB Interface
|
||||
|
||||
For software rendering, DRM dumb buffers are the preferred default way of posting framebuffers to the display. If DRM dumb buffers are not supported, the LinuxKMS backend falls back to using the Linux legacy
|
||||
For software rendering, DRM dumb buffers are the preferred default way of posting frame buffers to the display. If DRM dumb buffers are not supported, the LinuxKMS backend falls back to using the Linux legacy
|
||||
framebuffer interface (`/dev/fbX`).
|
||||
|
||||
To override this default and use only the legay framebuffer interface, set the `SLINT_BACKEND_LINUXFB=1` environment variable.
|
||||
To override this default and use only the legacy framebuffer interface, set the `SLINT_BACKEND_LINUXFB=1` environment variable.
|
||||
|
|
|
@ -21,7 +21,7 @@ impl LinuxFBDisplay {
|
|||
pub fn new(
|
||||
device_opener: &crate::DeviceOpener,
|
||||
) -> Result<Arc<dyn super::SoftwareBufferDisplay>, PlatformError> {
|
||||
let mut last_err = None;
|
||||
let mut fb_errors: Vec<String> = Vec::new();
|
||||
|
||||
for fbnum in 0..10 {
|
||||
match Self::new_with_path(
|
||||
|
@ -29,11 +29,14 @@ impl LinuxFBDisplay {
|
|||
std::path::Path::new(&format!("/dev/fb{fbnum}")),
|
||||
) {
|
||||
Ok(dsp) => return Ok(dsp),
|
||||
Err(e) => last_err = Some(e),
|
||||
Err(e) => fb_errors.push(format!("Error using /dev/fb{fbnum}: {}", e)),
|
||||
}
|
||||
}
|
||||
|
||||
Err(last_err.unwrap_or_else(|| "Could not create a linuxfb display".into()))
|
||||
Err(PlatformError::Other(format!(
|
||||
"Could not open any legacy framebuffers.\n{}",
|
||||
fb_errors.join("\n")
|
||||
)))
|
||||
}
|
||||
|
||||
fn new_with_path(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue