drm/i915: extract intel_hdcp.h from intel_drv.h
authorJani Nikula <jani.nikula@intel.com>
Fri, 5 Apr 2019 11:00:13 +0000 (14:00 +0300)
committerJani Nikula <jani.nikula@intel.com>
Mon, 8 Apr 2019 06:52:30 +0000 (09:52 +0300)
It used to be handy that we only had a couple of headers, but over time
intel_drv.h has become unwieldy. Extract declarations to a separate
header file corresponding to the implementation module, clarifying the
modularity of the driver.

Ensure the new header is self-contained, and do so with minimal further
includes, using forward declarations as needed. Include the new header
only where needed, and sort the modified include directives while at it
and as needed.

No functional changes.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/8348620b32cb4438ccfb5f7bbe9a18ff6b7c48a0.1554461791.git.jani.nikula@intel.com
drivers/gpu/drm/i915/Makefile.header-test
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/intel_atomic.c
drivers/gpu/drm/i915/intel_connector.c
drivers/gpu/drm/i915/intel_ddi.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_hdcp.c
drivers/gpu/drm/i915/intel_hdcp.h [new file with mode: 0644]
drivers/gpu/drm/i915/intel_hdmi.c

index f1f62794b457f44e7e9251cab655b6555b03b8ce..a4846d7eaf46adce1855d4c1f5c07286eaaac2f7 100644 (file)
@@ -18,6 +18,7 @@ header_test := \
        intel_engine_types.h \
        intel_fbc.h \
        intel_frontbuffer.h \
+       intel_hdcp.h \
        intel_lspcon.h \
        intel_psr.h \
        intel_sdvo.h \
index bacebf983011f1b6aaed620c01cc2d335a387c6b..d043d6ed12e85a009d5e90b27a202719684c2323 100644 (file)
@@ -36,6 +36,7 @@
 #include "intel_drv.h"
 #include "intel_fbc.h"
 #include "intel_guc_submission.h"
+#include "intel_hdcp.h"
 #include "intel_psr.h"
 
 static inline struct drm_i915_private *node_to_i915(struct drm_info_node *node)
index b844e8840c6fbad9a5d7e7ba497739cb9153374e..2cbcf6ac24d8cee693aabf97c600c3ca9d3a710c 100644 (file)
@@ -35,6 +35,7 @@
 #include <drm/drm_plane_helper.h>
 
 #include "intel_drv.h"
+#include "intel_hdcp.h"
 
 /**
  * intel_digital_connector_atomic_get_property - hook for connector->atomic_get_property.
index 297f1e51213a35d6ae496402918df8ac4b2f52d3..6627d92ece14f980a842e7df306128ff0c547c86 100644 (file)
@@ -32,6 +32,7 @@
 #include "i915_drv.h"
 #include "intel_connector.h"
 #include "intel_drv.h"
+#include "intel_hdcp.h"
 
 int intel_connector_init(struct intel_connector *connector)
 {
index 06c2948de9bf79060791594bfaf2add6c29f1acc..bc7b00f43fae63236c08c0312216853e7108303f 100644 (file)
@@ -33,6 +33,7 @@
 #include "intel_ddi.h"
 #include "intel_drv.h"
 #include "intel_dsi.h"
+#include "intel_hdcp.h"
 #include "intel_lspcon.h"
 #include "intel_psr.h"
 
index 7a0d52c984fe29192d069ceb4f7979ee025dce90..1220bb0008c77ba0b6e2fe7e34dc7dda4e2bb0e8 100644 (file)
@@ -55,6 +55,7 @@
 #include "intel_dsi.h"
 #include "intel_fbc.h"
 #include "intel_frontbuffer.h"
+#include "intel_hdcp.h"
 #include "intel_psr.h"
 #include "intel_sdvo.h"
 
index 2f50a4d81fcd280a79f4111882268561d911237a..efc411964bccc3a2cf844797cf2743c21c659255 100644 (file)
@@ -46,6 +46,7 @@
 #include "intel_connector.h"
 #include "intel_ddi.h"
 #include "intel_drv.h"
+#include "intel_hdcp.h"
 #include "intel_lspcon.h"
 #include "intel_psr.h"
 
index 681f232fd305ac19eca31267db75d9d740111ea5..e04a622a71ed621ba740711b65f07500aac1d78b 100644 (file)
@@ -2099,21 +2099,6 @@ static inline void intel_backlight_device_unregister(struct intel_connector *con
 }
 #endif /* CONFIG_BACKLIGHT_CLASS_DEVICE */
 
