[OpenBIOS] [PATCH v2] Implement copy-resolutions-property

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sat Oct 1 20:11:55 CEST 2016


On 26/09/16 18:05, Programmingkid wrote:

> The copy-resolutions-property copies all the resolutions from the resolutions
> property of the options node to the resolutions property of the QEMU,VGA node.
> This is used to support specifying resolutions via the command-line.
> 
> Signed-off-by: John Arbuckle <programmingkidx at gmail.com>
> ---
> v2:
> Eliminated all if conditions.
> 
>  arch/ppc/qemu/qemu.fs | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/arch/ppc/qemu/qemu.fs b/arch/ppc/qemu/qemu.fs
> index 3d99a34..b53115a 100644
> --- a/arch/ppc/qemu/qemu.fs
> +++ b/arch/ppc/qemu/qemu.fs
> @@ -138,3 +138,13 @@ variable keyboard-phandle 0 keyboard-phandle !
>      3drop 0
>    then
>  ;
> +
> +\ Copies the resolutions property from the /options node to QEMU,VGA node
> +
> +: copy-resolutions-property  ( -- )
> +    " /options" find-device
> +    " resolutions" active-package get-package-property
> +    abort" copy-resolutions-property: Failed to find resolutions property!"
> +    " /pci/QEMU,VGA" find-device
> +    " resolutions" property
> +;

Some more general thoughts on the approach: I think that you're doing
this the wrong way around. Rather than injecting the resolutions into
the QEMU,VGA device, I think the better way is to alter QEMU,VGA.fs so
that it searches for an optional "fb-modes" property under /options,
parses it, and then sets its own encode-int property version.

Also you never replied if there was a way of reading the in-built
resolutions from the QEMU VGA controller? If yes, let's grab the
information from there. If not, then it would make sense to add the
basic VGA/XGA resolutions into the QEMU,VGA device as default and then
simply add any custom resolution to the end of the list.

Finally for reference take a look at the Sun Framebuffer FAQ at
http://www.sunhelp.org/faq/FrameBuffer.html to check the format the mode
string should be in (it seems to be the format eluded to earlier by
Tarl) and also the parameter should perhaps be called "fb-mode" which is
the name used by Apple's OF implementation.


ATB,

Mark.




More information about the OpenBIOS mailing list