Skip to contentSkip to conversation

mei: gsc: add support for auxiliary device created by Xe driver

PATCH New Tomas Winkler 1 participant 5 messages Jan 23, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/5 mei: gsc: add support for auxiliary device created by Xe driver

From: Vitaly Lubart <[email protected]>

Add support for gsc mei auxiliary device created by Xe driver

---
 drivers/misc/mei/gsc-me.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/misc/mei/gsc-me.c +5 -0
index 6be8f1cc052c13be3607432f..9e558ec2ea1d5cef1aee7fb3 100644
@@ -292,6 +292,10 @@ static const struct auxiliary_device_id mei_gsc_id_table[] = {
 		.name = "i915.mei-gscfi",
 		.driver_data = MEI_ME_GSCFI_CFG,
 	},
+	{
+		.name = "xe.mei-gscfi",
+		.driver_data = MEI_ME_GSCFI_CFG,
+	},
 	{
 		/* sentinel */
 	}
@@ -312,5 +316,6 @@ module_auxiliary_driver(mei_gsc_driver);
 MODULE_AUTHOR("Intel Corporation");
 MODULE_ALIAS("auxiliary:i915.mei-gsc");
 MODULE_ALIAS("auxiliary:i915.mei-gscfi");
+MODULE_ALIAS("auxiliary:xe.mei-gscfi");
 MODULE_DESCRIPTION("Intel(R) Graphics System Controller");
 MODULE_LICENSE("GPL");
Signature · 1 line
2.43.0
#1 lore raw

PATCH 2/5 mei: hdcp: match without driver name

From: Alexander Usyskin <[email protected]>

Xe driver uses this component too, but current match function matches by i915 driver name.
Remove dependency on i915 driver name in component_match function. Use PCI header information to match Intel graphics device.

---
 drivers/misc/mei/hdcp/mei_hdcp.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/misc/mei/hdcp/mei_hdcp.c +12 -2
index 51359cc5ece9a109d1d3dc96..f8759a6c9ed331f2316cb6bd 100644
@@ -17,6 +17,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/mei.h>
 #include <linux/mei_cl_bus.h>
@@ -781,9 +782,18 @@ static int mei_hdcp_component_match(struct device *dev, int subcomponent,
 				    void *data)
 {
 	struct device *base = data;
+	struct pci_dev *pdev;
 
-	if (!dev->driver || strcmp(dev->driver->name, "i915") ||
-	    subcomponent != I915_COMPONENT_HDCP)
+	if (!dev_is_pci(dev))
+		return 0;
+
+	pdev = to_pci_dev(dev);
+
+	if (pdev->class != (PCI_CLASS_DISPLAY_VGA << 8) ||
+	    pdev->vendor != PCI_VENDOR_ID_INTEL)
+		return 0;
+
+	if (subcomponent != I915_COMPONENT_HDCP)
 		return 0;
 
 	base = base->parent;
Signature · 1 line
2.43.0
#2 lore raw

PATCH 3/5 mei: pxp: match without driver name

In reply to Tomas Winkler

From: Alexander Usyskin <[email protected]>

Xe driver uses this component too, but current match function matches by i915 driver name.
Remove dependency on i915 driver name in component_match function. Use PCI header information to match Intel graphics device.

---
 drivers/misc/mei/pxp/mei_pxp.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/misc/mei/pxp/mei_pxp.c +12 -2
index 787c6a27a4be60f9322c6aad..b1e4c23b31a32957c616f0ed 100644
@@ -13,6 +13,7 @@
 
 #include <linux/delay.h>
 #include <linux/module.h>
+#include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/mei.h>
 #include <linux/mei_cl_bus.h>
@@ -225,12 +226,21 @@ static int mei_pxp_component_match(struct device *dev, int subcomponent,
 				   void *data)
 {
 	struct device *base = data;
+	struct pci_dev *pdev;
 
 	if (!dev)
 		return 0;
 
-	if (!dev->driver || strcmp(dev->driver->name, "i915") ||
-	    subcomponent != I915_COMPONENT_PXP)
+	if (!dev_is_pci(dev))
+		return 0;
+
+	pdev = to_pci_dev(dev);
+
+	if (pdev->class != (PCI_CLASS_DISPLAY_VGA << 8) ||
+	    pdev->vendor != PCI_VENDOR_ID_INTEL)
+		return 0;
+
+	if (subcomponent != I915_COMPONENT_PXP)
 		return 0;
 
 	base = base->parent;
Signature · 1 line
2.43.0
#3 lore raw

PATCH 4/5 mei: hdcp: add dependency on Xe driver

In reply to Tomas Winkler

From: Alexander Usyskin <[email protected]>

Optionally depend on either i915 or Xe drivers.

---
 drivers/misc/mei/hdcp/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/mei/hdcp/Kconfig +1 -1
index 9be312ec798de96fb362e0dc..631dd9651d7c9dbc0f812725 100644
@@ -4,7 +4,7 @@
 config INTEL_MEI_HDCP
 	tristate "Intel HDCP2.2 services of ME Interface"
 	depends on INTEL_MEI_ME
-	depends on DRM_I915
+	depends on DRM_I915 || DRM_XE
 	help
 	  MEI Support for HDCP2.2 Services on Intel platforms.
 
Signature · 1 line
2.43.0
#4 lore raw

PATCH 5/5 mei: pxp: add dependency on Xe driver

In reply to Tomas Winkler

From: Alexander Usyskin <[email protected]>

Optionally depend on either i915 or Xe drivers.

---
 drivers/misc/mei/pxp/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/mei/pxp/Kconfig +1 -1
index e9219b61cd92fb76fcabe89d..aa2dece4a927a570c1e325fa 100644
@@ -4,7 +4,7 @@
 config INTEL_MEI_PXP
 	tristate "Intel PXP services of ME Interface"
 	depends on INTEL_MEI_ME
-	depends on DRM_I915
+	depends on DRM_I915 || DRM_XE
 	help
 	  MEI Support for PXP Services on Intel platforms.
 
Signature · 1 line
2.43.0