Skip to contentSkip to conversation

Remove Stubs in HDCP code

PATCH Superseded Suraj Kandpal 2 participants 5 messages Sep 22, 2023

Subsystems (4)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

cover Remove Stubs in HDCP code

This patch series aims to remove stubs from code in HDCP code. Patches 1 & 2 are just added so no rebase issue is created later and for buildbility patch 3 is what we actually aim to merge. Patch 1 brings HDCP code in par with current i915 state (removes stub). Patch 2 is i915 refactor which has been already floated.
(https://patchwork.freedesktop.org/series/123955/)
Patch 3 adds the definition of intel_hdcp_gsc_check_status in Xe.

Suraj Kandpal (3):
drm/i915/hdcp: Move checks for gsc health status drm/i915/hdcp: Move common message filling function to its own file drm/xe/hdcp: Define intel_hdcp_gsc_check_status in Xe

 drivers/gpu/drm/i915/Makefile                 |   1 +
 drivers/gpu/drm/i915/display/intel_hdcp.c     |   8 +-
 drivers/gpu/drm/i915/display/intel_hdcp_gsc.c | 620 +-----------------
 drivers/gpu/drm/i915/display/intel_hdcp_gsc.h |   2 +
 .../drm/i915/display/intel_hdcp_gsc_message.c | 588 +++++++++++++++++
 .../drm/i915/display/intel_hdcp_gsc_message.h |  56 ++
 drivers/gpu/drm/xe/display/xe_hdcp_gsc.c      |   5 +
 7 files changed, 678 insertions(+), 602 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/display/intel_hdcp_gsc_message.c
 create mode 100644 drivers/gpu/drm/i915/display/intel_hdcp_gsc_message.h
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/3 drm/i915/hdcp: Move checks for gsc health status

Move checks for gsc components required for HDCP 2.2 to work into intel_hdcp_gsc.c. This will also help with XE refactor on HDCP's side.

---
 drivers/gpu/drm/i915/display/intel_hdcp.c     |  8 +-------
 drivers/gpu/drm/i915/display/intel_hdcp_gsc.c | 14 ++++++++++++++
 drivers/gpu/drm/i915/display/intel_hdcp_gsc.h |  1 +
 3 files changed, 16 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/display/intel_hdcp.c +1 -7
index a42549fa9691..76ddbe0747b8 100644
@@ -174,14 +174,8 @@ bool intel_hdcp2_capable(struct intel_connector *connector)
 
 	/* If MTL+ make sure gsc is loaded and proxy is setup */
 	if (intel_hdcp_gsc_cs_required(i915)) {
-		struct intel_gt *gt = i915->media_gt;
-		struct intel_gsc_uc *gsc = gt ? &gt->uc.gsc : NULL;
-
-		if (!gsc || !intel_uc_fw_is_running(&gsc->fw)) {
-			drm_dbg_kms(&i915->drm,
-				    "GSC components required for HDCP2.2 are not ready\n");
+		if (!intel_hdcp_gsc_check_status(i915))
 			return false;
-		}
 	}
 
 	/* MEI/GSC interface is solid depending on which is used */
drivers/gpu/drm/i915/display/intel_hdcp_gsc.c +14 -0
index 4ab640b4e7ec..69af416cffe6 100644
@@ -12,6 +12,20 @@
 #include "i915_utils.h"
 #include "intel_hdcp_gsc.h"
 
+bool intel_hdcp_gsc_check_status(struct drm_i915_private *i915)
+{
+	struct intel_gt *gt = i915->media_gt;
+	struct intel_gsc_uc *gsc = gt ? &gt->uc.gsc : NULL;
+
+	if (!gsc || !intel_uc_fw_is_running(&gsc->fw)) {
+		drm_dbg_kms(&i915->drm,
+			    "GSC components required for HDCP2.2 are not ready\n");
+		return false;
+	}
+
+	return true;
+}
+
 static int
 gsc_hdcp_initiate_session(struct device *dev, struct hdcp_port_data *data,
 			  struct hdcp2_ake_init *ake_data)
drivers/gpu/drm/i915/display/intel_hdcp_gsc.h +1 -0
index 704acd3ed46b..dcbf9b0b22c6 100644
@@ -26,5 +26,6 @@ ssize_t intel_hdcp_gsc_msg_send(struct drm_i915_private *i915, u8 *msg_in,
 				size_t msg_out_len);
 int intel_hdcp_gsc_init(struct drm_i915_private *i915);
 void intel_hdcp_gsc_fini(struct drm_i915_private *i915);
+bool intel_hdcp_gsc_check_status(struct drm_i915_private *i915);
 
 #endif /* __INTEL_HDCP_GCS_H__ */
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/3 drm/i915/hdcp: Move common message filling function to its own file

In reply to Suraj Kandpal

Create a new file intel_hdcp_gsc_message that contain functions which fill the hdcp messages we send to gsc cs this refactor will help us reuse code for Xe later on

---
 drivers/gpu/drm/i915/Makefile                 |   1 +
 drivers/gpu/drm/i915/display/intel_hdcp_gsc.c | 618 +-----------------
 drivers/gpu/drm/i915/display/intel_hdcp_gsc.h |   1 +
 .../drm/i915/display/intel_hdcp_gsc_message.c | 588 +++++++++++++++++
 .../drm/i915/display/intel_hdcp_gsc_message.h |  56 ++
 5 files changed, 663 insertions(+), 601 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/display/intel_hdcp_gsc_message.c
 create mode 100644 drivers/gpu/drm/i915/display/intel_hdcp_gsc_message.h
drivers/gpu/drm/i915/Makefile +1 -0
index c1af90153f61..f16cc2ec4e55 100644
@@ -264,6 +264,7 @@ i915-y += \
 	display/intel_global_state.o \
 	display/intel_hdcp.o \
 	display/intel_hdcp_gsc.o \
+	display/intel_hdcp_gsc_message.o \
 	display/intel_hotplug.o \
 	display/intel_hotplug_irq.o \
 	display/intel_hti.o \
drivers/gpu/drm/i915/display/intel_hdcp_gsc.c +17 -601

641 lines not on this page · raw message

drivers/gpu/drm/i915/display/intel_hdcp_gsc.h +1 -0
index dcbf9b0b22c6..c58d8198b44e 100644
@@ -8,6 +8,7 @@
 
 #include <linux/err.h>
 #include <linux/types.h>
+
 #include "i915_drv.h"
 
 struct intel_hdcp_gsc_message {
drivers/gpu/drm/i915/display/intel_hdcp_gsc_message.c new file +588 -0

588 lines not on this page · raw message

drivers/gpu/drm/i915/display/intel_hdcp_gsc_message.h new file +56 -0

56 lines not on this page · raw message

Signature · 1 line
2.25.1
#3 lore raw

PATCH 3/3 drm/xe/hdcp: Define intel_hdcp_gsc_check_status in Xe

In reply to Suraj Kandpal

Define intel_hdcp_gsc_check_status in Xe to account for changes in i915 and Xe.

---
 drivers/gpu/drm/xe/display/xe_hdcp_gsc.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/xe/display/xe_hdcp_gsc.c +5 -0
index 5c02675bbb09..85f6f22ba4e2 100644
@@ -5,6 +5,11 @@
 
 #include "intel_hdcp_gsc.h"
 
+bool intel_hdcp_gsc_check_status(struct drm_i915_private *i915)
+{
+	return false;
+}
+
 int intel_hdcp_gsc_init(struct drm_i915_private *i915)
 {
 	drm_info(&i915->drm, "HDCP support not yet implemented\n");
Signature · 1 line
2.25.1
#4 lore raw

[Intel-xe] ✗ CI.Patch_applied: failure for Remove Stubs in HDCP code

In reply to Suraj Kandpal
== Series Details ==

== Series Details ==

Series: Remove Stubs in HDCP code
URL : https://patchwork.freedesktop.org/series/124093/
State : failure

== Summary ==

=== Applying kernel patches on branch 'drm-xe-next' with base: === Base commit: 7e0d40e7a fixup! drm/xe/display: Implement display support === git am output follows ===
error: patch failed: drivers/gpu/drm/i915/display/intel_hdcp.c:174
error: drivers/gpu/drm/i915/display/intel_hdcp.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch
Applying: drm/i915/hdcp: Move checks for gsc health status Patch failed at 0001 drm/i915/hdcp: Move checks for gsc health status When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".