]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915: extract intel_panel.h from intel_drv.h
authorJani Nikula <jani.nikula@intel.com>
Fri, 5 Apr 2019 11:00:14 +0000 (14:00 +0300)
committerJani Nikula <jani.nikula@intel.com>
Mon, 8 Apr 2019 06:52:36 +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/c9f02ae09123866bc55269175ab75e844ffbd6ac.1554461791.git.jani.nikula@intel.com
14 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_ddi.c
drivers/gpu/drm/i915/intel_dp.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_opregion.c
drivers/gpu/drm/i915/intel_panel.c
drivers/gpu/drm/i915/intel_panel.h [new file with mode: 0644]
drivers/gpu/drm/i915/intel_sdvo.c
drivers/gpu/drm/i915/vlv_dsi.c

index a4846d7eaf46adce1855d4c1f5c07286eaaac2f7..d3a8fc37d6b5f3bbc57756aae3b1813d4338a004 100644 (file)
@@ -20,6 +20,7 @@ header_test := \
        intel_frontbuffer.h \
        intel_hdcp.h \
        intel_lspcon.h \
+       intel_panel.h \
        intel_psr.h \
        intel_sdvo.h \
        intel_workarounds_types.h
index 08e471898c865cbd44542a1358f989bebf94c30f..527aafc16e62e0c43cadbe0f786ddcad6d81d386 100644 (file)
@@ -31,6 +31,7 @@
 #include "intel_connector.h"
 #include "intel_ddi.h"
 #include "intel_dsi.h"
+#include "intel_panel.h"
 
 static inline int header_credits_available(struct drm_i915_private *dev_priv,
                                           enum transcoder dsi_trans)
index 6627d92ece14f980a842e7df306128ff0c547c86..073b6c3ab7cc4e1d907b338c8aadac14ab9ef938 100644 (file)
@@ -33,6 +33,7 @@
 #include "intel_connector.h"
 #include "intel_drv.h"
 #include "intel_hdcp.h"
