From f3b1a53858299fd29f442b597212aecf75f84cbe Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Fri, 23 Oct 2020 01:42:25 +0000 Subject: inteltool: Only use real graphics devices Right now IGD is hard coded to 0:2.0 and if that device is there, it is blindly used, even if it is not a graphics device. Look at the PCI class to make sure we're not using the wrong device. Change-Id: Ia7f52071bd202e2960faba0f46e4fa5e14ad65f8 Signed-off-by: Stefan Reinauer Reviewed-on: https://review.coreboot.org/c/coreboot/+/46673 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- util/inteltool/inteltool.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/inteltool/inteltool.c b/util/inteltool/inteltool.c index aadd0fb3c4..3fb7707a2a 100644 --- a/util/inteltool/inteltool.c +++ b/util/inteltool/inteltool.c @@ -773,13 +773,13 @@ int main(int argc, char *argv[]) } gfx = pci_get_dev(pacc, 0, 0, 0x02, 0); - if (gfx) { pci_fill_info(gfx, PCI_FILL_IDENT | PCI_FILL_BASES | PCI_FILL_CLASS); - - if (gfx->vendor_id != PCI_VENDOR_ID_INTEL) - gfx = 0; + if ((gfx->device_class & 0xff00) != 0x0300) + gfx = NULL; + else if (gfx->vendor_id != PCI_VENDOR_ID_INTEL) + gfx = NULL; } if (sb->device_id == PCI_DEVICE_ID_INTEL_BAYTRAIL_LPC) { -- cgit v1.2.3