drm/display: Move HDCP helpers into display-helper module
authorThomas Zimmermann <tzimmermann@suse.de>
Thu, 21 Apr 2022 07:31:06 +0000 (09:31 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 25 Apr 2022 09:19:36 +0000 (11:19 +0200)
Move DRM's HDCP helper library into the display/ subdirectory and add
it to DRM's display helpers. Split the header file into core and helpers.
Update all affected drivers. No functional changes.

v3:
* fix Kconfig dependencies
v2:
* fix include statements (Jani, Javier)
* update Kconfig symbols

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220421073108.19226-7-tzimmermann@suse.de
25 files changed:
Documentation/gpu/drm-kms-helpers.rst
drivers/gpu/drm/Makefile
drivers/gpu/drm/amd/display/Kconfig
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
drivers/gpu/drm/amd/display/modules/hdcp/hdcp.h
drivers/gpu/drm/bridge/Kconfig
drivers/gpu/drm/bridge/analogix/Kconfig
drivers/gpu/drm/bridge/analogix/anx7625.c
drivers/gpu/drm/bridge/cadence/Kconfig
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c
drivers/gpu/drm/bridge/ite-it6505.c
drivers/gpu/drm/display/Kconfig
drivers/gpu/drm/display/Makefile
drivers/gpu/drm/display/drm_hdcp_helper.c [moved from drivers/gpu/drm/drm_hdcp.c with 99% similarity]
drivers/gpu/drm/i915/Kconfig
drivers/gpu/drm/i915/display/intel_dp_hdcp.c
drivers/gpu/drm/i915/display/intel_gmbus.c
drivers/gpu/drm/i915/display/intel_hdcp.c
drivers/gpu/drm/i915/display/intel_hdmi.c
drivers/misc/mei/hdcp/mei_hdcp.h
include/drm/display/drm_hdcp.h [moved from include/drm/drm_hdcp.h with 95% similarity]
include/drm/display/drm_hdcp_helper.h [new file with mode: 0644]
include/drm/i915_mei_hdcp_interface.h

index 7af55fb..cfda5a0 100644 (file)
@@ -226,7 +226,7 @@ Panel Self Refresh Helper Reference
 HDCP Helper Functions Reference
 ===============================
 
-.. kernel-doc:: drivers/gpu/drm/drm_hdcp.c
+.. kernel-doc:: drivers/gpu/drm/display/drm_hdcp_helper.c
    :export:
 
 Display Port Helper Functions Reference
index b8353af..746a3a4 100644 (file)
@@ -58,7 +58,7 @@ obj-$(CONFIG_DRM_TTM_HELPER) += drm_ttm_helper.o
 #
 
 drm_kms_helper-y := drm_bridge_connector.o drm_crtc_helper.o \
-               drm_encoder_slave.o drm_flip_work.o drm_hdcp.o \
+               drm_encoder_slave.o drm_flip_work.o \
                drm_probe_helper.o \
                drm_plane_helper.o drm_atomic_helper.o \
                drm_kms_helper_common.o \
index 127667e..b4029c0 100644 (file)
@@ -20,6 +20,7 @@ config DRM_AMD_DC_DCN
 config DRM_AMD_DC_HDCP
        bool "Enable HDCP support in DC"
        depends on DRM_AMD_DC
+       select DRM_DISPLAY_HDCP_HELPER
        help
          Choose this option if you want to support HDCP authentication.
 
index 7ef20da..e3130b4 100644 (file)
@@ -48,7 +48,7 @@
 #include "amdgpu_dm.h"
 #ifdef CONFIG_DRM_AMD_DC_HDCP
 #include "amdgpu_dm_hdcp.h"
-#include <drm/drm_hdcp.h>
+#include <drm/display/drm_hdcp_helper.h>
 #endif
 #include "amdgpu_pm.h"
 #include "amdgpu_atombios.h"
index bf0d502..15c0e3f 100644 (file)
@@ -27,7 +27,7 @@
 #include "amdgpu.h"
 #include "amdgpu_dm.h"
 #include "dm_helpers.h"
-#include <drm/drm_hdcp.h>
+#include <drm/display/drm_hdcp_helper.h>
 #include "hdcp_psp.h"
 
 /*
index 6e88705..392c0c0 100644 (file)
@@ -30,7 +30,7 @@
 #include "hdcp_log.h"
 
 #include <drm/display/drm_dp_helper.h>
-#include <drm/drm_hdcp.h>
+#include <drm/display/drm_hdcp_helper.h>
 
 enum mod_hdcp_trans_input_result {
        UNKNOWN = 0,
index 73ea668..ef9f1b0 100644 (file)
@@ -79,6 +79,7 @@ config DRM_ITE_IT6505
         tristate "ITE IT6505 DisplayPort bridge"
         depends on OF
        select DRM_DISPLAY_DP_HELPER
+       select DRM_DISPLAY_HDCP_HELPER
        select DRM_DISPLAY_HELPER
         select DRM_DP_AUX_BUS
         select DRM_KMS_HELPER
index 5570322..173dada 100644 (file)
@@ -35,6 +35,7 @@ config DRM_ANALOGIX_ANX7625
        depends on DRM
        depends on OF
        select DRM_DISPLAY_DP_HELPER
+       select DRM_DISPLAY_HDCP_HELPER
        select DRM_DISPLAY_HELPER
        select DRM_DP_AUX_BUS
        select DRM_MIPI_DSI
index be2c096..53a5da6 100644 (file)
 
 #include <drm/display/drm_dp_aux_bus.h>
 #include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_hdcp_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_edid.h>
-#include <drm/drm_hdcp.h>
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_of.h>
 #include <drm/drm_panel.h>
index 0f9e46c..1d06182 100644 (file)
@@ -2,6 +2,7 @@
 config DRM_CDNS_MHDP8546
        tristate "Cadence DPI/DP bridge"
        select DRM_DISPLAY_DP_HELPER
+       select DRM_DISPLAY_HDCP_HELPER
        select DRM_DISPLAY_HELPER
        select DRM_KMS_HELPER
        select DRM_PANEL_BRIDGE
index dec93a6..67f0f44 100644 (file)
 #include <linux/wait.h>
 
 #include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_hdcp_helper.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_atomic_state_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_connector.h>
 #include <drm/drm_crtc_helper.h>
-#include <drm/drm_hdcp.h>
 #include <drm/drm_modeset_helper_vtables.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
index fccd6fb..946212a 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <asm/unaligned.h>
 
-#include <drm/drm_hdcp.h>
+#include <drm/display/drm_hdcp_helper.h>
 
 #include "cdns-mhdp8546-hdcp.h"
 
index 85cffc1..8fed30d 100644 (file)
 #include <crypto/hash.h>
 
 #include <drm/display/drm_dp_helper.h>
+#include <drm/display/drm_hdcp_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_edid.h>
-#include <drm/drm_hdcp.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
 
index fcd9ffd..4406af5 100644 (file)
@@ -17,6 +17,12 @@ config DRM_DISPLAY_DP_HELPER
        help
          DRM display helpers for DisplayPort.
 
+config DRM_DISPLAY_HDCP_HELPER
+       bool
+       depends on DRM_DISPLAY_HELPER
+       help
+         DRM display helpers for HDCP.
+
 config DRM_DP_AUX_CHARDEV
        bool "DRM DP AUX Interface"
        depends on DRM
index 4f4e350..abeb5ad 100644 (file)
@@ -7,6 +7,7 @@ drm_display_helper-$(CONFIG_DRM_DISPLAY_DP_HELPER) += drm_dp_dual_mode_helper.o
                                                      drm_dp_helper.o \
                                                      drm_dp_mst_topology.o \
                                                      drm_dsc_helper.o
+drm_display_helper-$(CONFIG_DRM_DISPLAY_HDCP_HELPER) += drm_hdcp_helper.o
 drm_display_helper-$(CONFIG_DRM_DP_AUX_CHARDEV) += drm_dp_aux_dev.o
 drm_display_helper-$(CONFIG_DRM_DP_CEC) += drm_dp_cec.o
 
similarity index 99%
rename from drivers/gpu/drm/drm_hdcp.c
rename to drivers/gpu/drm/display/drm_hdcp_helper.c
index ca9b8f6..e78999c 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/slab.h>
 #include <linux/firmware.h>
 
-#include <drm/drm_hdcp.h>
+#include <drm/display/drm_hdcp_helper.h>
 #include <drm/drm_sysfs.h>
 #include <drm/drm_print.h>
 #include <drm/drm_device.h>
@@ -21,8 +21,6 @@
 #include <drm/drm_mode_object.h>
 #include <drm/drm_connector.h>
 
-#include "drm_internal.h"
-
 static inline void drm_hdcp_print_ksv(const u8 *ksv)
 {
        DRM_DEBUG("\t%#02x, %#02x, %#02x, %#02x, %#02x\n",
index 883284c..a78d82c 100644 (file)
@@ -11,6 +11,7 @@ config DRM_I915
        select SHMEM
        select TMPFS
        select DRM_DISPLAY_DP_HELPER
+       select DRM_DISPLAY_HDCP_HELPER
        select DRM_DISPLAY_HELPER
        select DRM_KMS_HELPER
        select DRM_PANEL
index 598cad0..a7640db 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <drm/display/drm_dp_helper.h>
 #include <drm/display/drm_dp_mst_helper.h>
-#include <drm/drm_hdcp.h>
+#include <drm/display/drm_hdcp_helper.h>
 #include <drm/drm_print.h>
 
 #include "intel_ddi.h"
index 21281a7..a6ba7fb 100644 (file)
@@ -31,7 +31,7 @@
 #include <linux/i2c-algo-bit.h>
 #include <linux/i2c.h>
 
-#include <drm/drm_hdcp.h>
+#include <drm/display/drm_hdcp_helper.h>
 
 #include "i915_drv.h"
 #include "intel_de.h"
index 4de4c17..44ac0ce 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/i2c.h>
 #include <linux/random.h>
 
-#include <drm/drm_hdcp.h>
+#include <drm/display/drm_hdcp_helper.h>
 #include <drm/i915_component.h>
 
 #include "i915_drv.h"
index a4a6f8b..c713ceb 100644 (file)
 #include <linux/slab.h>
 #include <linux/string_helpers.h>
 
+#include <drm/display/drm_hdcp_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_edid.h>
-#include <drm/drm_hdcp.h>
 #include <drm/drm_scdc_helper.h>
 #include <drm/intel_lpe_audio.h>
 
index 834757f..ca09c8f 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef __MEI_HDCP_H__
 #define __MEI_HDCP_H__
 
-#include <drm/drm_hdcp.h>
+#include <drm/display/drm_hdcp.h>
 
 /* me_hdcp_status: Enumeration of all HDCP Status Codes */
 enum me_hdcp_status {
similarity index 95%
rename from include/drm/drm_hdcp.h
rename to include/drm/display/drm_hdcp.h
index 0b1111e..96a99b1 100644 (file)
@@ -6,8 +6,8 @@
  * Sean Paul <seanpaul@chromium.org>
  */
 
-#ifndef _DRM_HDCP_H_INCLUDED_
-#define _DRM_HDCP_H_INCLUDED_
+#ifndef _DRM_HDCP_H_
+#define _DRM_HDCP_H_
 
 #include <linux/types.h>
 
@@ -291,16 +291,6 @@ struct hdcp_srm_header {
        u8 srm_gen_no;
 } __packed;
 
-struct drm_device;
-struct drm_connector;
-
-int drm_hdcp_check_ksvs_revoked(struct drm_device *dev,
-                               u8 *ksvs, u32 ksv_count);
-int drm_connector_attach_content_protection_property(
-               struct drm_connector *connector, bool hdcp_content_type);
-void drm_hdcp_update_content_protection(struct drm_connector *connector,
-                                       u64 val);
-
 /* Content Type classification for HDCP2.2 vs others */
 #define DRM_MODE_HDCP_CONTENT_TYPE0            0
 #define DRM_MODE_HDCP_CONTENT_TYPE1            1
diff --git a/include/drm/display/drm_hdcp_helper.h b/include/drm/display/drm_hdcp_helper.h
new file mode 100644 (file)
index 0000000..8aaf87b
--- /dev/null
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright (C) 2017 Google, Inc.
+ *
+ * Authors:
+ * Sean Paul <seanpaul@chromium.org>
+ */
+
+#ifndef _DRM_HDCP_HELPER_H_INCLUDED_
+#define _DRM_HDCP_HELPER_H_INCLUDED_
+
+#include <drm/display/drm_hdcp.h>
+
+struct drm_device;
+struct drm_connector;
+
+int drm_hdcp_check_ksvs_revoked(struct drm_device *dev, u8 *ksvs, u32 ksv_count);
+int drm_connector_attach_content_protection_property(struct drm_connector *connector,
+                                                    bool hdcp_content_type);
+void drm_hdcp_update_content_protection(struct drm_connector *connector, u64 val);
+
+#endif
index 702f613..f441cbc 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <linux/mutex.h>
 #include <linux/device.h>
-#include <drm/drm_hdcp.h>
+#include <drm/display/drm_hdcp.h>
 
 /**
  * enum hdcp_port_type - HDCP port implementation type defined by ME FW