+#include "intel_panel.h"
 
 int intel_connector_init(struct intel_connector *connector)
 {
index bc7b00f43fae63236c08c0312216853e7108303f..ca66ac99800827808b09dae13a0187df8ebd8a17 100644 (file)
@@ -35,6 +35,7 @@
 #include "intel_dsi.h"
 #include "intel_hdcp.h"
 #include "intel_lspcon.h"
+#include "intel_panel.h"
 #include "intel_psr.h"
 
 struct ddi_buf_trans {
index efc411964bccc3a2cf844797cf2743c21c659255..02d662ff5df9e5cc4533486198af22951d996720 100644 (file)
@@ -48,6 +48,7 @@
 #include "intel_drv.h"
 #include "intel_hdcp.h"
 #include "intel_lspcon.h"
+#include "intel_panel.h"
 #include "intel_psr.h"
 
 #define DP_DPRX_ESI_LEN 14
index e04a622a71ed621ba740711b65f07500aac1d78b..8e23827a03d94ee604233e662e90dfb40c60c2a7 100644 (file)
@@ -2054,51 +2054,6 @@ int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data,
                              struct drm_file *file_priv);
 void intel_overlay_reset(struct drm_i915_private *dev_priv);
 
-
-/* intel_panel.c */
-int intel_panel_init(struct intel_panel *panel,
-                    struct drm_display_mode *fixed_mode,
-                    struct drm_display_mode *downclock_mode);
-void intel_panel_fini(struct intel_panel *panel);
-void intel_fixed_panel_mode(const struct drm_display_mode *fixed_mode,
-                           struct drm_display_mode *adjusted_mode);
-void intel_pch_panel_fitting(struct intel_crtc *crtc,
-                            struct intel_crtc_state *pipe_config,
-                            int fitting_mode);
-void intel_gmch_panel_fitting(struct intel_crtc *crtc,
-                             struct intel_crtc_state *pipe_config,
-                             int fitting_mode);
-void intel_panel_set_backlight_acpi(const struct drm_connector_state *conn_state,
-                                   u32 level, u32 max);
-int intel_panel_setup_backlight(struct drm_connector *connector,
-                               enum pipe pipe);
-void intel_panel_enable_backlight(const struct intel_crtc_state *crtc_state,
-                                 const struct drm_connector_state *conn_state);
-void intel_panel_update_backlight(struct intel_encoder *encoder,
-                                 const struct intel_crtc_state *crtc_state,
-                                 const struct drm_connector_state *conn_state);
-void intel_panel_disable_backlight(const struct drm_connector_state *old_conn_state);
-struct drm_display_mode *
-intel_panel_edid_downclock_mode(struct intel_connector *connector,
-                               const struct drm_display_mode *fixed_mode);
-struct drm_display_mode *
-intel_panel_edid_fixed_mode(struct intel_connector *connector);
-struct drm_display_mode *
-intel_panel_vbt_fixed_mode(struct intel_connector *connector);
-
-#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
-int intel_backlight_device_register(struct intel_connector *connector);
-void intel_backlight_device_unregister(struct intel_connector *connector);
-#else /* CONFIG_BACKLIGHT_CLASS_DEVICE */
-static inline int intel_backlight_device_register(struct intel_connector *connector)
-{
-       return 0;
-}
-static inline void intel_backlight_device_unregister(struct intel_connector *connector)
-{
-}
-#endif /* CONFIG_BACKLIGHT_CLASS_DEVICE */
-
 /* intel_quirks.c */
 void intel_init_quirks(struct drm_i915_private *dev_priv);
 
index 58af409a6d581151dedbbcf1aa7c2b7a77e116e6..4fda625ea2c13cdc4aa3c14503fcea3a7de24e13 100644 (file)
@@ -36,6 +36,7 @@
 #include "i915_drv.h"
 #include "intel_connector.h"
 #include "intel_drv.h"
+#include "intel_panel.h"
 
 #define SIL164_ADDR    0x38
 #define CH7xxx_ADDR    0x76
index 18fef71fc4f8c28aeeecc970a0080f2243074439..5725fedaceec4196e5bb4f2f5f7780c6449c8112 100644 (file)
@@ -47,6 +47,7 @@
 #include "intel_hdcp.h"
 #include "intel_lspcon.h"
 #include "intel_sdvo.h"
+#include "intel_panel.h"
 
 static struct drm_device *intel_hdmi_to_dev(struct intel_hdmi *intel_hdmi)
 {
index fbc99af2158e3e471645e364fa4f182b1e6710fd..3788d2fe4a9e32f95310b74f40f13b632c870857 100644 (file)
@@ -42,6 +42,7 @@
 #include "i915_drv.h"
 #include "intel_connector.h"
 #include "intel_drv.h"
+#include "intel_panel.h"
 
 /* Private structure for the integrated LVDS support */
 struct intel_lvds_pps {
index 5e00ee9270b5942a6d6d39462883be6021493d1f..8fa1159d097fce38d92d9ac08bcdfc1d656914aa 100644 (file)
 
 #include <drm/i915_drm.h>
 
-#include "intel_opregion.h"
 #include "i915_drv.h"
 #include "intel_drv.h"
+#include "intel_opregion.h"
+#include "intel_panel.h"
 
 #define OPREGION_HEADER_OFFSET 0
 #define OPREGION_ACPI_OFFSET   0x100
index 5bd92cf6395cfd7b02ca99ee70f68ff92e5330fb..4ab4ce6569e74b0a8b893cd3a81db498273fd9b4 100644 (file)
@@ -36,6 +36,7 @@
 
 #include "intel_connector.h"
 #include "intel_drv.h"
+#include "intel_panel.h"
 
 #define CRC_PMIC_PWM_PERIOD_NS 21333
 
diff --git a/drivers/gpu/drm/i915/intel_panel.h b/drivers/gpu/drm/i915/intel_panel.h
new file mode 100644 (file)
index 0000000..cedeea4
--- /dev/null
@@ -0,0 +1,65 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_PANEL_H__
+#define __INTEL_PANEL_H__
+
+#include <linux/types.h>
+
+#include "intel_display.h"
+
+struct drm_connector;
+struct drm_connector_state;
+struct drm_display_mode;
+struct intel_connector;
+struct intel_crtc;
+struct intel_crtc_state;
+struct intel_encoder;
+struct intel_panel;
+
+int intel_panel_init(struct intel_panel *panel,
+                    struct drm_display_mode *fixed_mode,
+                    struct drm_display_mode *downclock_mode);
+void intel_panel_fini(struct intel_panel *panel);
+void intel_fixed_panel_mode(const struct drm_display_mode *fixed_mode,
+                           struct drm_display_mode *adjusted_mode);
+void intel_pch_panel_fitting(struct intel_crtc *crtc,
+                            struct intel_crtc_state *pipe_config,
+                            int fitting_mode);
+void intel_gmch_panel_fitting(struct intel_crtc *crtc,
+                             struct intel_crtc_state *pipe_config,
+                             int fitting_mode);
+void intel_panel_set_backlight_acpi(const struct drm_connector_state *conn_state,
+                                   u32 level, u32 max);
+int intel_panel_setup_backlight(struct drm_connector *connector,
+                               enum pipe pipe);
+void intel_panel_enable_backlight(const struct intel_crtc_state *crtc_state,
+                                 const struct drm_connector_state *conn_state);
+void intel_panel_update_backlight(struct intel_encoder *encoder,
+                                 const struct intel_crtc_state *crtc_state,
+                                 const struct drm_connector_state *conn_state);
+void intel_panel_disable_backlight(const struct drm_connector_state *old_conn_state);
+struct drm_display_mode *
+intel_panel_edid_downclock_mode(struct intel_connector *connector,
+                               const struct drm_display_mode *fixed_mode);
+struct drm_display_mode *
+intel_panel_edid_fixed_mode(struct intel_connector *connector);
+struct drm_display_mode *
+intel_panel_vbt_fixed_mode(struct intel_connector *connector);
+
+#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
+int intel_backlight_device_register(struct intel_connector *connector);
+void intel_backlight_device_unregister(struct intel_connector *connector);
+#else /* CONFIG_BACKLIGHT_CLASS_DEVICE */
+static inline int intel_backlight_device_register(struct intel_connector *connector)
+{
+       return 0;
+}
+static inline void intel_backlight_device_unregister(struct intel_connector *connector)
+{
+}
+#endif /* CONFIG_BACKLIGHT_CLASS_DEVICE */
+
+#endif /* __INTEL_PANEL_H__ */
index 0cebf6ccc75ac1273c52400957e9eeb9bf591aa8..c815845e8c34f978363c5646e12b195c55875b32 100644 (file)
@@ -39,6 +39,7 @@
 #include "i915_drv.h"
 #include "intel_connector.h"
 #include "intel_drv.h"
+#include "intel_panel.h"
 #include "intel_sdvo.h"
 #include "intel_sdvo_regs.h"
 
index 118feaa9c54e5e5d9eed0913c4df9b8b1c3d9f68..e0b1ec821960c95ab739669b8771bc7c56759dd5 100644 (file)
@@ -36,6 +36,7 @@
 #include "intel_connector.h"
 #include "intel_drv.h"
 #include "intel_dsi.h"
+#include "intel_panel.h"
 
 /* return pixels in terms of txbyteclkhs */
 static u16 txbyteclkhs(u16 pixels, int bpp, int lane_count,