Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EE7D8CD98C7 for ; Thu, 11 Jun 2026 20:28:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A324010F118; Thu, 11 Jun 2026 20:28:29 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="En7e8UG7"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by gabe.freedesktop.org (Postfix) with ESMTPS id 052F310F118 for ; Thu, 11 Jun 2026 20:28:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1781209686; x=1812745686; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=N+u8xkNxbj85/6D9K4+piRDobU6GXiRd+zN5Bi1nh0w=; b=En7e8UG76nDQogcAqAlcMbCdnGdb0dqMPNCv4/SQrjgA+pgt6gsy+aJR LG0HcoEEiao+OSLl8wDtRj6UgYnSKUmE69ykm6594qWfIWRnKO8+addfo hoAsb4haINc+90H32wIELglEJlXUtCHtm7WfhDm7t7gLQzQ1bbDW1nVzV /kxspikgVGpSRzDPV4A+K9NGZnkqYyMfNuiDxWVBnMo76hTiGOgcj0c+S P7gv2v4ecQm0EXNa7OEvI1Y7JFxPBYzydzPxD9doFD5qnwxAK85l+wC6A F5T0orVhefsvnSmXpC9X+tutgHfzo5osIFYEc/qSgQ2+P6+8RRx6Jz3+N w==; X-CSE-ConnectionGUID: GnH6ka2KRrW3eM4k4rLM6w== X-CSE-MsgGUID: 7y93+mffSySCKM9C/Heghw== X-IronPort-AV: E=McAfee;i="6800,10657,11813"; a="107470555" X-IronPort-AV: E=Sophos;i="6.24,199,1774335600"; d="scan'208";a="107470555" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2026 13:28:06 -0700 X-CSE-ConnectionGUID: 5gNVuczOTw+oYLECNQSZGA== X-CSE-MsgGUID: 0KhVsk7xSem976RJ7diGhg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.24,199,1774335600"; d="scan'208";a="276788273" Received: from orsosgc001.jf.intel.com ([10.88.27.185]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2026 13:28:06 -0700 From: Ashutosh Dixit To: igt-dev@lists.freedesktop.org Cc: Kamil Konieczny , Zbigniew Kempczynski , janusz.krzysztofik@linux.intel.com, lukasz.laguna@intel.com Subject: [PATCH i-g-t] lib/intel_chipset: Extend intel_get_pci_device to PCI accelerator class Date: Thu, 11 Jun 2026 13:28:01 -0700 Message-ID: <20260611202801.3945761-1-ashutosh.dixit@intel.com> X-Mailer: git-send-email 2.54.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" In addition to PCI display class devices, Intel devices can also be PCI accelerator class devices. Extend intel_get_pci_device() to also find these devices. Signed-off-by: Ashutosh Dixit --- lib/intel_chipset.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/intel_chipset.c b/lib/intel_chipset.c index 760faede24..3265fa778b 100644 --- a/lib/intel_chipset.c +++ b/lib/intel_chipset.c @@ -86,20 +86,21 @@ intel_get_pci_device(void) pci_dev = pci_device_find_by_slot(0, 0, 2, 0); if (pci_dev == NULL || pci_dev->vendor_id != 0x8086) { struct pci_device_iterator *iter; - struct pci_id_match match; + struct pci_id_match match = {}; match.vendor_id = 0x8086; /* Intel */ match.device_id = PCI_MATCH_ANY; match.subvendor_id = PCI_MATCH_ANY; match.subdevice_id = PCI_MATCH_ANY; - match.device_class = 0x3 << 16; - match.device_class_mask = 0xff << 16; - - match.match_data = 0; - iter = pci_id_match_iterator_create(&match); - pci_dev = pci_device_next(iter); + while ((pci_dev = pci_device_next(iter))) { + uint8_t device_class = (pci_dev->device_class >> 16) & 0xff; + + /* PCI display (0x03) or accelerator (0x12) class devices */ + if (device_class == 0x03 || device_class == 0x12) + break; + } pci_iterator_destroy(iter); } igt_require_f(pci_dev, "Couldn't find Intel graphics card\n"); -- 2.54.0