The print-resolutions word prints all the resolutions in the QEMU,VGA node's fb-modes property.
Signed-off-by: John Arbuckle programmingkidx@gmail.com --- This patch may depend on the add-resolutions patch.
arch/ppc/qemu/qemu.fs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
diff --git a/arch/ppc/qemu/qemu.fs b/arch/ppc/qemu/qemu.fs index 10df618..745f8c8 100644 --- a/arch/ppc/qemu/qemu.fs +++ b/arch/ppc/qemu/qemu.fs @@ -206,3 +206,22 @@ variable keyboard-phandle 0 keyboard-phandle ! fb-mode-addr fb-mode-len " fb-modes" property ; + +\ print all of the resolutions in the QEMU,VGA node +: print-resolutions { ; fb-mode-addr fb-mode-len } + decimal + " /pci/QEMU,VGA" find-device ( -- ) + " fb-modes" active-package get-package-property + abort" Could not find fb-modes property" + -> fb-mode-len + -> fb-mode-addr + + fb-mode-addr fb-mode-len + 4 - \ limit + fb-mode-addr \ initial value + cr ." Resolutions:" cr + do + I aligned @ . \ print width + ." x " \ print x + I 1+ aligned @ . cr \ print height + 8 +loop +;