Skip to contentSkip to conversation

mei: hdcp/pxp: adapt for Xe driver

PATCH Superseded Alexander Usyskin 3 participants 12 messages Nov 7, 2023 – Nov 27, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Alexander Usyskin

author maintainer
#0 lore raw

cover mei: hdcp/pxp: adapt for Xe driver

Update mei-hdcp and mei-pxp drivers to work with Xe driver alongside with i195 driver.
Revert previous partial attempt.
Update match functions to match without driver name and update module dependencies to optionally depend on Xe.

Alexander Usyskin (5):
Revert "mei/hdcp: Also enable for XE"
mei: hdcp: match without driver name
mei: pxp: match without driver name
mei: hdcp: add dependency on Xe driver
mei: pxp: add dependency on Xe driver

 drivers/misc/mei/hdcp/mei_hdcp.c | 15 ++++++++++++---
 drivers/misc/mei/pxp/Kconfig     |  3 +--
 drivers/misc/mei/pxp/mei_pxp.c   | 14 ++++++++++++--
 3 files changed, 25 insertions(+), 7 deletions(-)
Signature · 1 line
2.34.1
author maintainer
#1 lore raw

PATCH 1/5 Revert "mei/hdcp: Also enable for XE"

This reverts commit 62db7d00efe48c614b006086f306d5addedf8f83.

---
 drivers/misc/mei/hdcp/Kconfig    | 2 +-
 drivers/misc/mei/hdcp/mei_hdcp.c | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/misc/mei/hdcp/Kconfig +1 -1
index 2ac9148988d4..54e1c9526909 100644
@@ -4,7 +4,7 @@
 config INTEL_MEI_HDCP
 	tristate "Intel HDCP2.2 services of ME Interface"
 	select INTEL_MEI_ME
-	depends on DRM_I915 || DRM_XE
+	depends on DRM_I915
 	help
 	  MEI Support for HDCP2.2 Services on Intel platforms.
 
