* [Qemu-devel] Resource reporting for VGA cards
@ 2012-10-22 19:43 Hervé Poussineau
2012-10-23 7:31 ` Gerd Hoffmann
0 siblings, 1 reply; 5+ messages in thread
From: Hervé Poussineau @ 2012-10-22 19:43 UTC (permalink / raw)
To: QEMU Developers
Hello,
I'm trying to add support for a S3 PCI VGA card to QEMU. It currently
works on some non-x86 systems.
However, on x86, it seems that the card is correctly detected, but there
is no display at all; I think it is due to bad framebuffer address
detection.
There is some resource differences beteween QEMU vs Microsoft Virtual PC.
Resources reported by MS Windows 98 are:
Microsoft Virtual PC:
Memory: 000A0000-000AFFFF
Memory: 000B0000-000BFFFF
I/O: 03B0-03BB
I/O: 03C0-03DF
Memory: F8000000-FBFFFFFF (I think it is the framebuffer)
QEMU:
Memory: 000A0000-000AFFFF
Memory: 000B0000-000BFFFF
I/O: 03B0-03BB
I/O: 03C0-03DF
Memory: FD000000-FDFFFFFF (BAR0)
Memory: 000C0000-000CFFFF (rom file?)
Memory: 04000000-04007FFF (???)
S3 card have a BAR0 of size 0x1000000 (16MB) for the framebuffer, and
ROM is created with bochs vgabios.
QEMU is launched with -m pc -device s3-trio.
Do you have an idea of what can be the last entry, and how to remove it
from resource detection?
And why MS Virtual PC doesn't report ROM file, while QEMU does?
Regards,
Hervé
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Resource reporting for VGA cards
2012-10-22 19:43 [Qemu-devel] Resource reporting for VGA cards Hervé Poussineau
@ 2012-10-23 7:31 ` Gerd Hoffmann
2012-10-23 21:04 ` Hervé Poussineau
0 siblings, 1 reply; 5+ messages in thread
From: Gerd Hoffmann @ 2012-10-23 7:31 UTC (permalink / raw)
To: Hervé Poussineau; +Cc: QEMU Developers
On 10/22/12 21:43, Hervé Poussineau wrote:
> Hello,
>
> I'm trying to add support for a S3 PCI VGA card to QEMU. It currently
> works on some non-x86 systems.
> However, on x86, it seems that the card is correctly detected, but there
> is no display at all; I think it is due to bad framebuffer address
> detection.
I'd tend to suspect vgabios issues.
> QEMU:
> Memory: 000A0000-000AFFFF
> Memory: 000B0000-000BFFFF
> I/O: 03B0-03BB
> I/O: 03C0-03DF
> Memory: FD000000-FDFFFFFF (BAR0)
> Memory: 000C0000-000CFFFF (rom file?)
> Memory: 04000000-04007FFF (???)
Can you try lspci in a linux guest?
Do you have a git tree somewhere?
> S3 card have a BAR0 of size 0x1000000 (16MB) for the framebuffer, and
> ROM is created with bochs vgabios.
I'd use seabios instead, but bochs vga should work too. Of course the
PCI IDs must be correct otherwise seabios ignores the rom.
> QEMU is launched with -m pc -device s3-trio.
/me suggests to add '-vga none' so you don't end up with both cirrus & s3
cheers,
Gerd
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Resource reporting for VGA cards
2012-10-23 7:31 ` Gerd Hoffmann
@ 2012-10-23 21:04 ` Hervé Poussineau
2012-10-24 14:08 ` Gerd Hoffmann
0 siblings, 1 reply; 5+ messages in thread
From: Hervé Poussineau @ 2012-10-23 21:04 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: QEMU Developers
Hi,
Gerd Hoffmann a écrit :
> On 10/22/12 21:43, Hervé Poussineau wrote:
>> Hello,
>>
>> I'm trying to add support for a S3 PCI VGA card to QEMU. It currently
>> works on some non-x86 systems.
>> However, on x86, it seems that the card is correctly detected, but there
>> is no display at all; I think it is due to bad framebuffer address
>> detection.
>
> I'd tend to suspect vgabios issues.
>
>> QEMU:
>> Memory: 000A0000-000AFFFF
>> Memory: 000B0000-000BFFFF
>> I/O: 03B0-03BB
>> I/O: 03C0-03DF
>> Memory: FD000000-FDFFFFFF (BAR0)
>> Memory: 000C0000-000CFFFF (rom file?)
>> Memory: 04000000-04007FFF (???)
>
> Can you try lspci in a linux guest?
> Do you have a git tree somewhere?
Git tree is available at git://repo.or.cz/qemu/hpoussin.git branch s3.
Sorry, I don't have handy a lspci output, I will try to provide you one
later.
>> S3 card have a BAR0 of size 0x1000000 (16MB) for the framebuffer, and
>> ROM is created with bochs vgabios.
>
> I'd use seabios instead, but bochs vga should work too. Of course the
> PCI IDs must be correct otherwise seabios ignores the rom.
>
>> QEMU is launched with -m pc -device s3-trio.
>
> /me suggests to add '-vga none' so you don't end up with both cirrus & s3
OK, tested with -vga none -device s3-trio, and I also tried with seavgabios.
With seavgabios, BIOS is displayed, Windows starts to load, and then
Windows 98 seems to stop loading at animated screen during load.
With bochs vgabios, Windows 98 loads with fail-safe display driver,
saying that the device doesn't work.
Hervé
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Resource reporting for VGA cards
2012-10-23 21:04 ` Hervé Poussineau
@ 2012-10-24 14:08 ` Gerd Hoffmann
2012-11-03 21:11 ` Hervé Poussineau
0 siblings, 1 reply; 5+ messages in thread
From: Gerd Hoffmann @ 2012-10-24 14:08 UTC (permalink / raw)
To: Hervé Poussineau; +Cc: QEMU Developers
On 10/23/12 23:04, Hervé Poussineau wrote:
> Hi,
> Gerd Hoffmann a écrit :
>> On 10/22/12 21:43, Hervé Poussineau wrote:
>>> Hello,
>>>
>>> I'm trying to add support for a S3 PCI VGA card to QEMU. It currently
>>> works on some non-x86 systems.
>>> However, on x86, it seems that the card is correctly detected, but there
>>> is no display at all; I think it is due to bad framebuffer address
>>> detection.
>>
>> I'd tend to suspect vgabios issues.
>>
>>> QEMU:
>>> Memory: 000A0000-000AFFFF
>>> Memory: 000B0000-000BFFFF
>>> I/O: 03B0-03BB
>>> I/O: 03C0-03DF
>>> Memory: FD000000-FDFFFFFF (BAR0)
>>> Memory: 000C0000-000CFFFF (rom file?)
>>> Memory: 04000000-04007FFF (???)
>>
>> Can you try lspci in a linux guest?
>> Do you have a git tree somewhere?
>
> Git tree is available at git://repo.or.cz/qemu/hpoussin.git branch s3.
> Sorry, I don't have handy a lspci output, I will try to provide you one
> later.
00:02.0 VGA compatible controller: S3 Inc. 86c764/765 [Trio32/64/64V+]
(prog-if 00 [VGA controller])
Subsystem: Red Hat, Inc Device 1100
Physical Slot: 2
Flags: fast devsel
Memory at fd000000 (32-bit, prefetchable) [size=16M]
Expansion ROM at febd0000 [disabled] [size=64K]
Looks perfectly fine. I have no idea where the last two memory ranges
come from.
>>> S3 card have a BAR0 of size 0x1000000 (16MB) for the framebuffer, and
>>> ROM is created with bochs vgabios.
>>
>> I'd use seabios instead, but bochs vga should work too. Of course the
>> PCI IDs must be correct otherwise seabios ignores the rom.
>>
>>> QEMU is launched with -m pc -device s3-trio.
>>
>> /me suggests to add '-vga none' so you don't end up with both cirrus & s3
>
> OK, tested with -vga none -device s3-trio, and I also tried with
> seavgabios.
>
> With seavgabios, BIOS is displayed, Windows starts to load, and then
> Windows 98 seems to stop loading at animated screen during load.
>
> With bochs vgabios, Windows 98 loads with fail-safe display driver,
> saying that the device doesn't work.
I'd suggest to ditch bochs vbe support from the s3 (cirrus hasn't it
too), i.e. not register vbe_ports and drop CONFIG_VGA_BOCHS from
roms/config.vga.s3
vgabios will support only standard vga modes then, but with a s3 driver
installed win98 should be able to drive the card with svga modes too.
It is possible to add s3 support to seavgabios simliar to cirrus for
VESA support.
Linux s3fb accepts the card:
[ 56.157842] fbcon: S3 Unknown (fb0) is primary device
[ 58.537524] Console: switching to colour frame buffer device 80x30
[ 58.578909] fb0: S3 Unknown on 0000:00:02.0, 4 MB RAM, 7 MHz MCLK
[ 58.578969] fb0: unknown chip, CR2D=0, CR2E=0, CRT2F=0, CRT30=0
screen looks a bit funky though, probably due to the incomplete emulation.
s3fb thinks the card has 4 MB whereas BAR0 is 16 MB. Something is fishy
there. Maybe just the incomplete emulation too.
HTH,
Gerd
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Resource reporting for VGA cards
2012-10-24 14:08 ` Gerd Hoffmann
@ 2012-11-03 21:11 ` Hervé Poussineau
0 siblings, 0 replies; 5+ messages in thread
From: Hervé Poussineau @ 2012-11-03 21:11 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: QEMU Developers
Hi,
Gerd Hoffmann a écrit :
> On 10/23/12 23:04, Hervé Poussineau wrote:
>> Hi,
>> Gerd Hoffmann a écrit :
>>> On 10/22/12 21:43, Hervé Poussineau wrote:
>>>> Hello,
>>>>
>>>> I'm trying to add support for a S3 PCI VGA card to QEMU. It currently
>>>> works on some non-x86 systems.
>>>> However, on x86, it seems that the card is correctly detected, but there
>>>> is no display at all; I think it is due to bad framebuffer address
>>>> detection.
>>> I'd tend to suspect vgabios issues.
>>>
>>>> QEMU:
>>>> Memory: 000A0000-000AFFFF
>>>> Memory: 000B0000-000BFFFF
>>>> I/O: 03B0-03BB
>>>> I/O: 03C0-03DF
>>>> Memory: FD000000-FDFFFFFF (BAR0)
>>>> Memory: 000C0000-000CFFFF (rom file?)
>>>> Memory: 04000000-04007FFF (???)
>>> Can you try lspci in a linux guest?
>>> Do you have a git tree somewhere?
>> Git tree is available at git://repo.or.cz/qemu/hpoussin.git branch s3.
>> Sorry, I don't have handy a lspci output, I will try to provide you one
>> later.
>
> 00:02.0 VGA compatible controller: S3 Inc. 86c764/765 [Trio32/64/64V+]
> (prog-if 00 [VGA controller])
> Subsystem: Red Hat, Inc Device 1100
> Physical Slot: 2
> Flags: fast devsel
> Memory at fd000000 (32-bit, prefetchable) [size=16M]
> Expansion ROM at febd0000 [disabled] [size=64K]
>
> Looks perfectly fine. I have no idea where the last two memory ranges
> come from.
OK.
>>>> S3 card have a BAR0 of size 0x1000000 (16MB) for the framebuffer, and
>>>> ROM is created with bochs vgabios.
>>> I'd use seabios instead, but bochs vga should work too. Of course the
>>> PCI IDs must be correct otherwise seabios ignores the rom.
>>>
>>>> QEMU is launched with -m pc -device s3-trio.
>>> /me suggests to add '-vga none' so you don't end up with both cirrus & s3
>> OK, tested with -vga none -device s3-trio, and I also tried with
>> seavgabios.
>>
>> With seavgabios, BIOS is displayed, Windows starts to load, and then
>> Windows 98 seems to stop loading at animated screen during load.
>>
>> With bochs vgabios, Windows 98 loads with fail-safe display driver,
>> saying that the device doesn't work.
>
> I'd suggest to ditch bochs vbe support from the s3 (cirrus hasn't it
> too), i.e. not register vbe_ports and drop CONFIG_VGA_BOCHS from
> roms/config.vga.s3
Done.
>
> vgabios will support only standard vga modes then, but with a s3 driver
> installed win98 should be able to drive the card with svga modes too.
> It is possible to add s3 support to seavgabios simliar to cirrus for
> VESA support.
>
> Linux s3fb accepts the card:
>
> [ 56.157842] fbcon: S3 Unknown (fb0) is primary device
> [ 58.537524] Console: switching to colour frame buffer device 80x30
> [ 58.578909] fb0: S3 Unknown on 0000:00:02.0, 4 MB RAM, 7 MHz MCLK
> [ 58.578969] fb0: unknown chip, CR2D=0, CR2E=0, CRT2F=0, CRT30=0
>
> screen looks a bit funky though, probably due to the incomplete emulation.
>
> s3fb thinks the card has 4 MB whereas BAR0 is 16 MB. Something is fishy
> there. Maybe just the incomplete emulation too.
>
Thanks for your help. I had to lower BAR0 size to 8 MB, which seems to
be the maximum allowed for the real card.
Current state is that NT4 works in 640x480, Windows 98 doesn't work, and
Linux s3fb accepts the card but display is quite incorrect.
[ 102.610239] Console: switching to colour framebuffer device 80x30
[ 102.622086] fb0: S3 Trio32 on 0000:00:03.0, 8 MB RAM, 7 MHz MCLK
So, chip is recognized with the right name, and with the right RAM size.
I need to continue my debugging...
Regards,
Hervé
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-11-03 21:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-22 19:43 [Qemu-devel] Resource reporting for VGA cards Hervé Poussineau
2012-10-23 7:31 ` Gerd Hoffmann
2012-10-23 21:04 ` Hervé Poussineau
2012-10-24 14:08 ` Gerd Hoffmann
2012-11-03 21:11 ` Hervé Poussineau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).