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

Programmingkid programmingkidx at gmail.com
Sat Oct 1 20:44:25 CEST 2016


On Oct 1, 2016, at 2:11 PM, Mark Cave-Ayland wrote:

> 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.

I suppose this would only require a few changes to my patches. I just feel
the word 'resolutions' is easier to remember and type than 'fb-modes'.

What is the advantage of doing things this way?

> 
> 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.

I'm sorry I didn't answer your question. I must have missed it. Do you
know what file has these built-in resolutions? Currently I do not know
a way to access these resolutions.

> 
> 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.

Is this the format: widthxheightxbitdepth ? I just think it is easier to
specify only width and height. The monitors control panel in Mac OS 9 allows
the user to switch the bitdepth at any resolution (within vram limits). 

Do you have any documentation on the fb-mode property? I did a quick check
on my Macintosh's video card node in open firmware and couldn't find this
fb-mode property. 


More information about the OpenBIOS mailing list