drivers/misc/mei/hdcp/mei_hdcp.c +1 -2
index 94beb5667faa..51359cc5ece9 100644
@@ -782,8 +782,7 @@ static int mei_hdcp_component_match(struct device *dev, int subcomponent,
 {
 	struct device *base = data;
 
-	if (!dev->driver ||
-	    (strcmp(dev->driver->name, "i915") && strcmp(dev->driver->name, "xe")) ||
+	if (!dev->driver || strcmp(dev->driver->name, "i915") ||
 	    subcomponent != I915_COMPONENT_HDCP)
 		return 0;
 
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH 1/5] Revert "mei/hdcp: Also enable for XE"

Quoted 1 line · Alexander Usyskin

This reverts commit 62db7d00efe48c614b006086f306d5addedf8f83.

That says what you did, but not why you did it, which means I can't take this, sorry.

greg k-h

author maintainer
#3 lore raw

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

In reply to Alexander Usyskin

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 51359cc5ece9..f8759a6c9ed3 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.34.1
author maintainer
#4 lore raw

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

In reply to Alexander Usyskin

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 2dcb9169e404..e74b2facfdf9 100644
@@ -12,6 +12,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/mei.h>
 #include <linux/mei_cl_bus.h>
@@ -154,12 +155,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.34.1
author maintainer
#5 lore raw

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

In reply to Alexander Usyskin

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 54e1c9526909..2ac9148988d4 100644
@@ -4,7 +4,7 @@
 config INTEL_MEI_HDCP
 	tristate "Intel HDCP2.2 services of ME Interface"
 	select 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.34.1
author maintainer
#6 lore raw

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

In reply to Alexander Usyskin

Optionally depend on either i915 or Xe drivers.

---
 drivers/misc/mei/pxp/Kconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/misc/mei/pxp/Kconfig +1 -2
index 4029b96afc04..d9ae5483567f 100644
@@ -1,11 +1,10 @@
-
 # SPDX-License-Identifier: GPL-2.0
 # Copyright (c) 2020, Intel Corporation. All rights reserved.
 #
 config INTEL_MEI_PXP
 	tristate "Intel PXP services of ME Interface"
 	select 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.34.1
#7 lore raw

Re: [PATCH 5/5] mei: pxp: add dependency on Xe driver

drivers/misc/mei/pxp/Kconfig line 1

Quoted 13 lines · Alexander Usyskin

Optionally depend on either i915 or Xe drivers.

---
 drivers/misc/mei/pxp/Kconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/misc/mei/pxp/Kconfig +0 -1
index 4029b96afc04..d9ae5483567f 100644
@@ -1,11 +1,10 @@
-

Why this change here?

thanks,

greg k-h

author maintainer
#8 lore raw

RE: [PATCH 5/5] mei: pxp: add dependency on Xe driver

Quoted 9 lines · Alexander Usyskin
Quoted 7 lines

Optionally depend on either i915 or Xe drivers.

---
 drivers/misc/mei/pxp/Kconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 8 lines

drivers/misc/mei/pxp/Kconfig line 1

Quoted 6 lines
drivers/misc/mei/pxp/Kconfig +0 -1
index 4029b96afc04..d9ae5483567f 100644
@@ -1,11 +1,10 @@
-

Why this change here?

I've been told that SPDX should be the first line in the file, but here fist line is an empty line.
I can drop this change if it is inappropriate to put it in this patch.

Signature · 2 lines
Thanks,
Sasha
Quoted 4 lines

thanks,

greg k-h

#9 lore raw

Re: [PATCH 5/5] mei: pxp: add dependency on Xe driver

Quoted 18 lines · Alexander
Quoted 9 lines · Alexander Usyskin
Quoted 7 lines

Optionally depend on either i915 or Xe drivers.

---
 drivers/misc/mei/pxp/Kconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 8 lines

drivers/misc/mei/pxp/Kconfig line 1

Quoted 6 lines
drivers/misc/mei/pxp/Kconfig +0 -1
index 4029b96afc04..d9ae5483567f 100644
@@ -1,11 +1,10 @@
-

Why this change here?

Quoted 2 lines

I've been told that SPDX should be the first line in the file, but here fist line is an empty line.

That is correct, and should be fixed up, but you didn't say that you made this change in your changelog text so I didn't know why it was there.

Quoted 1 line

I can drop this change if it is inappropriate to put it in this patch.

It should go in a separate patch please.

thanks,

greg k-h

#10 lore raw

Re: [PATCH 5/5] mei: pxp: add dependency on Xe driver

In reply to Usyskin, Alexander
Quoted 18 lines · Alexander
Quoted 9 lines · Alexander Usyskin
Quoted 7 lines

Optionally depend on either i915 or Xe drivers.

---
 drivers/misc/mei/pxp/Kconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 8 lines

drivers/misc/mei/pxp/Kconfig line 1

Quoted 6 lines
drivers/misc/mei/pxp/Kconfig +0 -1
index 4029b96afc04..d9ae5483567f 100644
@@ -1,11 +1,10 @@
-

Why this change here?

Quoted 3 lines

I've been told that SPDX should be the first line in the file, but here fist line is an empty line.
I can drop this change if it is inappropriate to put it in this patch.

It should not go into this patch. Remember, each patch should only do "one thing".

thanks,

greg k-h

#11 lore raw

[Intel-xe] ✗ CI.Patch_applied: failure for mei: hdcp/pxp: adapt for Xe driver

In reply to Alexander Usyskin
== Series Details ==

== Series Details ==

Series: mei: hdcp/pxp: adapt for Xe driver
URL : https://patchwork.freedesktop.org/series/126075/
State : failure

== Summary ==

=== Applying kernel patches on branch 'drm-xe-next' with base: === Base commit: 17fc56818 drm/xe/xelpmp: Add Wa_16021867713 === git am output follows ===
Applying: Revert "mei/hdcp: Also enable for XE"
Applying: mei: hdcp: match without driver name
Applying: mei: pxp: match without driver name
Applying: mei: hdcp: add dependency on Xe driver
Applying: mei: pxp: add dependency on Xe driver