]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: extract intel_hotplug.h from intel_drv.h and i915_drv.h
authorJani Nikula <jani.nikula@intel.com>
Mon, 29 Apr 2019 12:50:11 +0000 (15:50 +0300)
committerJani Nikula <jani.nikula@intel.com>
Tue, 30 Apr 2019 12:04:19 +0000 (15:04 +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.

v2: fix sparse warnings on undeclared global functions

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190429125011.10876-1-jani.nikula@intel.com
15 files changed:
drivers/gpu/drm/i915/Makefile.header-test
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_irq.c
drivers/gpu/drm/i915/intel_crt.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_hdmi.c
drivers/gpu/drm/i915/intel_hotplug.c
drivers/gpu/drm/i915/intel_hotplug.h [new file with mode: 0644]
drivers/gpu/drm/i915/intel_runtime_pm.c
drivers/gpu/drm/i915/intel_sdvo.c
drivers/gpu/drm/i915/intel_tv.c

index beda60ea8dbfbd99ed78fc1ed3d5969922a41569..dafaaa2ec9db48a3474698c7b7658471505adcdb 100644 (file)
@@ -36,6 +36,7 @@ header_test := \
        intel_frontbuffer.h \
        intel_hdcp.h \
        intel_hdmi.h \
+       intel_hotplug.h \
        intel_lspcon.h \
        intel_lvds.h \
        intel_panel.h \
index 4cfdc2741ef5c6b701ee843c131a90c61c1def04..b891a6aa79809f5a64e34c04d3540a111679aff9 100644 (file)
@@ -63,6 +63,7 @@
 #include "intel_dp.h"
 #include "intel_drv.h"
 #include "intel_fbdev.h"
+#include "intel_hotplug.h"
 #include "intel_pm.h"
 #include "intel_sprite.h"
 #include "intel_uc.h"
index df9ac3943993267c263fd039aa0211d4d275a89e..7a6c21df6b37cb5f18d19cf14799469a343f998d 100644 (file)
@@ -2717,17 +2717,6 @@ int intel_engines_init(struct drm_i915_private *dev_priv);
 
 u32 intel_calculate_mcr_s_ss_select(struct drm_i915_private *dev_priv);
 
-/* intel_hotplug.c */
-void intel_hpd_irq_handler(struct drm_i915_private *dev_priv,
-                          u32 pin_mask, u32 long_mask);
-void intel_hpd_init(struct drm_i915_private *dev_priv);
-void intel_hpd_init_work(struct drm_i915_private *dev_priv);
-void intel_hpd_cancel_work(struct drm_i915_private *dev_priv);
-enum hpd_pin intel_hpd_pin_default(struct drm_i915_private *dev_priv,
-                                  enum port port);
-bool intel_hpd_disable(struct drm_i915_private *dev_priv, enum hpd_pin pin);
-void intel_hpd_enable(struct drm_i915_private *dev_priv, enum hpd_pin pin);
-
 static inline void i915_queue_hangcheck(struct drm_i915_private *dev_priv)
 {
        unsigned long delay;
index 4a6a374aa487eaf7c75a3d79b0a4e160bb8618b4..e31137bd86f7208f5436821b6a8dd9d959aa5cbb 100644 (file)
@@ -42,6 +42,7 @@
 #include "i915_trace.h"
 #include "intel_drv.h"
 #include "intel_fifo_underrun.h"
+#include "intel_hotplug.h"
 #include "intel_psr.h"
 
 /**
index 1d32af65f9c461ebba7e99c82d5fe47e74c49865..eb81b4884570fbfb92901f7f33f75ce622ec41ff 100644 (file)
@@ -40,6 +40,7 @@
 #include "intel_ddi.h"
 #include "intel_drv.h"
 #include "intel_fifo_underrun.h"
+#include "intel_hotplug.h"
 
 /* Here's the desired hotplug mode */
 #define ADPA_HOTPLUG_BITS (ADPA_CRT_HOTPLUG_PERIOD_128 |               \
index 3ce42104817b91975595098caf248787719e5a44..4864f857f61f3cde954937abaf7dd0dcfa3c0df5 100644 (file)
@@ -38,6 +38,7 @@
 #include "intel_fifo_underrun.h"
 #include "intel_hdcp.h"
 #include "intel_hdmi.h"
+#include "intel_hotplug.h"
 #include "intel_lspcon.h"
 #include "intel_panel.h"
 #include "intel_psr.h"
index 19a4874864d8c0e44ee0bed670bab3401b5ff1bd..a815f2439be48dbc9b1cae0265b643c8781a3a43 100644 (file)
@@ -62,6 +62,7 @@
 #include "intel_frontbuffer.h"
 #include "intel_hdcp.h"
 #include "intel_hdmi.h"
+#include "intel_hotplug.h"
 #include "intel_lvds.h"
 #include "intel_pipe_crc.h"
 #include "intel_pm.h"
index c5e104fb4f83a5a982da2ba31b258d63324c591f..a3bd6921a4a4a330176578c7e3b827a97f3b8084 100644 (file)
@@ -52,6 +52,7 @@
 #include "intel_fifo_underrun.h"
 #include "intel_hdcp.h"
 #include "intel_hdmi.h"
+#include "intel_hotplug.h"
 #include "intel_lspcon.h"
 #include "intel_lvds.h"
 #include "intel_panel.h"
index 0fc72660031b8070aaac4f808204e2aa67ce221b..f71a412b37ccf62eff485cf6db4f0b13444ec47a 100644 (file)
@@ -1779,11 +1779,6 @@ void intel_dp_mst_encoder_cleanup(struct intel_digital_port *intel_dig_port);
 /* intel_dsi_dcs_backlight.c */
 int intel_dsi_dcs_init_backlight_funcs(struct intel_connector *intel_connector);
 
-/* intel_hotplug.c */
-void intel_hpd_poll_init(struct drm_i915_private *dev_priv);
-bool intel_encoder_hotplug(struct intel_encoder *encoder,
-                          struct intel_connector *connector);
-
 /* intel_overlay.c */
 void intel_overlay_setup(struct drm_i915_private *dev_priv);
 void intel_overlay_cleanup(struct drm_i915_private *dev_priv);
index e2341d3868bbce62cfb174961834c1a32727c25c..4d3e2c96916e593b303cc815539b7934cfbc0abd 100644 (file)
@@ -48,6 +48,7 @@
 #include "intel_fifo_underrun.h"
 #include "intel_hdcp.h"
 #include "intel_hdmi.h"
+#include "intel_hotplug.h"
 #include "intel_lspcon.h"
 #include "intel_sdvo.h"
 #include "intel_panel.h"
index b8937c788f03a58c13b15bda81bfe64d807f03b6..ff9eb3c855d3f3b1ec4aa912a7896b87baf58169 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "i915_drv.h"
 #include "intel_drv.h"
+#include "intel_hotplug.h"
 
 /**
  * DOC: Hotplug
diff --git a/drivers/gpu/drm/i915/intel_hotplug.h b/drivers/gpu/drm/i915/intel_hotplug.h
new file mode 100644 (file)
index 0000000..805f897
--- /dev/null
@@ -0,0 +1,30 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_HOTPLUG_H__
+#define __INTEL_HOTPLUG_H__
+
+#include <linux/types.h>
+
+#include <drm/i915_drm.h>
+
+struct drm_i915_private;
+struct intel_connector;
+struct intel_encoder;
+
+void intel_hpd_poll_init(struct drm_i915_private *dev_priv);
+bool intel_encoder_hotplug(struct intel_encoder *encoder,
+                          struct intel_connector *connector);
+void intel_hpd_irq_handler(struct drm_i915_private *dev_priv,
+                          u32 pin_mask, u32 long_mask);
+void intel_hpd_init(struct drm_i915_private *dev_priv);
+void intel_hpd_init_work(struct drm_i915_private *dev_priv);
+void intel_hpd_cancel_work(struct drm_i915_private *dev_priv);
+enum hpd_pin intel_hpd_pin_default(struct drm_i915_private *dev_priv,
+                                  enum port port);
+bool intel_hpd_disable(struct drm_i915_private *dev_priv, enum hpd_pin pin);
+void intel_hpd_enable(struct drm_i915_private *dev_priv, enum hpd_pin pin);
+
+#endif /* __INTEL_HOTPLUG_H__ */
index d478610c91a3b9665ec5168c52de99be7f444532..379c1dc8799f1f1c190ec994d6462f7f5fa7594e 100644 (file)
@@ -38,6 +38,7 @@
 #include "intel_csr.h"
 #include "intel_dp.h"
 #include "intel_drv.h"
+#include "intel_hotplug.h"
 #include "intel_sideband.h"
 
 /**
index ef2748889a2aa00db4d0dee4438153038e762aba..66365b14703b1c39a4c97bda2974f3113d6f4749 100644 (file)
@@ -41,6 +41,7 @@
 #include "intel_drv.h"
 #include "intel_fifo_underrun.h"
 #include "intel_hdmi.h"
+#include "intel_hotplug.h"
 #include "intel_panel.h"
 #include "intel_sdvo.h"
 #include "intel_sdvo_regs.h"
index 5dbba33f4202e1da464514d40aeebbccf26d3115..5dc594eafaf2f1c98d768d0d083c9b86e591d92a 100644 (file)
@@ -38,6 +38,7 @@
 #include "i915_drv.h"
 #include "intel_connector.h"
 #include "intel_drv.h"
+#include "intel_hotplug.h"
 #include "intel_tv.h"
 
 enum tv_margin {