On Thu, 2013-02-28 at 08:50 +0200, Michael S. Tsirkin wrote:
On Wed, Feb 27, 2013 at 02:16:23PM -0700, Alex Williamson wrote:
When we start adding root ports and bridges to systems we need some concept of a primary VGA device.The differentiation of the primary device is that it's the default one that responds to the Legacy VGA address ranges. PCs often have a BIOS selection for this.
Seabios already seems to have some concept of this and looks for a VGA class device for which the parent devices all have VGA routing enabled. This seems to work today if QEMU initializes VGA routing for the path it considers the primary.
The first question is whether this bridge path pre-configuration is what we want to keep as the way QEMU communicates the primary VGA device to Seabios? Obviously we could switch to some kind of fwcfg interface, but I tend to think what we have is sufficient.
If it is sufficient, then I think we need to rebuild that path on system reset and we need some way to specify which device to use. One option would be some kind of per PCIDevice property, perhaps "primary_vga". A downside is that users can abuse it by trying to set it for more than one device. Maybe a better approach would be to add a machine property for it, -machine primary_vga=$id.
Yes. And a command to change it when we support hotplug in the future?
Looking at how this would happen on bare metal, there are ACPI methods _GPD (Get Post Device), _SPD (Set Post Device), and _VPD (Video Post Options). So I imagine that if we supported VGA hotplug we'd use those to let the guest specify the primary and continue to use an algorithm in SeaBIOS to post to the lowest B:D.F VGA device if unspecified. I don't know that we need some kind of QMP/QAPI runtime command to change the VGA post device externally on the next boot, real systems likely doesn't have such a hook. For now I'll just start with making SeaBIOS have a way to enable and post the first VGA device when it's behind bridges. Thanks,
Alex
We'll also need some reasonable way to pick a default if unspecified.
Does anyone have any thoughts on managing this? Thanks,
Alex