From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UINOI-0002aN-VE for qemu-devel@nongnu.org; Wed, 20 Mar 2013 14:05:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UINOE-0005dt-64 for qemu-devel@nongnu.org; Wed, 20 Mar 2013 14:05:34 -0400 Received: from mail.gw90.de ([188.40.100.199]:37859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UINOD-0005cM-UT for qemu-devel@nongnu.org; Wed, 20 Mar 2013 14:05:30 -0400 Message-ID: <1363802711.26710.3.camel@mattotaupa> From: Paul Menzel Date: Wed, 20 Mar 2013 19:05:11 +0100 In-Reply-To: <20130320165728.22281.10294.stgit@bling.home> References: <20130320165728.22281.10294.stgit@bling.home> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-WUZKA/XTt4yHXNgfMg1U" Mime-Version: 1.0 Subject: Re: [Qemu-devel] [SeaBIOS] [PATCH v3] pciinit: Enable default VGA device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: kevin@koconnor.net, seabios@seabios.org, qemu-devel@nongnu.org, kraxel@redhat.com --=-WUZKA/XTt4yHXNgfMg1U Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dear Alex, Am Mittwoch, den 20.03.2013, 10:58 -0600 schrieb Alex Williamson: > As QEMU gains PCI bridge and PCIe root port support, could you give a commit or version for QEMU please. > we won't always find the VGA device on the root bus. We therefore > need to add support to find and enable a VGA device and the path to it > through the VGA Enable support in the PCI bridge control register. Just to be sure, did you test this with older QEMU too? > Signed-off-by: Alex Williamson > --- >=20 > v3: use pci_config_maskw() to trim out some code > v2: move to qemu specific pciinit.c >=20 > src/optionroms.c | 2 +- > src/pciinit.c | 40 ++++++++++++++++++++++++++++++++++++++++ > src/util.h | 1 + > 3 files changed, 42 insertions(+), 1 deletion(-) >=20 > diff --git a/src/optionroms.c b/src/optionroms.c > index caa2151..ac92613 100644 > --- a/src/optionroms.c > +++ b/src/optionroms.c > @@ -213,7 +213,7 @@ run_file_roms(const char *prefix, int isvga, u64 *sou= rces) > ****************************************************************/ > =20 > // Verify device is a vga device with legacy address decoding enabled. > -static int > +int > is_pci_vga(struct pci_device *pci) > { > if (pci->class !=3D PCI_CLASS_DISPLAY_VGA) > diff --git a/src/pciinit.c b/src/pciinit.c > index ce0a4cc..bb9355f 100644 > --- a/src/pciinit.c > +++ b/src/pciinit.c > @@ -316,6 +316,44 @@ static void pci_bios_init_devices(void) > } > } > =20 > +static void pci_enable_default_vga(void) > +{ > + struct pci_device *pci; > + > + foreachpci(pci) { > + if (is_pci_vga(pci)) { > + dprintf(1, "PCI: Using %02x:%02x.%x for primary VGA\n", > + pci_bdf_to_bus(pci->bdf), pci_bdf_to_dev(pci->bdf), > + pci_bdf_to_fn(pci->bdf)); As this is used several times, a function returning a string with %02x:% 02x.%x would be handy. > + return; > + } > + } [=E2=80=A6] Acked-by: Paul Menzel Thahks, Paul --=-WUZKA/XTt4yHXNgfMg1U Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEABECAAYFAlFJ+lcACgkQPX1aK2wOHVhg2gCfdkd5xwopDWSQflibbAwkmK/K +CoAnRCbI4RWBcF3l3dznL6d3eH1PP2Y =3Meu -----END PGP SIGNATURE----- --=-WUZKA/XTt4yHXNgfMg1U--