[OpenBIOS] [PATCH v2] Implement copy-resolutions-property
G 3
programmingkidx at gmail.com
Sun Oct 2 00:04:14 CEST 2016
On Oct 1, 2016, at 3:24 PM, Mark Cave-Ayland wrote:
> On 01/10/16 19:44, Programmingkid wrote:
>
>> 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?
>
> Well OpenBIOS has always been intended to be as close to real hardware
> implementations as possible, so if there is an existing standard we
> should use it.
>
>>> 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.
>
> You need to see if you can read this information somehow from the VGA
> contoller or via VBE.
I would think for a PCI VGA card any resolution information would be
kept in
either PCI configuration space or in a register. After looking at
several of the
VGA related files in QEMU, there does not appear to be a list of
supported
resolutions. I think using the fb-modes property is fine. I made the
required
changes to the VGA driver and was able to use all the resolutions in
both
Mac OS 9 and Mac OS X.
>
>>> 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.
>
> Just google, since I own no PPC Mac hardware :)
I tried that but didn't find anything relevant. I will accept your
idea and use the
fb-modes property in the QEMU,VGA node.
More information about the OpenBIOS
mailing list