drm/i915: extract intel_connector.h from intel_drv.h
authorJani Nikula <jani.nikula@intel.com>
Fri, 5 Apr 2019 11:00:06 +0000 (14:00 +0300)
committerJani Nikula <jani.nikula@intel.com>
Mon, 8 Apr 2019 06:51:41 +0000 (09:51 +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/4b8e9d1fa8f0f0420ecc65063bdb7d068c13086e.1554461791.git.jani.nikula@intel.com
16 files changed:
drivers/gpu/drm/i915/Makefile.header-test
drivers/gpu/drm/i915/icl_dsi.c
drivers/gpu/drm/i915/intel_connector.c
drivers/gpu/drm/i915/intel_connector.h [new file with mode: 0644]
drivers/gpu/drm/i915/intel_crt.c
drivers/gpu/drm/i915/intel_ddi.c
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_dp_mst.c
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_dvo.c
drivers/gpu/drm/i915/intel_hdmi.c
drivers/gpu/drm/i915/intel_lvds.c
drivers/gpu/drm/i915/intel_panel.c
drivers/gpu/drm/i915/intel_sdvo.c
drivers/gpu/drm/i915/intel_tv.c
drivers/gpu/drm/i915/vlv_dsi.c

index d9a6089f0de53d69e430a2443134a45da5cbdf8c..c0095a4ed26f3fbbd049c9c9b07cf694f8e56b64 100644 (file)
@@ -9,6 +9,7 @@ header_test := \
        i915_scheduler_types.h \
        i915_timeline_types.h \
        intel_audio.h \
+       intel_connector.h \
        intel_context_types.h \
        intel_crt.h \
        intel_ddi.h \
index 64beb141c1ec27dbba1e9a59fe40679f480e5ced..08e471898c865cbd44542a1358f989bebf94c30f 100644 (file)
@@ -28,6 +28,7 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_mipi_dsi.h>
 
+#include "intel_connector.h"
 #include "intel_ddi.h"
 #include "intel_dsi.h"
 
index 848dd9e728d83f9427241e70bb53d6258886fb3c..297f1e51213a35d6ae496402918df8ac4b2f52d3 100644 (file)
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include <linux/slab.h>
 #include <linux/i2c.h>
+#include <linux/slab.h>
+
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_edid.h>
-#include "intel_drv.h"
+
 #include "i915_drv.h"
+#include "intel_connector.h"
+#include "intel_drv.h"
 
 int intel_connector_init(struct intel_connector *connector)
 {
diff --git a/drivers/gpu/drm/i915/intel_connector.h b/drivers/gpu/drm/i915/intel_connector.h
new file mode 100644 (file)
index 0000000..93a7375
--- /dev/null
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_CONNECTOR_H__
+#define __INTEL_CONNECTOR_H__
+
+#include "intel_display.h"
+
+struct drm_connector;
+struct edid;
+struct i2c_adapter;
+struct intel_connector;
+struct intel_encoder;
+
+int intel_connector_init(struct intel_connector *connector);
+struct intel_connector *intel_connector_alloc(void);
+void intel_connector_free(struct intel_connector *connector);
+void intel_connector_destroy(struct drm_connector *connector);
+int intel_connector_register(struct drm_connector *connector);
+void intel_connector_unregister(struct drm_connector *connector);
+void intel_connector_attach_encoder(struct intel_connector *connector,
+                                   struct intel_encoder *encoder);
+bool intel_connector_get_hw_state(struct intel_connector *connector);
+enum pipe intel_connector_get_pipe(struct intel_connector *connector);
+int intel_connector_update_modes(struct drm_connector *connector,
+                                struct edid *edid);
+int intel_ddc_get_modes(struct drm_connector *c, struct i2c_adapter *adapter);
+void intel_attach_force_audio_property(struct drm_connector *connector);
+void intel_attach_broadcast_rgb_property(struct drm_connector *connector);
+void intel_attach_aspect_ratio_property(struct drm_connector *connector);
+void intel_attach_colorspace_property(struct drm_connector *connector);
+
+#endif /* __INTEL_CONNECTOR_H__ */
index d649dae3cc701e65cace5ae1593224b811729e26..b665c370111b2801202d5efcaaf451d4912d7fc2 100644 (file)
@@ -35,6 +35,7 @@
 #include <drm/i915_drm.h>
 
 #include "i915_drv.h"
+#include "intel_connector.h"
 #include "intel_crt.h"
 #include "intel_ddi.h"
 #include "intel_drv.h"
index 12135ffcff19f004fcdefb0a7756dad12af1336d..af03d81d53f8403757ce602668e33e21c7000c11 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "i915_drv.h"
 #include "intel_audio.h"
+#include "intel_connector.h"
 #include "intel_ddi.h"
 #include "intel_drv.h"
 #include "intel_dsi.h"
index ca3ed4ae253c1b813d04b090b1037534f01ec5cd..466e5a6b9513e6829fa9f6165fbf572e45151f71 100644 (file)
@@ -43,6 +43,7 @@
 
 #include "i915_drv.h"
 #include "intel_audio.h"
+#include "intel_connector.h"
 #include "intel_ddi.h"
 #include "intel_drv.h"
 
index 62c240be8cc9cd896e35e3a69bd23e0a9cd62138..0410038848603d614fe4a66b76b794f2be5b452a 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "i915_drv.h"
 #include "intel_audio.h"
+#include "intel_connector.h"
 #include "intel_ddi.h"
 #include "intel_drv.h"
 
index b61ec71e971eca2beee1e08c9a021659a99f03cd..2b2aa634fd4b295696aef6dce585dc5b3b4254d5 100644 (file)
@@ -1846,25 +1846,6 @@ unsigned int i9xx_plane_max_stride(struct intel_plane *plane,
                                   u32 pixel_format, u64 modifier,
                                   unsigned int rotation);
 
-/* intel_connector.c */
-int intel_connector_init(struct intel_connector *connector);
-struct intel_connector *intel_connector_alloc(void);
-void intel_connector_free(struct intel_connector *connector);
-void intel_connector_destroy(struct drm_connector *connector);
-int intel_connector_register(struct drm_connector *connector);
-void intel_connector_unregister(struct drm_connector *connector);
-void intel_connector_attach_encoder(struct intel_connector *connector,
-                                   struct intel_encoder *encoder);
-bool intel_connector_get_hw_state(struct intel_connector *connector);
-enum pipe intel_connector_get_pipe(struct intel_connector *connector);
-int intel_connector_update_modes(struct drm_connector *connector,
-                                struct edid *edid);
-int intel_ddc_get_modes(struct drm_connector *c, struct i2c_adapter *adapter);
-void intel_attach_force_audio_property(struct drm_connector *connector);
-void intel_attach_broadcast_rgb_property(struct drm_connector *connector);
-void intel_attach_aspect_ratio_property(struct drm_connector *connector);
-void intel_attach_colorspace_property(struct drm_connector *connector);
-
 /* intel_csr.c */
 void intel_csr_ucode_init(struct drm_i915_private *);
 void intel_csr_load_program(struct drm_i915_private *);
index a6c82482a841be503a3c6fe8ada5ec99981928df..58af409a6d581151dedbbcf1aa7c2b7a77e116e6 100644 (file)
  * Authors:
  *     Eric Anholt <eric@anholt.net>
  */
+
 #include <linux/i2c.h>
 #include <linux/slab.h>
+
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc.h>
-#include "intel_drv.h"
 #include <drm/i915_drm.h>
-#include "i915_drv.h"
+
 #include "dvo.h"
+#include "i915_drv.h"
+#include "intel_connector.h"
+#include "intel_drv.h"
 
 #define SIL164_ADDR    0x38
 #define CH7xxx_ADDR    0x76
index de1d420a73b9e503125a6f0719cf6b48aaad154b..92f4d9b65150d600d62351ffa3fd66a86efb61de 100644 (file)
@@ -41,6 +41,7 @@
 
 #include "i915_drv.h"
 #include "intel_audio.h"
+#include "intel_connector.h"
 #include "intel_ddi.h"
 #include "intel_drv.h"
 
index 34dd2d71814bbb64dca0a13fc26ff680a0829c19..fbc99af2158e3e471645e364fa4f182b1e6710fd 100644 (file)
  */
 
 #include <acpi/button.h>
+#include <linux/acpi.h>
 #include <linux/dmi.h>
 #include <linux/i2c.h>
 #include <linux/slab.h>
 #include <linux/vga_switcheroo.h>
+
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_edid.h>
-#include "intel_drv.h"
 #include <drm/i915_drm.h>
+
 #include "i915_drv.h"
-#include <linux/acpi.h>
+#include "intel_connector.h"
+#include "intel_drv.h"
 
 /* Private structure for the integrated LVDS support */
 struct intel_lvds_pps {
index 47cd4a338db60bd754185461468206f23ba7eba6..5bd92cf6395cfd7b02ca99ee70f68ff92e5330fb 100644 (file)
@@ -33,6 +33,8 @@
 #include <linux/kernel.h>
 #include <linux/moduleparam.h>
 #include <linux/pwm.h>
+
+#include "intel_connector.h"
 #include "intel_drv.h"
 
 #define CRC_PMIC_PWM_PERIOD_NS 21333
index 68f497493d439a31105cef7aeb99edc3588af9c4..e148c8956cb536129f1af1072593c0c0c9799314 100644 (file)
  * Authors:
  *     Eric Anholt <eric@anholt.net>
  */
-#include <linux/i2c.h>
-#include <linux/slab.h>
+
 #include <linux/delay.h>
 #include <linux/export.h>
+#include <linux/i2c.h>
+#include <linux/slab.h>
+
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_edid.h>
-#include "intel_drv.h"
 #include <drm/i915_drm.h>
+
 #include "i915_drv.h"
+#include "intel_connector.h"
+#include "intel_drv.h"
 #include "intel_sdvo_regs.h"
 
 #define SDVO_TMDS_MASK (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)
index 3924c4944e1f03518a3d119af905e8a2a678faba..14f86201507060a9badd0c6658a9ef2275281b62 100644 (file)
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_edid.h>
-#include "intel_drv.h"
 #include <drm/i915_drm.h>
+
 #include "i915_drv.h"
+#include "intel_connector.h"
+#include "intel_drv.h"
 
 enum tv_margin {
        TV_MARGIN_LEFT, TV_MARGIN_TOP,
index 6898541403a2ac489d2bac676ca5a5d62d031835..118feaa9c54e5e5d9eed0913c4df9b8b1c3d9f68 100644 (file)
  * Author: Jani Nikula <jani.nikula@intel.com>
  */
 
+#include <linux/gpio/consumer.h>
+#include <linux/slab.h>
+
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_edid.h>
-#include <drm/i915_drm.h>
 #include <drm/drm_mipi_dsi.h>
-#include <linux/slab.h>
-#include <linux/gpio/consumer.h>
+#include <drm/i915_drm.h>
+
 #include "i915_drv.h"
+#include "intel_connector.h"
 #include "intel_drv.h"
 #include "intel_dsi.h"