-/* intel_hdcp.c */
-void intel_hdcp_atomic_check(struct drm_connector *connector,
-                            struct drm_connector_state *old_state,
-                            struct drm_connector_state *new_state);
-int intel_hdcp_init(struct intel_connector *connector,
-                   const struct intel_hdcp_shim *hdcp_shim);
-int intel_hdcp_enable(struct intel_connector *connector);
-int intel_hdcp_disable(struct intel_connector *connector);
-bool is_hdcp_supported(struct drm_i915_private *dev_priv, enum port port);
-bool intel_hdcp_capable(struct intel_connector *connector);
-void intel_hdcp_component_init(struct drm_i915_private *dev_priv);
-void intel_hdcp_component_fini(struct drm_i915_private *dev_priv);
-void intel_hdcp_cleanup(struct intel_connector *connector);
-void intel_hdcp_handle_cp_irq(struct intel_connector *connector);
-
 /* intel_quirks.c */
 void intel_init_quirks(struct drm_i915_private *dev_priv);
 
index 86965fa377390a998ad9d40c79247d6e7d29678a..99b007169c49480cefe3b32b1c582cf1c8e6afd2 100644 (file)
@@ -6,14 +6,16 @@
  * Sean Paul <seanpaul@chromium.org>
  */
 
-#include <drm/drm_hdcp.h>
-#include <drm/i915_component.h>
+#include <linux/component.h>
 #include <linux/i2c.h>
 #include <linux/random.h>
-#include <linux/component.h>
 
-#include "intel_drv.h"
+#include <drm/drm_hdcp.h>
+#include <drm/i915_component.h>
+
 #include "i915_reg.h"
+#include "intel_drv.h"
+#include "intel_hdcp.h"
 
 #define KEY_LOAD_TRIES 5
 #define ENCRYPT_STATUS_CHANGE_TIMEOUT_MS       50
diff --git a/drivers/gpu/drm/i915/intel_hdcp.h b/drivers/gpu/drm/i915/intel_hdcp.h
new file mode 100644 (file)
index 0000000..a75f25f
--- /dev/null
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_HDCP_H__
+#define __INTEL_HDCP_H__
+
+#include <linux/types.h>
+
+#include <drm/i915_drm.h>
+
+struct drm_connector;
+struct drm_connector_state;
+struct drm_i915_private;
+struct intel_connector;
+struct intel_hdcp_shim;
+
+void intel_hdcp_atomic_check(struct drm_connector *connector,
+                            struct drm_connector_state *old_state,
+                            struct drm_connector_state *new_state);
+int intel_hdcp_init(struct intel_connector *connector,
+                   const struct intel_hdcp_shim *hdcp_shim);
+int intel_hdcp_enable(struct intel_connector *connector);
+int intel_hdcp_disable(struct intel_connector *connector);
+bool is_hdcp_supported(struct drm_i915_private *dev_priv, enum port port);
+bool intel_hdcp_capable(struct intel_connector *connector);
+void intel_hdcp_component_init(struct drm_i915_private *dev_priv);
+void intel_hdcp_component_fini(struct drm_i915_private *dev_priv);
+void intel_hdcp_cleanup(struct intel_connector *connector);
+void intel_hdcp_handle_cp_irq(struct intel_connector *connector);
+
+#endif /* __INTEL_HDCP_H__ */
index 03dcf5f7d69fe9a46bfbedd6f7eb3acf840e6445..18fef71fc4f8c28aeeecc970a0080f2243074439 100644 (file)
@@ -44,6 +44,7 @@
 #include "intel_connector.h"
 #include "intel_ddi.h"
 #include "intel_drv.h"
+#include "intel_hdcp.h"
 #include "intel_lspcon.h"
 #include "intel_sdvo.h"