[preflight] Improve warning output for graphics chipset check.
Also: small tweak to output on another check
Change-Id: I3e19dad9a3d3eb3a4cb734d9ddd24fd4588cd491
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/487399
Commit-Queue: Gabe Schine <thatguy@google.com>
Reviewed-by: Dan Johnson <computerdruid@google.com>
Reviewed-by: Rich Kadel <richkadel@google.com>
diff --git a/src/developer/ffx/plugins/platform/preflight/src/check/emu_networking.rs b/src/developer/ffx/plugins/platform/preflight/src/check/emu_networking.rs
index d8f16e6..bba6496 100644
--- a/src/developer/ffx/plugins/platform/preflight/src/check/emu_networking.rs
+++ b/src/developer/ffx/plugins/platform/preflight/src/check/emu_networking.rs
@@ -22,7 +22,8 @@
$ sudo ip tuntap add dev qemu mode tap user $USER
$ sudo ip link set qemu up";
static SUCCESS_MESSAGE_LINUX: &str = "Found tuntap device named 'qemu' for current user";
-static SUCCESS_MESSAGE_MACOS: &str = "MacOS provides networking for the Fuchsia emulator natively";
+static SUCCESS_MESSAGE_MACOS: &str =
+ "MacOS supports Fuchsia emulator networking requirements out of the box";
lazy_static! {
// Regex to match the output of `ip tuntap list` looking for a tuntap named "qemu".
diff --git a/src/developer/ffx/plugins/platform/preflight/src/check/femu_graphics.rs b/src/developer/ffx/plugins/platform/preflight/src/check/femu_graphics.rs
index e5f5f85..8181de5 100644
--- a/src/developer/ffx/plugins/platform/preflight/src/check/femu_graphics.rs
+++ b/src/developer/ffx/plugins/platform/preflight/src/check/femu_graphics.rs
@@ -34,15 +34,18 @@
static NVIDIA_REQ_DRIVER_VERSION: (u32, u32) = (440, 100);
-static NO_GRAPHICS_WARNING_LINUX: &str =
- "Did not find any supported graphics acceleration hardware. Usage of \
-the graphical Fuchsia emulator (`fx emu`) will fall back to a slow \
-software renderer. The terminal emulator (`fx qemu`) is unaffected.";
-
-static NO_GRAPHICS_WARNING_MACOS: &str =
- "Did not find any supported graphics acceleration hardware. Usage of \
-the graphical Fuchsia emulator (`fx vdl --start`) will fall back to a slow \
-software renderer. The terminal emulator (`fx qemu`) is unaffected.";
+macro_rules! NO_GRAPHICS_WARNING {
+ () => {
+ "Did not find tested and supported graphics acceleration hardware. Usage of \
+the graphical Fuchsia emulator (`{command}`) may fall back to a slow \
+software renderer. The terminal emulator (`fx qemu`) is unaffected.\n\n\
+Found the following chipsets: {chipsets}\n\n\
+Only a small set of chipsets are officially supported: \
+https://fuchsia.dev/fuchsia-src/get-started/set_up_femu#supported-hardware"
+ };
+}
+static FUCHSIA_EMU_COMMAND_LINUX: &str = "fx emu";
+static FUCHSIA_EMU_COMMAND_MACOS: &str = "fx vdl --start";
pub struct FemuGraphics<'a> {
command_runner: &'a CommandRunner,
@@ -124,7 +127,11 @@
let cards = self.linux_find_supported_graphics_cards()?;
if cards.is_empty() {
- return Ok(Warning(NO_GRAPHICS_WARNING_LINUX.to_string()));
+ return Ok(Warning(format!(
+ NO_GRAPHICS_WARNING!(),
+ command = FUCHSIA_EMU_COMMAND_LINUX,
+ chipsets = linux_find_graphics_cards(self.command_runner)?.join(", ")
+ )));
}
let driver_version = self.linux_get_nvidia_driver_version()?;
@@ -147,7 +154,11 @@
let cards = self.macos_find_supported_graphics_cards()?;
Ok(if cards.is_empty() {
- Warning(NO_GRAPHICS_WARNING_MACOS.to_string())
+ Warning(format!(
+ NO_GRAPHICS_WARNING!(),
+ command = FUCHSIA_EMU_COMMAND_MACOS,
+ chipsets = macos_find_graphics_cards(self.command_runner)?.join(", ")
+ ))
} else {
Success(format!("Found supported graphics hardware: {}", cards.join(", ")))
})