[PATCH v2 4/5] drm/xe/configfs: Allow configurations only for Intel VGA devices

Michal Wajdeczko michal.wajdeczko at intel.com
Fri Jul 18 14:17:27 UTC 2025


The Xe driver supports only Intel GPUs devices that all are PCI
VGA class devices. Reject creation of configuration directories
for PCI device addresses that are not Intel or VGA.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
Cc: Lucas De Marchi <lucas.demarchi at intel.com>
---
 drivers/gpu/drm/xe/xe_configfs.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_configfs.c b/drivers/gpu/drm/xe/xe_configfs.c
index 36e2b45b305f..59b18f6a46b0 100644
--- a/drivers/gpu/drm/xe/xe_configfs.c
+++ b/drivers/gpu/drm/xe/xe_configfs.c
@@ -260,6 +260,7 @@ static struct config_group *xe_config_make_device_group(struct config_group *gro
 	struct xe_config_device *dev;
 	struct pci_dev *pdev;
 	char canonical[16];
+	bool match;
 	int ret;
 
 	ret = sscanf(name, "%x:%x:%x.%x", &domain, &bus, &slot, &function);
@@ -275,8 +276,14 @@ static struct config_group *xe_config_make_device_group(struct config_group *gro
 	pdev = pci_get_domain_bus_and_slot(domain, bus, PCI_DEVFN(slot, function));
 	if (!pdev)
 		return ERR_PTR(-ENODEV);
+
+	match = pci_is_vga(pdev) && pdev->vendor == PCI_VENDOR_ID_INTEL;
+
 	pci_dev_put(pdev);
 
+	if (!match)
+		return ERR_PTR(-ENODEV);
+
 	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
 	if (!dev)
 		return ERR_PTR(-ENOMEM);
-- 
2.47.1



More information about the Intel-xe mailing list