All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/25] drm/i915: the great header refactoring, part one
@ 2019-04-04 21:14 Jani Nikula
  2019-04-04 21:14 ` [PATCH 01/25] drm/i915: make intel_frontbuffer.h self-contained Jani Nikula
                   ` (28 more replies)
  0 siblings, 29 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

intel_drv.h has grown out of proportions, and turned into a dumping
ground. Way back when it was useful to have only a handful of headers,
but we're long past that.

Start splitting off per-module headers. The basic principles:

* Make the new headers self-contained (i.e. can be compiled without
  including other headers first), and test this using the new infra for
  that.

* Use minimal includes for making the headers self-contained. Use
  forward declarations for structs where applicable, and e.g. include
  <linux/types.h> instead of <linux/kernel.h>.

* Only split off the headers, and mostly refrain from doing other
  refactoring while at it. (There are a few minor things.)

* Mostly only split off function declarations. Splitting off types is
  left for follow-up work.

* Include the new headers only where needed. This leads to a lot of
  includes here and there, but on the other hand increases the clarity
  of the relationships between the modules. (And already raises a bunch
  of questions about the split and cross-calls between some
  modules. It'll be easier to analyze this.)

* Wherever adding new includes, group the includes by <linux/...> first,
  then <drm/...>, then "...", and sort the groups alphabetically.

* Choice of what to extract first here is purely arbitrary.

* Follow-up work should consider renaming functions according to the
  module, i.e. functions in intel_foo.c should be prefixed
  intel_foo_. Better naming will be helpful in further organizing the
  driver, as well as grasping the structure to begin with.

BR,
Jani.


Jani Nikula (25):
  drm/i915: make intel_frontbuffer.h self-contained
  drm/i915: extract intel_audio.h from intel_drv.h
  drm/i915: extract intel_crt.h from intel_drv.h
  drm/i915: extract intel_ddi.h from intel_drv.h
  drm/i915: extract intel_connector.h from intel_drv.h
  drm/i915: extract intel_csr.h from intel_drv.h
  drm/i915: extract intel_fbc.h from intel_drv.h
  drm/i915: extract intel_psr.h from intel_drv.h
  drm/i915: extract intel_color.h from intel_drv.h
  drm/i915: extract intel_lspcon.h from intel_drv.h
  drm/i915: extract intel_sdvo.h from intel_drv.h
  drm/i915: extract intel_hdcp.h from intel_drv.h
  drm/i915: extract intel_panel.h from intel_drv.h
  drm/i915: extract intel_pm.h from intel_drv.h
  drm/i915: extract intel_fbdev.h from intel_drv.h
  drm/i915: extract intel_dp.h from intel_drv.h
  drm/i915: extract intel_hdmi.h from intel_drv.h
  drm/i915: extract intel_atomic_plane.h from intel_drv.h
  drm/i915: extract intel_pipe_crc.h from intel_drv.h
  drm/i915: extract intel_tv.h from intel_drv.h
  drm/i915: extract intel_lvds.h from intel_drv.h
  drm/i915: extract intel_dvo.h from intel_drv.h
  drm/i915: extract intel_sprite.h from intel_drv.h
  drm/i915: extract intel_cdclk.h from intel_drv.h
  drm/i915/cdclk: have only one init/uninit function

 drivers/gpu/drm/i915/Makefile.header-test     |  24 +
 drivers/gpu/drm/i915/i915_debugfs.c           |  13 +-
 drivers/gpu/drm/i915/i915_drv.c               |  11 +-
 drivers/gpu/drm/i915/i915_drv.h               |  11 +-
 drivers/gpu/drm/i915/i915_gem.c               |   1 +
 drivers/gpu/drm/i915/i915_irq.c               |  11 +-
 drivers/gpu/drm/i915/i915_pci.c               |   1 +
 drivers/gpu/drm/i915/i915_request.c           |   3 +-
 drivers/gpu/drm/i915/i915_reset.h             |   1 +
 drivers/gpu/drm/i915/i915_suspend.c           |   5 +-
 drivers/gpu/drm/i915/icl_dsi.c                |   6 +-
 drivers/gpu/drm/i915/intel_atomic.c           |   2 +
 drivers/gpu/drm/i915/intel_atomic_plane.c     |  36 +-
 drivers/gpu/drm/i915/intel_atomic_plane.h     |  40 ++
 drivers/gpu/drm/i915/intel_audio.c            |  12 +-
 drivers/gpu/drm/i915/intel_audio.h            |  24 +
 drivers/gpu/drm/i915/intel_cdclk.c            | 121 ++--
 drivers/gpu/drm/i915/intel_cdclk.h            |  46 ++
 drivers/gpu/drm/i915/intel_color.h            |  17 +
 drivers/gpu/drm/i915/intel_connector.c        |   8 +-
 drivers/gpu/drm/i915/intel_connector.h        |  35 ++
 drivers/gpu/drm/i915/intel_crt.c              |   7 +-
 drivers/gpu/drm/i915/intel_crt.h              |  21 +
 drivers/gpu/drm/i915/intel_csr.h              |  17 +
 drivers/gpu/drm/i915/intel_ddi.c              |   9 +
 drivers/gpu/drm/i915/intel_ddi.h              |  53 ++
 drivers/gpu/drm/i915/intel_display.c          |  28 +-
 drivers/gpu/drm/i915/intel_dp.c               |  20 +-
 drivers/gpu/drm/i915/intel_dp.h               | 121 ++++
 drivers/gpu/drm/i915/intel_dp_link_training.c |   1 +
 drivers/gpu/drm/i915/intel_dp_mst.c           |   9 +-
 drivers/gpu/drm/i915/intel_dpio_phy.c         |   1 +
 drivers/gpu/drm/i915/intel_drv.h              | 580 +-----------------
 drivers/gpu/drm/i915/intel_dvo.c              |   9 +-
 drivers/gpu/drm/i915/intel_dvo.h              |  13 +
 drivers/gpu/drm/i915/intel_fbc.c              |   3 +-
 drivers/gpu/drm/i915/intel_fbc.h              |  42 ++
 drivers/gpu/drm/i915/intel_fbdev.c            |  17 +-
 drivers/gpu/drm/i915/intel_fbdev.h            |  53 ++
 drivers/gpu/drm/i915/intel_fifo_underrun.c    |   1 +
 drivers/gpu/drm/i915/intel_frontbuffer.c      |   5 +-
 drivers/gpu/drm/i915/intel_frontbuffer.h      |  10 +
 drivers/gpu/drm/i915/intel_hdcp.h             |  33 +
 drivers/gpu/drm/i915/intel_hdmi.c             |  16 +-
 drivers/gpu/drm/i915/intel_hdmi.h             |  51 ++
 drivers/gpu/drm/i915/intel_lspcon.c           |   5 +-
 drivers/gpu/drm/i915/intel_lspcon.h           |  38 ++
 drivers/gpu/drm/i915/intel_lvds.c             |   8 +-
 drivers/gpu/drm/i915/intel_lvds.h             |  22 +
 drivers/gpu/drm/i915/intel_opregion.c         |   3 +-
 drivers/gpu/drm/i915/intel_panel.c            |   2 +
 drivers/gpu/drm/i915/intel_panel.h            |  65 ++
 drivers/gpu/drm/i915/intel_pipe_crc.h         |  35 ++
 drivers/gpu/drm/i915/intel_pm.c               |   5 +-
 drivers/gpu/drm/i915/intel_pm.h               |  72 +++
 drivers/gpu/drm/i915/intel_psr.c              |  13 +-
 drivers/gpu/drm/i915/intel_psr.h              |  40 ++
 drivers/gpu/drm/i915/intel_runtime_pm.c       |  20 +-
 drivers/gpu/drm/i915/intel_sdvo.c             |  12 +-
 drivers/gpu/drm/i915/intel_sdvo.h             |  23 +
 drivers/gpu/drm/i915/intel_sprite.c           |  16 +-
 drivers/gpu/drm/i915/intel_sprite.h           |  55 ++
 drivers/gpu/drm/i915/intel_tv.c               |   4 +-
 drivers/gpu/drm/i915/intel_tv.h               |  13 +
 drivers/gpu/drm/i915/intel_uncore.c           |   9 +-
 drivers/gpu/drm/i915/vlv_dsi.c                |  10 +-
 66 files changed, 1267 insertions(+), 751 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_atomic_plane.h
 create mode 100644 drivers/gpu/drm/i915/intel_audio.h
 create mode 100644 drivers/gpu/drm/i915/intel_cdclk.h
 create mode 100644 drivers/gpu/drm/i915/intel_color.h
 create mode 100644 drivers/gpu/drm/i915/intel_connector.h
 create mode 100644 drivers/gpu/drm/i915/intel_crt.h
 create mode 100644 drivers/gpu/drm/i915/intel_csr.h
 create mode 100644 drivers/gpu/drm/i915/intel_ddi.h
 create mode 100644 drivers/gpu/drm/i915/intel_dp.h
 create mode 100644 drivers/gpu/drm/i915/intel_dvo.h
 create mode 100644 drivers/gpu/drm/i915/intel_fbc.h
 create mode 100644 drivers/gpu/drm/i915/intel_fbdev.h
 create mode 100644 drivers/gpu/drm/i915/intel_hdcp.h
 create mode 100644 drivers/gpu/drm/i915/intel_hdmi.h
 create mode 100644 drivers/gpu/drm/i915/intel_lspcon.h
 create mode 100644 drivers/gpu/drm/i915/intel_lvds.h
 create mode 100644 drivers/gpu/drm/i915/intel_panel.h
 create mode 100644 drivers/gpu/drm/i915/intel_pipe_crc.h
 create mode 100644 drivers/gpu/drm/i915/intel_pm.h
 create mode 100644 drivers/gpu/drm/i915/intel_psr.h
 create mode 100644 drivers/gpu/drm/i915/intel_sdvo.h
 create mode 100644 drivers/gpu/drm/i915/intel_sprite.h
 create mode 100644 drivers/gpu/drm/i915/intel_tv.h

-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 33+ messages in thread

* [PATCH 01/25] drm/i915: make intel_frontbuffer.h self-contained
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 02/25] drm/i915: extract intel_audio.h from intel_drv.h Jani Nikula
                   ` (27 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

This will be helpful in the follow-up work. No functional changes.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/i915_drv.h           | 11 ++---------
 drivers/gpu/drm/i915/intel_frontbuffer.h  | 10 ++++++++++
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index f7809b5c21ad..243a64fb4cc7 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -10,6 +10,7 @@ header_test := \
 	i915_timeline_types.h \
 	intel_context_types.h \
 	intel_engine_types.h \
+	intel_frontbuffer.h \
 	intel_workarounds_types.h
 
 quiet_cmd_header_test = HDRTEST $@
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 4af815c3c02d..35fe464e5ed3 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -66,13 +66,14 @@
 #include "intel_device_info.h"
 #include "intel_display.h"
 #include "intel_dpll_mgr.h"
+#include "intel_frontbuffer.h"
 #include "intel_lrc.h"
 #include "intel_opregion.h"
 #include "intel_ringbuffer.h"
+#include "intel_uc.h"
 #include "intel_uncore.h"
 #include "intel_wopcm.h"
 #include "intel_workarounds.h"
-#include "intel_uc.h"
 
 #include "i915_gem.h"
 #include "i915_gem_context.h"
@@ -375,14 +376,6 @@ enum i915_cache_level {
 
 #define I915_COLOR_UNEVICTABLE (-1) /* a non-vma sharing the address space */
 
-enum fb_op_origin {
-	ORIGIN_GTT,
-	ORIGIN_CPU,
-	ORIGIN_CS,
-	ORIGIN_FLIP,
-	ORIGIN_DIRTYFB,
-};
-
 struct intel_fbc {
 	/* This is always the inner lock when overlapping with struct_mutex and
 	 * it's the outer lock when overlapping with stolen_lock. */
diff --git a/drivers/gpu/drm/i915/intel_frontbuffer.h b/drivers/gpu/drm/i915/intel_frontbuffer.h
index 63cd9a753a72..d5894666f658 100644
--- a/drivers/gpu/drm/i915/intel_frontbuffer.h
+++ b/drivers/gpu/drm/i915/intel_frontbuffer.h
@@ -24,9 +24,19 @@
 #ifndef __INTEL_FRONTBUFFER_H__
 #define __INTEL_FRONTBUFFER_H__
 
+#include "i915_gem_object.h"
+
 struct drm_i915_private;
 struct drm_i915_gem_object;
 
+enum fb_op_origin {
+	ORIGIN_GTT,
+	ORIGIN_CPU,
+	ORIGIN_CS,
+	ORIGIN_FLIP,
+	ORIGIN_DIRTYFB,
+};
+
 void intel_frontbuffer_flip_prepare(struct drm_i915_private *dev_priv,
 				    unsigned frontbuffer_bits);
 void intel_frontbuffer_flip_complete(struct drm_i915_private *dev_priv,
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 02/25] drm/i915: extract intel_audio.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
  2019-04-04 21:14 ` [PATCH 01/25] drm/i915: make intel_frontbuffer.h self-contained Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 03/25] drm/i915: extract intel_crt.h " Jani Nikula
                   ` (26 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/i915_drv.c           |  5 +++--
 drivers/gpu/drm/i915/intel_audio.c        | 12 +++++++-----
 drivers/gpu/drm/i915/intel_audio.h        | 24 +++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_ddi.c          |  2 ++
 drivers/gpu/drm/i915/intel_dp.c           | 11 +++++++----
 drivers/gpu/drm/i915/intel_dp_mst.c       |  6 ++++--
 drivers/gpu/drm/i915/intel_drv.h          | 13 ------------
 drivers/gpu/drm/i915/intel_hdmi.c         |  9 ++++++---
 9 files changed, 54 insertions(+), 29 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_audio.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index 243a64fb4cc7..09bba7c9376c 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -8,6 +8,7 @@ header_test := \
 	i915_priolist_types.h \
 	i915_scheduler_types.h \
 	i915_timeline_types.h \
+	intel_audio.h \
 	intel_context_types.h \
 	intel_engine_types.h \
 	intel_frontbuffer.h \
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 0bbf3f5db5fc..80166e3ee68e 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -48,11 +48,12 @@
 #include <drm/i915_drm.h>
 
 #include "i915_drv.h"
-#include "i915_trace.h"
 #include "i915_pmu.h"
-#include "i915_reset.h"
 #include "i915_query.h"
+#include "i915_reset.h"
+#include "i915_trace.h"
 #include "i915_vgpu.h"
+#include "intel_audio.h"
 #include "intel_drv.h"
 #include "intel_uc.h"
 #include "intel_workarounds.h"
diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
index 20324b0d34c7..bca4cc025d3d 100644
--- a/drivers/gpu/drm/i915/intel_audio.c
+++ b/drivers/gpu/drm/i915/intel_audio.c
@@ -21,14 +21,16 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include <linux/kernel.h>
 #include <linux/component.h>
+#include <linux/kernel.h>
+
+#include <drm/drm_edid.h>
 #include <drm/i915_component.h>
 #include <drm/intel_lpe_audio.h>
-#include "intel_drv.h"
 
-#include <drm/drm_edid.h>
 #include "i915_drv.h"
+#include "intel_audio.h"
+#include "intel_drv.h"
 
 /**
  * DOC: High Definition Audio over HDMI and Display Port
@@ -1045,7 +1047,7 @@ static const struct component_ops i915_audio_component_bind_ops = {
  * We ignore any error during registration and continue with reduced
  * functionality (i.e. without HDMI audio).
  */
-void i915_audio_component_init(struct drm_i915_private *dev_priv)
+static void i915_audio_component_init(struct drm_i915_private *dev_priv)
 {
 	int ret;
 
@@ -1068,7 +1070,7 @@ void i915_audio_component_init(struct drm_i915_private *dev_priv)
  * Deregisters the audio component, breaking any existing binding to the
  * corresponding snd_hda_intel driver's master component.
  */
-void i915_audio_component_cleanup(struct drm_i915_private *dev_priv)
+static void i915_audio_component_cleanup(struct drm_i915_private *dev_priv)
 {
 	if (!dev_priv->audio_component_registered)
 		return;
diff --git a/drivers/gpu/drm/i915/intel_audio.h b/drivers/gpu/drm/i915/intel_audio.h
new file mode 100644
index 000000000000..a3657c7a7ba2
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_audio.h
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_AUDIO_H__
+#define __INTEL_AUDIO_H__
+
+struct drm_connector_state;
+struct drm_i915_private;
+struct intel_crtc_state;
+struct intel_encoder;
+
+void intel_init_audio_hooks(struct drm_i915_private *dev_priv);
+void intel_audio_codec_enable(struct intel_encoder *encoder,
+			      const struct intel_crtc_state *crtc_state,
+			      const struct drm_connector_state *conn_state);
+void intel_audio_codec_disable(struct intel_encoder *encoder,
+			       const struct intel_crtc_state *old_crtc_state,
+			       const struct drm_connector_state *old_conn_state);
+void intel_audio_init(struct drm_i915_private *dev_priv);
+void intel_audio_deinit(struct drm_i915_private *dev_priv);
+
+#endif /* __INTEL_AUDIO_H__ */
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 3f1e491bd0c0..46a6adea815a 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -26,7 +26,9 @@
  */
 
 #include <drm/drm_scdc_helper.h>
+
 #include "i915_drv.h"
+#include "intel_audio.h"
 #include "intel_drv.h"
 #include "intel_dsi.h"
 
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 72c49070ed14..573cb04e2a56 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -25,22 +25,25 @@
  *
  */
 
-#include <linux/i2c.h>
-#include <linux/slab.h>
 #include <linux/export.h>
-#include <linux/types.h>
+#include <linux/i2c.h>
 #include <linux/notifier.h>
 #include <linux/reboot.h>
+#include <linux/slab.h>
+#include <linux/types.h>
 #include <asm/byteorder.h>
+
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_dp_helper.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_hdcp.h>
 #include <drm/drm_probe_helper.h>
-#include "intel_drv.h"
 #include <drm/i915_drm.h>
+
 #include "i915_drv.h"
+#include "intel_audio.h"
+#include "intel_drv.h"
 
 #define DP_DPRX_ESI_LEN 14
 
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index 19d81cef2ab6..360e43b25fa5 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -23,12 +23,14 @@
  *
  */
 
-#include "i915_drv.h"
-#include "intel_drv.h"
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_probe_helper.h>
 
+#include "i915_drv.h"
+#include "intel_audio.h"
+#include "intel_drv.h"
+
 static int intel_dp_mst_compute_link_config(struct intel_encoder *encoder,
 					    struct intel_crtc_state *crtc_state,
 					    struct drm_connector_state *conn_state,
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 64544613920b..5dc434d74ada 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1669,19 +1669,6 @@ int cnl_calc_wrpll_link(struct drm_i915_private *dev_priv,
 unsigned int intel_fb_align_height(const struct drm_framebuffer *fb,
 				   int color_plane, unsigned int height);
 
-/* intel_audio.c */
-void intel_init_audio_hooks(struct drm_i915_private *dev_priv);
-void intel_audio_codec_enable(struct intel_encoder *encoder,
-			      const struct intel_crtc_state *crtc_state,
-			      const struct drm_connector_state *conn_state);
-void intel_audio_codec_disable(struct intel_encoder *encoder,
-			       const struct intel_crtc_state *old_crtc_state,
-			       const struct drm_connector_state *old_conn_state);
-void i915_audio_component_init(struct drm_i915_private *dev_priv);
-void i915_audio_component_cleanup(struct drm_i915_private *dev_priv);
-void intel_audio_init(struct drm_i915_private *dev_priv);
-void intel_audio_deinit(struct drm_i915_private *dev_priv);
-
 /* intel_cdclk.c */
 int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state);
 void skl_init_cdclk(struct drm_i915_private *dev_priv);
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 26767785f14a..1c76e20f9ebc 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -26,19 +26,22 @@
  *	Jesse Barnes <jesse.barnes@intel.com>
  */
 
-#include <linux/i2c.h>
-#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/hdmi.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 <drm/drm_hdcp.h>
 #include <drm/drm_scdc_helper.h>
-#include "intel_drv.h"
 #include <drm/i915_drm.h>
 #include <drm/intel_lpe_audio.h>
+
 #include "i915_drv.h"
+#include "intel_audio.h"
+#include "intel_drv.h"
 
 static struct drm_device *intel_hdmi_to_dev(struct intel_hdmi *intel_hdmi)
 {
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 03/25] drm/i915: extract intel_crt.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
  2019-04-04 21:14 ` [PATCH 01/25] drm/i915: make intel_frontbuffer.h self-contained Jani Nikula
  2019-04-04 21:14 ` [PATCH 02/25] drm/i915: extract intel_audio.h from intel_drv.h Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:22   ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 04/25] drm/i915: extract intel_ddi.h " Jani Nikula
                   ` (25 subsequent siblings)
  28 siblings, 1 reply; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/intel_crt.c          |  5 ++++-
 drivers/gpu/drm/i915/intel_crt.h          | 21 +++++++++++++++++++++
 drivers/gpu/drm/i915/intel_display.c      | 11 ++---------
 drivers/gpu/drm/i915/intel_drv.h          |  6 ------
 drivers/gpu/drm/i915/intel_runtime_pm.c   |  1 +
 6 files changed, 29 insertions(+), 16 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_crt.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index 09bba7c9376c..fd0f33ea896d 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -10,6 +10,7 @@ header_test := \
 	i915_timeline_types.h \
 	intel_audio.h \
 	intel_context_types.h \
+	intel_crt.h \
 	intel_engine_types.h \
 	intel_frontbuffer.h \
 	intel_workarounds_types.h
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index 50530e49982c..a14afbe51b08 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -27,13 +27,16 @@
 #include <linux/dmi.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 <drm/drm_probe_helper.h>
-#include "intel_drv.h"
 #include <drm/i915_drm.h>
+
 #include "i915_drv.h"
+#include "intel_crt.h"
+#include "intel_drv.h"
 
 /* Here's the desired hotplug mode */
 #define ADPA_HOTPLUG_BITS (ADPA_CRT_HOTPLUG_PERIOD_128 |		\
diff --git a/drivers/gpu/drm/i915/intel_crt.h b/drivers/gpu/drm/i915/intel_crt.h
new file mode 100644
index 000000000000..1b3fba359efc
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_crt.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_CRT_H__
+#define __INTEL_CRT_H__
+
+#include "i915_reg.h"
+
+enum pipe;
+struct drm_encoder;
+struct drm_i915_private;
+struct drm_i915_private;
+
+bool intel_crt_port_enabled(struct drm_i915_private *dev_priv,
+			    i915_reg_t adpa_reg, enum pipe *pipe);
+void intel_crt_init(struct drm_i915_private *dev_priv);
+void intel_crt_reset(struct drm_encoder *encoder);
+
+#endif /* __INTEL_CRT_H__ */
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 7ecfb7d98839..5cf82dbead65 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -46,20 +46,13 @@
 
 #include "i915_drv.h"
 #include "i915_gem_clflush.h"
+#include "i915_reset.h"
 #include "i915_trace.h"
+#include "intel_crt.h"
 #include "intel_drv.h"
 #include "intel_dsi.h"
 #include "intel_frontbuffer.h"
 
-#include "intel_drv.h"
-#include "intel_dsi.h"
-#include "intel_frontbuffer.h"
-
-#include "i915_drv.h"
-#include "i915_gem_clflush.h"
-#include "i915_reset.h"
-#include "i915_trace.h"
-
 /* Primary plane formats for gen <= 3 */
 static const u32 i8xx_primary_formats[] = {
 	DRM_FORMAT_C8,
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 5dc434d74ada..847da5b24548 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1627,12 +1627,6 @@ void gen9_reset_guc_interrupts(struct drm_i915_private *dev_priv);
 void gen9_enable_guc_interrupts(struct drm_i915_private *dev_priv);
 void gen9_disable_guc_interrupts(struct drm_i915_private *dev_priv);
 
-/* intel_crt.c */
-bool intel_crt_port_enabled(struct drm_i915_private *dev_priv,
-			    i915_reg_t adpa_reg, enum pipe *pipe);
-void intel_crt_init(struct drm_i915_private *dev_priv);
-void intel_crt_reset(struct drm_encoder *encoder);
-
 /* intel_ddi.c */
 void intel_ddi_fdi_post_disable(struct intel_encoder *intel_encoder,
 				const struct intel_crtc_state *old_crtc_state,
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index 40ddfbb97acb..a9931081462b 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -32,6 +32,7 @@
 #include <drm/drm_print.h>
 
 #include "i915_drv.h"
+#include "intel_crt.h"
 #include "intel_drv.h"
 
 /**
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 04/25] drm/i915: extract intel_ddi.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (2 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 03/25] drm/i915: extract intel_crt.h " Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 05/25] drm/i915: extract intel_connector.h " Jani Nikula
                   ` (24 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/icl_dsi.c            |  4 +-
 drivers/gpu/drm/i915/intel_crt.c          |  1 +
 drivers/gpu/drm/i915/intel_ddi.h          | 53 +++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_display.c      |  1 +
 drivers/gpu/drm/i915/intel_dp.c           |  1 +
 drivers/gpu/drm/i915/intel_dp_mst.c       |  1 +
 drivers/gpu/drm/i915/intel_drv.h          | 38 +---------------
 drivers/gpu/drm/i915/intel_hdmi.c         |  1 +
 9 files changed, 64 insertions(+), 37 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_ddi.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index fd0f33ea896d..d9a6089f0de5 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -11,6 +11,7 @@ header_test := \
 	intel_audio.h \
 	intel_context_types.h \
 	intel_crt.h \
+	intel_ddi.h \
 	intel_engine_types.h \
 	intel_frontbuffer.h \
 	intel_workarounds_types.h
diff --git a/drivers/gpu/drm/i915/icl_dsi.c b/drivers/gpu/drm/i915/icl_dsi.c
index b67ffaa283dc..64beb141c1ec 100644
--- a/drivers/gpu/drm/i915/icl_dsi.c
+++ b/drivers/gpu/drm/i915/icl_dsi.c
@@ -25,8 +25,10 @@
  *   Jani Nikula <jani.nikula@intel.com>
  */
 
-#include <drm/drm_mipi_dsi.h>
 #include <drm/drm_atomic_helper.h>
+#include <drm/drm_mipi_dsi.h>
+
+#include "intel_ddi.h"
 #include "intel_dsi.h"
 
 static inline int header_credits_available(struct drm_i915_private *dev_priv,
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index a14afbe51b08..d649dae3cc70 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -36,6 +36,7 @@
 
 #include "i915_drv.h"
 #include "intel_crt.h"
+#include "intel_ddi.h"
 #include "intel_drv.h"
 
 /* Here's the desired hotplug mode */
diff --git a/drivers/gpu/drm/i915/intel_ddi.h b/drivers/gpu/drm/i915/intel_ddi.h
new file mode 100644
index 000000000000..9cf69175942e
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_ddi.h
@@ -0,0 +1,53 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_DDI_H__
+#define __INTEL_DDI_H__
+
+#include <drm/i915_drm.h>
+
+#include "intel_display.h"
+
+struct drm_connector_state;
+struct drm_i915_private;
+struct intel_connector;
+struct intel_crtc;
+struct intel_crtc_state;
+struct intel_dp;
+struct intel_dpll_hw_state;
+struct intel_encoder;
+
+void intel_ddi_fdi_post_disable(struct intel_encoder *intel_encoder,
+				const struct intel_crtc_state *old_crtc_state,
+				const struct drm_connector_state *old_conn_state);
+void hsw_fdi_link_train(struct intel_crtc *crtc,
+			const struct intel_crtc_state *crtc_state);
+void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port);
+bool intel_ddi_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe);
+void intel_ddi_enable_transcoder_func(const struct intel_crtc_state *crtc_state);
+void intel_ddi_disable_transcoder_func(const struct intel_crtc_state *crtc_state);
+void intel_ddi_enable_pipe_clock(const struct intel_crtc_state *crtc_state);
+void intel_ddi_disable_pipe_clock(const  struct intel_crtc_state *crtc_state);
+void intel_ddi_set_pipe_settings(const struct intel_crtc_state *crtc_state);
+void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp);
+bool intel_ddi_connector_get_hw_state(struct intel_connector *intel_connector);
+void intel_ddi_get_config(struct intel_encoder *encoder,
+			  struct intel_crtc_state *pipe_config);
+void intel_ddi_set_vc_payload_alloc(const struct intel_crtc_state *crtc_state,
+				    bool state);
+void intel_ddi_compute_min_voltage_level(struct drm_i915_private *dev_priv,
+					 struct intel_crtc_state *crtc_state);
+u32 bxt_signal_levels(struct intel_dp *intel_dp);
+u32 ddi_signal_levels(struct intel_dp *intel_dp);
+u8 intel_ddi_dp_voltage_max(struct intel_encoder *encoder);
+u8 intel_ddi_dp_pre_emphasis_max(struct intel_encoder *encoder,
+				 u8 voltage_swing);
+int intel_ddi_toggle_hdcp_signalling(struct intel_encoder *intel_encoder,
+				     bool enable);
+void icl_sanitize_encoder_pll_mapping(struct intel_encoder *encoder);
+int cnl_calc_wrpll_link(struct drm_i915_private *dev_priv,
+			struct intel_dpll_hw_state *state);
+
+#endif /* __INTEL_DDI_H__ */
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 5cf82dbead65..cae807341553 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -49,6 +49,7 @@
 #include "i915_reset.h"
 #include "i915_trace.h"
 #include "intel_crt.h"
+#include "intel_ddi.h"
 #include "intel_drv.h"
 #include "intel_dsi.h"
 #include "intel_frontbuffer.h"
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 573cb04e2a56..ca3ed4ae253c 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -43,6 +43,7 @@
 
 #include "i915_drv.h"
 #include "intel_audio.h"
+#include "intel_ddi.h"
 #include "intel_drv.h"
 
 #define DP_DPRX_ESI_LEN 14
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index 360e43b25fa5..62c240be8cc9 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -29,6 +29,7 @@
 
 #include "i915_drv.h"
 #include "intel_audio.h"
+#include "intel_ddi.h"
 #include "intel_drv.h"
 
 static int intel_dp_mst_compute_link_config(struct intel_encoder *encoder,
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 847da5b24548..b61ec71e971e 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1627,42 +1627,6 @@ void gen9_reset_guc_interrupts(struct drm_i915_private *dev_priv);
 void gen9_enable_guc_interrupts(struct drm_i915_private *dev_priv);
 void gen9_disable_guc_interrupts(struct drm_i915_private *dev_priv);
 
-/* intel_ddi.c */
-void intel_ddi_fdi_post_disable(struct intel_encoder *intel_encoder,
-				const struct intel_crtc_state *old_crtc_state,
-				const struct drm_connector_state *old_conn_state);
-void hsw_fdi_link_train(struct intel_crtc *crtc,
-			const struct intel_crtc_state *crtc_state);
-void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port);
-bool intel_ddi_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe);
-void intel_ddi_enable_transcoder_func(const struct intel_crtc_state *crtc_state);
-void intel_ddi_disable_transcoder_func(const struct intel_crtc_state *crtc_state);
-void intel_ddi_enable_pipe_clock(const struct intel_crtc_state *crtc_state);
-void intel_ddi_disable_pipe_clock(const  struct intel_crtc_state *crtc_state);
-void intel_ddi_set_pipe_settings(const struct intel_crtc_state *crtc_state);
-void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp);
-bool intel_ddi_connector_get_hw_state(struct intel_connector *intel_connector);
-void intel_ddi_get_config(struct intel_encoder *encoder,
-			  struct intel_crtc_state *pipe_config);
-
-void intel_ddi_set_vc_payload_alloc(const struct intel_crtc_state *crtc_state,
-				    bool state);
-void intel_ddi_compute_min_voltage_level(struct drm_i915_private *dev_priv,
-					 struct intel_crtc_state *crtc_state);
-u32 bxt_signal_levels(struct intel_dp *intel_dp);
-u32 ddi_signal_levels(struct intel_dp *intel_dp);
-u8 intel_ddi_dp_voltage_max(struct intel_encoder *encoder);
-u8 intel_ddi_dp_pre_emphasis_max(struct intel_encoder *encoder,
-				 u8 voltage_swing);
-int intel_ddi_toggle_hdcp_signalling(struct intel_encoder *intel_encoder,
-				     bool enable);
-void icl_sanitize_encoder_pll_mapping(struct intel_encoder *encoder);
-int cnl_calc_wrpll_link(struct drm_i915_private *dev_priv,
-			struct intel_dpll_hw_state *state);
-
-unsigned int intel_fb_align_height(const struct drm_framebuffer *fb,
-				   int color_plane, unsigned int height);
-
 /* intel_cdclk.c */
 int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state);
 void skl_init_cdclk(struct drm_i915_private *dev_priv);
@@ -1713,6 +1677,8 @@ void intel_init_display_hooks(struct drm_i915_private *dev_priv);
 unsigned int intel_fb_xy_to_linear(int x, int y,
 				   const struct intel_plane_state *state,
 				   int plane);
+unsigned int intel_fb_align_height(const struct drm_framebuffer *fb,
+				   int color_plane, unsigned int height);
 void intel_add_fb_offsets(int *x, int *y,
 			  const struct intel_plane_state *state, int plane);
 unsigned int intel_rotation_info_size(const struct intel_rotation_info *rot_info);
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 1c76e20f9ebc..de1d420a73b9 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -41,6 +41,7 @@
 
 #include "i915_drv.h"
 #include "intel_audio.h"
+#include "intel_ddi.h"
 #include "intel_drv.h"
 
 static struct drm_device *intel_hdmi_to_dev(struct intel_hdmi *intel_hdmi)
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 05/25] drm/i915: extract intel_connector.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (3 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 04/25] drm/i915: extract intel_ddi.h " Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 06/25] drm/i915: extract intel_csr.h " Jani Nikula
                   ` (23 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/icl_dsi.c            |  1 +
 drivers/gpu/drm/i915/intel_connector.h    | 35 +++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_crt.c          |  1 +
 drivers/gpu/drm/i915/intel_ddi.c          |  1 +
 drivers/gpu/drm/i915/intel_dp.c           |  1 +
 drivers/gpu/drm/i915/intel_dp_mst.c       |  1 +
 drivers/gpu/drm/i915/intel_drv.h          | 19 ------------
 drivers/gpu/drm/i915/intel_dvo.c          |  8 ++++--
 drivers/gpu/drm/i915/intel_hdmi.c         |  1 +
 drivers/gpu/drm/i915/intel_lvds.c         |  7 +++--
 drivers/gpu/drm/i915/intel_panel.c        |  2 ++
 drivers/gpu/drm/i915/intel_sdvo.c         | 10 +++++--
 drivers/gpu/drm/i915/intel_tv.c           |  4 ++-
 drivers/gpu/drm/i915/vlv_dsi.c            |  9 ++++--
 15 files changed, 71 insertions(+), 30 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_connector.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index d9a6089f0de5..c0095a4ed26f 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -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 \
diff --git a/drivers/gpu/drm/i915/icl_dsi.c b/drivers/gpu/drm/i915/icl_dsi.c
index 64beb141c1ec..08e471898c86 100644
--- a/drivers/gpu/drm/i915/icl_dsi.c
+++ b/drivers/gpu/drm/i915/icl_dsi.c
@@ -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"
 
diff --git a/drivers/gpu/drm/i915/intel_connector.h b/drivers/gpu/drm/i915/intel_connector.h
new file mode 100644
index 000000000000..93a7375c8196
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_connector.h
@@ -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__ */
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index d649dae3cc70..b665c370111b 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -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"
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 46a6adea815a..011a6fb621ad 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -29,6 +29,7 @@
 
 #include "i915_drv.h"
 #include "intel_audio.h"
+#include "intel_connector.h"
 #include "intel_drv.h"
 #include "intel_dsi.h"
 
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index ca3ed4ae253c..466e5a6b9513 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -43,6 +43,7 @@
 
 #include "i915_drv.h"
 #include "intel_audio.h"
+#include "intel_connector.h"
 #include "intel_ddi.h"
 #include "intel_drv.h"
 
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index 62c240be8cc9..041003884860 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -29,6 +29,7 @@
 
 #include "i915_drv.h"
 #include "intel_audio.h"
+#include "intel_connector.h"
 #include "intel_ddi.h"
 #include "intel_drv.h"
 
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index b61ec71e971e..2b2aa634fd4b 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -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 *);
diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c
index a6c82482a841..58af409a6d58 100644
--- a/drivers/gpu/drm/i915/intel_dvo.c
+++ b/drivers/gpu/drm/i915/intel_dvo.c
@@ -24,14 +24,18 @@
  * 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
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index de1d420a73b9..92f4d9b65150 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -41,6 +41,7 @@
 
 #include "i915_drv.h"
 #include "intel_audio.h"
+#include "intel_connector.h"
 #include "intel_ddi.h"
 #include "intel_drv.h"
 
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 34dd2d71814b..fbc99af2158e 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -28,17 +28,20 @@
  */
 
 #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 {
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index 47cd4a338db6..5bd92cf6395c 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -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
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 68f497493d43..e148c8956cb5 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -25,16 +25,20 @@
  * 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)
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index 3924c4944e1f..14f862015070 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -33,9 +33,11 @@
 #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,
diff --git a/drivers/gpu/drm/i915/vlv_dsi.c b/drivers/gpu/drm/i915/vlv_dsi.c
index 0a950c976bbb..f523bd70914c 100644
--- a/drivers/gpu/drm/i915/vlv_dsi.c
+++ b/drivers/gpu/drm/i915/vlv_dsi.c
@@ -23,14 +23,17 @@
  * 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"
 
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 06/25] drm/i915: extract intel_csr.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (4 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 05/25] drm/i915: extract intel_connector.h " Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 07/25] drm/i915: extract intel_fbc.h " Jani Nikula
                   ` (22 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/i915_drv.c           |  1 +
 drivers/gpu/drm/i915/intel_csr.h          | 17 +++++++++++++++++
 drivers/gpu/drm/i915/intel_drv.h          |  7 -------
 drivers/gpu/drm/i915/intel_runtime_pm.c   |  1 +
 5 files changed, 20 insertions(+), 7 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_csr.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index c0095a4ed26f..e03285ccad24 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -12,6 +12,7 @@ header_test := \
 	intel_connector.h \
 	intel_context_types.h \
 	intel_crt.h \
+	intel_csr.h \
 	intel_ddi.h \
 	intel_engine_types.h \
 	intel_frontbuffer.h \
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 80166e3ee68e..6d9711a767b4 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -54,6 +54,7 @@
 #include "i915_trace.h"
 #include "i915_vgpu.h"
 #include "intel_audio.h"
+#include "intel_csr.h"
 #include "intel_drv.h"
 #include "intel_uc.h"
 #include "intel_workarounds.h"
diff --git a/drivers/gpu/drm/i915/intel_csr.h b/drivers/gpu/drm/i915/intel_csr.h
new file mode 100644
index 000000000000..ade260fc484c
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_csr.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_CSR_H__
+#define __INTEL_CSR_H__
+
+struct drm_i915_private;
+
+void intel_csr_ucode_init(struct drm_i915_private *);
+void intel_csr_load_program(struct drm_i915_private *);
+void intel_csr_ucode_fini(struct drm_i915_private *);
+void intel_csr_ucode_suspend(struct drm_i915_private *);
+void intel_csr_ucode_resume(struct drm_i915_private *);
+
+#endif /* __INTEL_CSR_H__ */
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 2b2aa634fd4b..9404dfcbfd3a 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1846,13 +1846,6 @@ unsigned int i9xx_plane_max_stride(struct intel_plane *plane,
 				   u32 pixel_format, u64 modifier,
 				   unsigned int rotation);
 
-/* intel_csr.c */
-void intel_csr_ucode_init(struct drm_i915_private *);
-void intel_csr_load_program(struct drm_i915_private *);
-void intel_csr_ucode_fini(struct drm_i915_private *);
-void intel_csr_ucode_suspend(struct drm_i915_private *);
-void intel_csr_ucode_resume(struct drm_i915_private *);
-
 /* intel_dp.c */
 struct link_config_limits {
 	int min_clock, max_clock;
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index a9931081462b..b72af95b893b 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -33,6 +33,7 @@
 
 #include "i915_drv.h"
 #include "intel_crt.h"
+#include "intel_csr.h"
 #include "intel_drv.h"
 
 /**
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 07/25] drm/i915: extract intel_fbc.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (5 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 06/25] drm/i915: extract intel_csr.h " Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:22   ` Chris Wilson
  2019-04-04 21:14 ` [PATCH 08/25] drm/i915: extract intel_psr.h " Jani Nikula
                   ` (21 subsequent siblings)
  28 siblings, 1 reply; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test  |  1 +
 drivers/gpu/drm/i915/i915_debugfs.c        |  8 +++--
 drivers/gpu/drm/i915/i915_reset.h          |  1 +
 drivers/gpu/drm/i915/i915_suspend.c        |  5 ++-
 drivers/gpu/drm/i915/intel_display.c       |  1 +
 drivers/gpu/drm/i915/intel_drv.h           | 24 -------------
 drivers/gpu/drm/i915/intel_fbc.h           | 42 ++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_fifo_underrun.c |  1 +
 drivers/gpu/drm/i915/intel_frontbuffer.c   |  3 +-
 drivers/gpu/drm/i915/intel_pm.c            |  1 +
 10 files changed, 58 insertions(+), 29 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_fbc.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index e03285ccad24..1099de6c8bda 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -15,6 +15,7 @@ header_test := \
 	intel_csr.h \
 	intel_ddi.h \
 	intel_engine_types.h \
+	intel_fbc.h \
 	intel_frontbuffer.h \
 	intel_workarounds_types.h
 
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index a14a7bccffc1..bdb5daa59de5 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -26,14 +26,16 @@
  *
  */
 
-#include <linux/sort.h>
 #include <linux/sched/mm.h>
+#include <linux/sort.h>
+
 #include <drm/drm_debugfs.h>
 #include <drm/drm_fourcc.h>
-#include "intel_drv.h"
-#include "intel_guc_submission.h"
 
 #include "i915_reset.h"
+#include "intel_drv.h"
+#include "intel_fbc.h"
+#include "intel_guc_submission.h"
 
 static inline struct drm_i915_private *node_to_i915(struct drm_info_node *node)
 {
diff --git a/drivers/gpu/drm/i915/i915_reset.h b/drivers/gpu/drm/i915/i915_reset.h
index 86b1ac8116ce..3c0450289b8f 100644
--- a/drivers/gpu/drm/i915/i915_reset.h
+++ b/drivers/gpu/drm/i915/i915_reset.h
@@ -14,6 +14,7 @@
 #include "intel_engine_types.h"
 
 struct drm_i915_private;
+struct i915_request;
 struct intel_engine_cs;
 struct intel_guc;
 
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index d2f2a9c2fabd..eec48d856adb 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -24,9 +24,12 @@
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
+
 #include <drm/i915_drm.h>
-#include "intel_drv.h"
+
 #include "i915_reg.h"
+#include "intel_drv.h"
+#include "intel_fbc.h"
 
 static void i915_save_display(struct drm_i915_private *dev_priv)
 {
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index cae807341553..08c9205a4e8a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -52,6 +52,7 @@
 #include "intel_ddi.h"
 #include "intel_drv.h"
 #include "intel_dsi.h"
+#include "intel_fbc.h"
 #include "intel_frontbuffer.h"
 
 /* Primary plane formats for gen <= 3 */
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 9404dfcbfd3a..cc0d179b6c43 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -2012,30 +2012,6 @@ static inline void intel_fbdev_restore_mode(struct drm_device *dev)
 }
 #endif
 
-/* intel_fbc.c */
-void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
-			   struct intel_atomic_state *state);
-bool intel_fbc_is_active(struct drm_i915_private *dev_priv);
-void intel_fbc_pre_update(struct intel_crtc *crtc,
-			  struct intel_crtc_state *crtc_state,
-			  struct intel_plane_state *plane_state);
-void intel_fbc_post_update(struct intel_crtc *crtc);
-void intel_fbc_init(struct drm_i915_private *dev_priv);
-void intel_fbc_init_pipe_state(struct drm_i915_private *dev_priv);
-void intel_fbc_enable(struct intel_crtc *crtc,
-		      struct intel_crtc_state *crtc_state,
-		      struct intel_plane_state *plane_state);
-void intel_fbc_disable(struct intel_crtc *crtc);
-void intel_fbc_global_disable(struct drm_i915_private *dev_priv);
-void intel_fbc_invalidate(struct drm_i915_private *dev_priv,
-			  unsigned int frontbuffer_bits,
-			  enum fb_op_origin origin);
-void intel_fbc_flush(struct drm_i915_private *dev_priv,
-		     unsigned int frontbuffer_bits, enum fb_op_origin origin);
-void intel_fbc_cleanup_cfb(struct drm_i915_private *dev_priv);
-void intel_fbc_handle_fifo_underrun_irq(struct drm_i915_private *dev_priv);
-int intel_fbc_reset_underrun(struct drm_i915_private *dev_priv);
-
 /* intel_hdmi.c */
 void intel_hdmi_init(struct drm_i915_private *dev_priv, i915_reg_t hdmi_reg,
 		     enum port port);
diff --git a/drivers/gpu/drm/i915/intel_fbc.h b/drivers/gpu/drm/i915/intel_fbc.h
new file mode 100644
index 000000000000..50272eda8d43
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_fbc.h
@@ -0,0 +1,42 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_FBC_H__
+#define __INTEL_FBC_H__
+
+#include <linux/types.h>
+
+#include "intel_frontbuffer.h"
+
+struct drm_i915_private;
+struct intel_atomic_state;
+struct intel_crtc;
+struct intel_crtc_state;
+struct intel_plane_state;
+
+void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
+			   struct intel_atomic_state *state);
+bool intel_fbc_is_active(struct drm_i915_private *dev_priv);
+void intel_fbc_pre_update(struct intel_crtc *crtc,
+			  struct intel_crtc_state *crtc_state,
+			  struct intel_plane_state *plane_state);
+void intel_fbc_post_update(struct intel_crtc *crtc);
+void intel_fbc_init(struct drm_i915_private *dev_priv);
+void intel_fbc_init_pipe_state(struct drm_i915_private *dev_priv);
+void intel_fbc_enable(struct intel_crtc *crtc,
+		      struct intel_crtc_state *crtc_state,
+		      struct intel_plane_state *plane_state);
+void intel_fbc_disable(struct intel_crtc *crtc);
+void intel_fbc_global_disable(struct drm_i915_private *dev_priv);
+void intel_fbc_invalidate(struct drm_i915_private *dev_priv,
+			  unsigned int frontbuffer_bits,
+			  enum fb_op_origin origin);
+void intel_fbc_flush(struct drm_i915_private *dev_priv,
+		     unsigned int frontbuffer_bits, enum fb_op_origin origin);
+void intel_fbc_cleanup_cfb(struct drm_i915_private *dev_priv);
+void intel_fbc_handle_fifo_underrun_irq(struct drm_i915_private *dev_priv);
+int intel_fbc_reset_underrun(struct drm_i915_private *dev_priv);
+
+#endif /* __INTEL_FBC_H__ */
diff --git a/drivers/gpu/drm/i915/intel_fifo_underrun.c b/drivers/gpu/drm/i915/intel_fifo_underrun.c
index f33de4be4b89..74c8b0528294 100644
--- a/drivers/gpu/drm/i915/intel_fifo_underrun.c
+++ b/drivers/gpu/drm/i915/intel_fifo_underrun.c
@@ -27,6 +27,7 @@
 
 #include "i915_drv.h"
 #include "intel_drv.h"
+#include "intel_fbc.h"
 
 /**
  * DOC: fifo underrun handling
diff --git a/drivers/gpu/drm/i915/intel_frontbuffer.c b/drivers/gpu/drm/i915/intel_frontbuffer.c
index 16f253deaf8d..1d19da2ffee8 100644
--- a/drivers/gpu/drm/i915/intel_frontbuffer.c
+++ b/drivers/gpu/drm/i915/intel_frontbuffer.c
@@ -61,9 +61,10 @@
  */
 
 
+#include "i915_drv.h"
 #include "intel_drv.h"
+#include "intel_fbc.h"
 #include "intel_frontbuffer.h"
-#include "i915_drv.h"
 
 void __intel_fb_obj_invalidate(struct drm_i915_gem_object *obj,
 			       enum fb_op_origin origin,
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 0e05ee1f3ea0..b3c4f640117f 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -35,6 +35,7 @@
 
 #include "i915_drv.h"
 #include "intel_drv.h"
+#include "intel_fbc.h"
 #include "../../../platform/x86/intel_ips.h"
 
 /**
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 08/25] drm/i915: extract intel_psr.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (6 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 07/25] drm/i915: extract intel_fbc.h " Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 09/25] drm/i915: extract intel_color.h " Jani Nikula
                   ` (20 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/i915_debugfs.c       |  1 +
 drivers/gpu/drm/i915/i915_irq.c           | 11 ++++---
 drivers/gpu/drm/i915/intel_ddi.c          |  1 +
 drivers/gpu/drm/i915/intel_display.c      |  1 +
 drivers/gpu/drm/i915/intel_dp.c           |  1 +
 drivers/gpu/drm/i915/intel_drv.h          | 26 ---------------
 drivers/gpu/drm/i915/intel_fbc.c          |  3 +-
 drivers/gpu/drm/i915/intel_frontbuffer.c  |  1 +
 drivers/gpu/drm/i915/intel_psr.c          | 11 ++++---
 drivers/gpu/drm/i915/intel_psr.h          | 40 +++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_sprite.c       | 13 +++++---
 12 files changed, 69 insertions(+), 41 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_psr.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index 1099de6c8bda..6da5c6722bee 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -17,6 +17,7 @@ header_test := \
 	intel_engine_types.h \
 	intel_fbc.h \
 	intel_frontbuffer.h \
+	intel_psr.h \
 	intel_workarounds_types.h
 
 quiet_cmd_header_test = HDRTEST $@
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index bdb5daa59de5..1c3e19b9583e 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -36,6 +36,7 @@
 #include "intel_drv.h"
 #include "intel_fbc.h"
 #include "intel_guc_submission.h"
+#include "intel_psr.h"
 
 static inline struct drm_i915_private *node_to_i915(struct drm_info_node *node)
 {
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index aa107a78cb36..6454ddc37f8b 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -28,16 +28,19 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
-#include <linux/sysrq.h>
-#include <linux/slab.h>
-#include <linux/cpuidle.h>
 #include <linux/circ_buf.h>
-#include <drm/drm_irq.h>
+#include <linux/cpuidle.h>
+#include <linux/slab.h>
+#include <linux/sysrq.h>
+
 #include <drm/drm_drv.h>
+#include <drm/drm_irq.h>
 #include <drm/i915_drm.h>
+
 #include "i915_drv.h"
 #include "i915_trace.h"
 #include "intel_drv.h"
+#include "intel_psr.h"
 
 /**
  * DOC: interrupt handling
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 011a6fb621ad..625a12b02502 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -32,6 +32,7 @@
 #include "intel_connector.h"
 #include "intel_drv.h"
 #include "intel_dsi.h"
+#include "intel_psr.h"
 
 struct ddi_buf_trans {
 	u32 trans1;	/* balance leg enable, de-emph level */
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 08c9205a4e8a..8812b2776b28 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -54,6 +54,7 @@
 #include "intel_dsi.h"
 #include "intel_fbc.h"
 #include "intel_frontbuffer.h"
+#include "intel_psr.h"
 
 /* Primary plane formats for gen <= 3 */
 static const u32 i8xx_primary_formats[] = {
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 466e5a6b9513..00efbb59c422 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -46,6 +46,7 @@
 #include "intel_connector.h"
 #include "intel_ddi.h"
 #include "intel_drv.h"
+#include "intel_psr.h"
 
 #define DP_DPRX_ESI_LEN 14
 
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index cc0d179b6c43..3829d96d0233 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -2114,32 +2114,6 @@ 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_psr.c */
-#define CAN_PSR(dev_priv) (HAS_PSR(dev_priv) && dev_priv->psr.sink_support)
-void intel_psr_init_dpcd(struct intel_dp *intel_dp);
-void intel_psr_enable(struct intel_dp *intel_dp,
-		      const struct intel_crtc_state *crtc_state);
-void intel_psr_disable(struct intel_dp *intel_dp,
-		      const struct intel_crtc_state *old_crtc_state);
-void intel_psr_update(struct intel_dp *intel_dp,
-		      const struct intel_crtc_state *crtc_state);
-int intel_psr_debug_set(struct drm_i915_private *dev_priv, u64 value);
-void intel_psr_invalidate(struct drm_i915_private *dev_priv,
-			  unsigned frontbuffer_bits,
-			  enum fb_op_origin origin);
-void intel_psr_flush(struct drm_i915_private *dev_priv,
-		     unsigned frontbuffer_bits,
-		     enum fb_op_origin origin);
-void intel_psr_init(struct drm_i915_private *dev_priv);
-void intel_psr_compute_config(struct intel_dp *intel_dp,
-			      struct intel_crtc_state *crtc_state);
-void intel_psr_irq_control(struct drm_i915_private *dev_priv, u32 debug);
-void intel_psr_irq_handler(struct drm_i915_private *dev_priv, u32 psr_iir);
-void intel_psr_short_pulse(struct intel_dp *intel_dp);
-int intel_psr_wait_for_idle(const struct intel_crtc_state *new_crtc_state,
-			    u32 *out_value);
-bool intel_psr_enabled(struct intel_dp *intel_dp);
-
 /* intel_quirks.c */
 void intel_init_quirks(struct drm_i915_private *dev_priv);
 
diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
index 43fe08be3b7d..9372a5c4d077 100644
--- a/drivers/gpu/drm/i915/intel_fbc.c
+++ b/drivers/gpu/drm/i915/intel_fbc.c
@@ -40,8 +40,9 @@
 
 #include <drm/drm_fourcc.h>
 
-#include "intel_drv.h"
 #include "i915_drv.h"
+#include "intel_drv.h"
+#include "intel_frontbuffer.h"
 
 static inline bool fbc_supported(struct drm_i915_private *dev_priv)
 {
diff --git a/drivers/gpu/drm/i915/intel_frontbuffer.c b/drivers/gpu/drm/i915/intel_frontbuffer.c
index 1d19da2ffee8..a42f859ad22e 100644
--- a/drivers/gpu/drm/i915/intel_frontbuffer.c
+++ b/drivers/gpu/drm/i915/intel_frontbuffer.c
@@ -65,6 +65,7 @@
 #include "intel_drv.h"
 #include "intel_fbc.h"
 #include "intel_frontbuffer.h"
+#include "intel_psr.h"
 
 void __intel_fb_obj_invalidate(struct drm_i915_gem_object *obj,
 			       enum fb_op_origin origin,
diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
index ec874d802d48..6592aa48c8ef 100644
--- a/drivers/gpu/drm/i915/intel_psr.c
+++ b/drivers/gpu/drm/i915/intel_psr.c
@@ -21,6 +21,12 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
+#include <drm/drm_atomic_helper.h>
+
+#include "i915_drv.h"
+#include "intel_drv.h"
+#include "intel_psr.h"
+
 /**
  * DOC: Panel Self Refresh (PSR/SRD)
  *
@@ -51,11 +57,6 @@
  * must be correctly synchronized/cancelled when shutting down the pipe."
  */
 
-#include <drm/drm_atomic_helper.h>
-
-#include "intel_drv.h"
-#include "i915_drv.h"
-
 static bool psr_global_enabled(u32 debug)
 {
 	switch (debug & I915_PSR_DEBUG_MODE_MASK) {
diff --git a/drivers/gpu/drm/i915/intel_psr.h b/drivers/gpu/drm/i915/intel_psr.h
new file mode 100644
index 000000000000..9a373c54c3ec
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_psr.h
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_PSR_H__
+#define __INTEL_PSR_H__
+
+#include "intel_frontbuffer.h"
+
+struct drm_i915_private;
+struct intel_crtc_state;
+struct intel_dp;
+
+#define CAN_PSR(dev_priv) (HAS_PSR(dev_priv) && dev_priv->psr.sink_support)
+void intel_psr_init_dpcd(struct intel_dp *intel_dp);
+void intel_psr_enable(struct intel_dp *intel_dp,
+		      const struct intel_crtc_state *crtc_state);
+void intel_psr_disable(struct intel_dp *intel_dp,
+		      const struct intel_crtc_state *old_crtc_state);
+void intel_psr_update(struct intel_dp *intel_dp,
+		      const struct intel_crtc_state *crtc_state);
+int intel_psr_debug_set(struct drm_i915_private *dev_priv, u64 value);
+void intel_psr_invalidate(struct drm_i915_private *dev_priv,
+			  unsigned frontbuffer_bits,
+			  enum fb_op_origin origin);
+void intel_psr_flush(struct drm_i915_private *dev_priv,
+		     unsigned frontbuffer_bits,
+		     enum fb_op_origin origin);
+void intel_psr_init(struct drm_i915_private *dev_priv);
+void intel_psr_compute_config(struct intel_dp *intel_dp,
+			      struct intel_crtc_state *crtc_state);
+void intel_psr_irq_control(struct drm_i915_private *dev_priv, u32 debug);
+void intel_psr_irq_handler(struct drm_i915_private *dev_priv, u32 psr_iir);
+void intel_psr_short_pulse(struct intel_dp *intel_dp);
+int intel_psr_wait_for_idle(const struct intel_crtc_state *new_crtc_state,
+			    u32 *out_value);
+bool intel_psr_enabled(struct intel_dp *intel_dp);
+
+#endif /* __INTEL_PSR_H__ */
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 65de7387bf1b..d02da53e9806 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -29,17 +29,20 @@
  * registers; newer ones are much simpler and we can use the new DRM plane
  * support.
  */
+
+#include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
+#include <drm/drm_color_mgmt.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_fourcc.h>
-#include <drm/drm_rect.h>
-#include <drm/drm_atomic.h>
 #include <drm/drm_plane_helper.h>
-#include "intel_drv.h"
-#include "intel_frontbuffer.h"
+#include <drm/drm_rect.h>
 #include <drm/i915_drm.h>
+
 #include "i915_drv.h"
-#include <drm/drm_color_mgmt.h>
+#include "intel_drv.h"
+#include "intel_frontbuffer.h"
+#include "intel_psr.h"
 
 bool is_planar_yuv_format(u32 pixelformat)
 {
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 09/25] drm/i915: extract intel_color.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (7 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 08/25] drm/i915: extract intel_psr.h " Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 10/25] drm/i915: extract intel_lspcon.h " Jani Nikula
                   ` (19 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/intel_color.h        | 17 +++++++++++++++++
 drivers/gpu/drm/i915/intel_display.c      |  1 +
 drivers/gpu/drm/i915/intel_drv.h          |  6 ------
 4 files changed, 19 insertions(+), 6 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_color.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index 6da5c6722bee..cf6e6fce7b2c 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -9,6 +9,7 @@ header_test := \
 	i915_scheduler_types.h \
 	i915_timeline_types.h \
 	intel_audio.h \
+	intel_color.h \
 	intel_connector.h \
 	intel_context_types.h \
 	intel_crt.h \
diff --git a/drivers/gpu/drm/i915/intel_color.h b/drivers/gpu/drm/i915/intel_color.h
new file mode 100644
index 000000000000..b8a3ce609587
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_color.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_COLOR_H__
+#define __INTEL_COLOR_H__
+
+struct intel_crtc_state;
+struct intel_crtc;
+
+void intel_color_init(struct intel_crtc *crtc);
+int intel_color_check(struct intel_crtc_state *crtc_state);
+void intel_color_commit(const struct intel_crtc_state *crtc_state);
+void intel_color_load_luts(const struct intel_crtc_state *crtc_state);
+
+#endif /* __INTEL_COLOR_H__ */
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 8812b2776b28..ed41f313e63f 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -48,6 +48,7 @@
 #include "i915_gem_clflush.h"
 #include "i915_reset.h"
 #include "i915_trace.h"
+#include "intel_color.h"
 #include "intel_crt.h"
 #include "intel_ddi.h"
 #include "intel_drv.h"
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 3829d96d0233..9fd356c614ae 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -2419,12 +2419,6 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_
 					const struct intel_plane_state *old_plane_state,
 					struct intel_plane_state *intel_state);
 
-/* intel_color.c */
-void intel_color_init(struct intel_crtc *crtc);
-int intel_color_check(struct intel_crtc_state *crtc_state);
-void intel_color_commit(const struct intel_crtc_state *crtc_state);
-void intel_color_load_luts(const struct intel_crtc_state *crtc_state);
-
 /* intel_lspcon.c */
 bool lspcon_init(struct intel_digital_port *intel_dig_port);
 void lspcon_resume(struct intel_lspcon *lspcon);
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 10/25] drm/i915: extract intel_lspcon.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (8 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 09/25] drm/i915: extract intel_color.h " Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 11/25] drm/i915: extract intel_sdvo.h " Jani Nikula
                   ` (18 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/intel_ddi.c          |  1 +
 drivers/gpu/drm/i915/intel_dp.c           |  1 +
 drivers/gpu/drm/i915/intel_drv.h          | 21 -------------
 drivers/gpu/drm/i915/intel_hdmi.c         |  1 +
 drivers/gpu/drm/i915/intel_lspcon.h       | 38 +++++++++++++++++++++++
 6 files changed, 42 insertions(+), 21 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_lspcon.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index cf6e6fce7b2c..589e5b513838 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -18,6 +18,7 @@ header_test := \
 	intel_engine_types.h \
 	intel_fbc.h \
 	intel_frontbuffer.h \
+	intel_lspcon.h \
 	intel_psr.h \
 	intel_workarounds_types.h
 
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 625a12b02502..9da006f4ce35 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -32,6 +32,7 @@
 #include "intel_connector.h"
 #include "intel_drv.h"
 #include "intel_dsi.h"
+#include "intel_lspcon.h"
 #include "intel_psr.h"
 
 struct ddi_buf_trans {
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 00efbb59c422..2f50a4d81fcd 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -46,6 +46,7 @@
 #include "intel_connector.h"
 #include "intel_ddi.h"
 #include "intel_drv.h"
+#include "intel_lspcon.h"
 #include "intel_psr.h"
 
 #define DP_DPRX_ESI_LEN 14
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 9fd356c614ae..5c1326c81cdb 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -2419,27 +2419,6 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_
 					const struct intel_plane_state *old_plane_state,
 					struct intel_plane_state *intel_state);
 
-/* intel_lspcon.c */
-bool lspcon_init(struct intel_digital_port *intel_dig_port);
-void lspcon_resume(struct intel_lspcon *lspcon);
-void lspcon_wait_pcon_mode(struct intel_lspcon *lspcon);
-void lspcon_write_infoframe(struct intel_encoder *encoder,
-			    const struct intel_crtc_state *crtc_state,
-			    unsigned int type,
-			    const void *buf, ssize_t len);
-void lspcon_read_infoframe(struct intel_encoder *encoder,
-			   const struct intel_crtc_state *crtc_state,
-			   unsigned int type,
-			   void *frame, ssize_t len);
-void lspcon_set_infoframes(struct intel_encoder *encoder,
-			   bool enable,
-			   const struct intel_crtc_state *crtc_state,
-			   const struct drm_connector_state *conn_state);
-u32 lspcon_infoframes_enabled(struct intel_encoder *encoder,
-			      const struct intel_crtc_state *pipe_config);
-void lspcon_ycbcr420_config(struct drm_connector *connector,
-			    struct intel_crtc_state *crtc_state);
-
 /* intel_pipe_crc.c */
 #ifdef CONFIG_DEBUG_FS
 int intel_crtc_set_crc_source(struct drm_crtc *crtc, const char *source_name);
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 92f4d9b65150..012ae7b1bda5 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -44,6 +44,7 @@
 #include "intel_connector.h"
 #include "intel_ddi.h"
 #include "intel_drv.h"
+#include "intel_lspcon.h"
 
 static struct drm_device *intel_hdmi_to_dev(struct intel_hdmi *intel_hdmi)
 {
diff --git a/drivers/gpu/drm/i915/intel_lspcon.h b/drivers/gpu/drm/i915/intel_lspcon.h
new file mode 100644
index 000000000000..37cfddf8a9c5
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_lspcon.h
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_LSPCON_H__
+#define __INTEL_LSPCON_H__
+
+#include <linux/types.h>
+
+struct drm_connector;
+struct drm_connector_state;
+struct intel_crtc_state;
+struct intel_digital_port;
+struct intel_encoder;
+struct intel_lspcon;
+
+bool lspcon_init(struct intel_digital_port *intel_dig_port);
+void lspcon_resume(struct intel_lspcon *lspcon);
+void lspcon_wait_pcon_mode(struct intel_lspcon *lspcon);
+void lspcon_write_infoframe(struct intel_encoder *encoder,
+			    const struct intel_crtc_state *crtc_state,
+			    unsigned int type,
+			    const void *buf, ssize_t len);
+void lspcon_read_infoframe(struct intel_encoder *encoder,
+			   const struct intel_crtc_state *crtc_state,
+			   unsigned int type,
+			   void *frame, ssize_t len);
+void lspcon_set_infoframes(struct intel_encoder *encoder,
+			   bool enable,
+			   const struct intel_crtc_state *crtc_state,
+			   const struct drm_connector_state *conn_state);
+u32 lspcon_infoframes_enabled(struct intel_encoder *encoder,
+			      const struct intel_crtc_state *pipe_config);
+void lspcon_ycbcr420_config(struct drm_connector *connector,
+			    struct intel_crtc_state *crtc_state);
+
+#endif /* __INTEL_LSPCON_H__ */
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 11/25] drm/i915: extract intel_sdvo.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (9 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 10/25] drm/i915: extract intel_lspcon.h " Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 12/25] drm/i915: extract intel_hdcp.h " Jani Nikula
                   ` (17 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/intel_display.c      |  1 +
 drivers/gpu/drm/i915/intel_drv.h          |  7 -------
 drivers/gpu/drm/i915/intel_hdmi.c         |  1 +
 drivers/gpu/drm/i915/intel_sdvo.h         | 23 +++++++++++++++++++++++
 5 files changed, 26 insertions(+), 7 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_sdvo.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index 589e5b513838..f1f62794b457 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -20,6 +20,7 @@ header_test := \
 	intel_frontbuffer.h \
 	intel_lspcon.h \
 	intel_psr.h \
+	intel_sdvo.h \
 	intel_workarounds_types.h
 
 quiet_cmd_header_test = HDRTEST $@
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index ed41f313e63f..6d2a385d149e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -56,6 +56,7 @@
 #include "intel_fbc.h"
 #include "intel_frontbuffer.h"
 #include "intel_psr.h"
+#include "intel_sdvo.h"
 
 /* Primary plane formats for gen <= 3 */
 static const u32 i8xx_primary_formats[] = {
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 5c1326c81cdb..681f232fd305 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -2314,13 +2314,6 @@ int skl_check_pipe_max_pixel_rate(struct intel_crtc *intel_crtc,
 void intel_init_ipc(struct drm_i915_private *dev_priv);
 void intel_enable_ipc(struct drm_i915_private *dev_priv);
 
-/* intel_sdvo.c */
-bool intel_sdvo_port_enabled(struct drm_i915_private *dev_priv,
-			     i915_reg_t sdvo_reg, enum pipe *pipe);
-bool intel_sdvo_init(struct drm_i915_private *dev_priv,
-		     i915_reg_t reg, enum port port);
-
-
 /* intel_sprite.c */
 bool is_planar_yuv_format(u32 pixelformat);
 int intel_usecs_to_scanlines(const struct drm_display_mode *adjusted_mode,
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 012ae7b1bda5..03dcf5f7d69f 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -45,6 +45,7 @@
 #include "intel_ddi.h"
 #include "intel_drv.h"
 #include "intel_lspcon.h"
+#include "intel_sdvo.h"
 
 static struct drm_device *intel_hdmi_to_dev(struct intel_hdmi *intel_hdmi)
 {
diff --git a/drivers/gpu/drm/i915/intel_sdvo.h b/drivers/gpu/drm/i915/intel_sdvo.h
new file mode 100644
index 000000000000..c9e05bcdd141
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_sdvo.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_SDVO_H__
+#define __INTEL_SDVO_H__
+
+#include <linux/types.h>
+
+#include <drm/i915_drm.h>
+
+#include "i915_reg.h"
+
+struct drm_i915_private;
+enum pipe;
+
+bool intel_sdvo_port_enabled(struct drm_i915_private *dev_priv,
+			     i915_reg_t sdvo_reg, enum pipe *pipe);
+bool intel_sdvo_init(struct drm_i915_private *dev_priv,
+		     i915_reg_t reg, enum port port);
+
+#endif /* __INTEL_SDVO_H__ */
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 12/25] drm/i915: extract intel_hdcp.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (10 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 11/25] drm/i915: extract intel_sdvo.h " Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 13/25] drm/i915: extract intel_panel.h " Jani Nikula
                   ` (16 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/i915_debugfs.c       |  1 +
 drivers/gpu/drm/i915/intel_atomic.c       |  1 +
 drivers/gpu/drm/i915/intel_connector.c    |  7 +++--
 drivers/gpu/drm/i915/intel_ddi.c          |  1 +
 drivers/gpu/drm/i915/intel_display.c      |  1 +
 drivers/gpu/drm/i915/intel_dp.c           |  1 +
 drivers/gpu/drm/i915/intel_drv.h          | 15 -----------
 drivers/gpu/drm/i915/intel_hdcp.h         | 33 +++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_hdmi.c         |  1 +
 10 files changed, 45 insertions(+), 17 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_hdcp.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index f1f62794b457..a4846d7eaf46 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -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 \
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 1c3e19b9583e..ebe85144ae9c 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -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)
diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
index b844e8840c6f..2cbcf6ac24d8 100644
--- a/drivers/gpu/drm/i915/intel_atomic.c
+++ b/drivers/gpu/drm/i915/intel_atomic.c
@@ -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.
diff --git a/drivers/gpu/drm/i915/intel_connector.c b/drivers/gpu/drm/i915/intel_connector.c
index 848dd9e728d8..27031040f090 100644
--- a/drivers/gpu/drm/i915/intel_connector.c
+++ b/drivers/gpu/drm/i915/intel_connector.c
@@ -23,12 +23,15 @@
  * 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_drv.h"
+#include "intel_hdcp.h"
 
 int intel_connector_init(struct intel_connector *connector)
 {
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 9da006f4ce35..c7c8f7b1a0b8 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -32,6 +32,7 @@
 #include "intel_connector.h"
 #include "intel_drv.h"
 #include "intel_dsi.h"
+#include "intel_hdcp.h"
 #include "intel_lspcon.h"
 #include "intel_psr.h"
 
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 6d2a385d149e..e725597ce730 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -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"
 
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 2f50a4d81fcd..efc411964bcc 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -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"
 
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 681f232fd305..e04a622a71ed 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -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);
 
diff --git a/drivers/gpu/drm/i915/intel_hdcp.h b/drivers/gpu/drm/i915/intel_hdcp.h
new file mode 100644
index 000000000000..a75f25f09d39
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_hdcp.h
@@ -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__ */
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 03dcf5f7d69f..18fef71fc4f8 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -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"
 
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 13/25] drm/i915: extract intel_panel.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (11 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 12/25] drm/i915: extract intel_hdcp.h " Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 14/25] drm/i915: extract intel_pm.h " Jani Nikula
                   ` (15 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/icl_dsi.c            |  1 +
 drivers/gpu/drm/i915/intel_connector.c    |  1 +
 drivers/gpu/drm/i915/intel_ddi.c          |  1 +
 drivers/gpu/drm/i915/intel_dp.c           |  1 +
 drivers/gpu/drm/i915/intel_drv.h          | 45 ----------------
 drivers/gpu/drm/i915/intel_dvo.c          |  1 +
 drivers/gpu/drm/i915/intel_hdmi.c         |  1 +
 drivers/gpu/drm/i915/intel_lvds.c         |  1 +
 drivers/gpu/drm/i915/intel_opregion.c     |  3 +-
 drivers/gpu/drm/i915/intel_panel.h        | 65 +++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_sdvo.c         |  1 +
 drivers/gpu/drm/i915/vlv_dsi.c            |  1 +
 13 files changed, 77 insertions(+), 46 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_panel.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index a4846d7eaf46..d3a8fc37d6b5 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -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
diff --git a/drivers/gpu/drm/i915/icl_dsi.c b/drivers/gpu/drm/i915/icl_dsi.c
index 08e471898c86..527aafc16e62 100644
--- a/drivers/gpu/drm/i915/icl_dsi.c
+++ b/drivers/gpu/drm/i915/icl_dsi.c
@@ -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)
diff --git a/drivers/gpu/drm/i915/intel_connector.c b/drivers/gpu/drm/i915/intel_connector.c
index 27031040f090..40b3d6379ac9 100644
--- a/drivers/gpu/drm/i915/intel_connector.c
+++ b/drivers/gpu/drm/i915/intel_connector.c
@@ -32,6 +32,7 @@
 #include "i915_drv.h"
 #include "intel_drv.h"
 #include "intel_hdcp.h"
+#include "intel_panel.h"
 
 int intel_connector_init(struct intel_connector *connector)
 {
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index c7c8f7b1a0b8..887903d89cd8 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -34,6 +34,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 {
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index efc411964bcc..02d662ff5df9 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -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
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index e04a622a71ed..8e23827a03d9 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -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);
 
diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c
index 58af409a6d58..4fda625ea2c1 100644
--- a/drivers/gpu/drm/i915/intel_dvo.c
+++ b/drivers/gpu/drm/i915/intel_dvo.c
@@ -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
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 18fef71fc4f8..5725fedaceec 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -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)
 {
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index fbc99af2158e..3788d2fe4a9e 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -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 {
diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c
index 5437effcb396..dec22bbbeff5 100644
--- a/drivers/gpu/drm/i915/intel_opregion.c
+++ b/drivers/gpu/drm/i915/intel_opregion.c
@@ -32,9 +32,10 @@
 
 #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
diff --git a/drivers/gpu/drm/i915/intel_panel.h b/drivers/gpu/drm/i915/intel_panel.h
new file mode 100644
index 000000000000..cedeea443336
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_panel.h
@@ -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__ */
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index e148c8956cb5..9a4c54dd2e5c 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -39,6 +39,7 @@
 #include "i915_drv.h"
 #include "intel_connector.h"
 #include "intel_drv.h"
+#include "intel_panel.h"
 #include "intel_sdvo_regs.h"
 
 #define SDVO_TMDS_MASK (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)
diff --git a/drivers/gpu/drm/i915/vlv_dsi.c b/drivers/gpu/drm/i915/vlv_dsi.c
index f523bd70914c..c765cd50f0f6 100644
--- a/drivers/gpu/drm/i915/vlv_dsi.c
+++ b/drivers/gpu/drm/i915/vlv_dsi.c
@@ -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,
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 14/25] drm/i915: extract intel_pm.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (12 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 13/25] drm/i915: extract intel_panel.h " Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 15/25] drm/i915: extract intel_fbdev.h " Jani Nikula
                   ` (14 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/i915_debugfs.c       |  1 +
 drivers/gpu/drm/i915/i915_drv.c           |  1 +
 drivers/gpu/drm/i915/i915_gem.c           |  1 +
 drivers/gpu/drm/i915/i915_request.c       |  3 +-
 drivers/gpu/drm/i915/intel_atomic_plane.c |  1 +
 drivers/gpu/drm/i915/intel_display.c      |  1 +
 drivers/gpu/drm/i915/intel_drv.h          | 51 ----------------
 drivers/gpu/drm/i915/intel_pm.c           |  3 +-
 drivers/gpu/drm/i915/intel_pm.h           | 72 +++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_sprite.c       |  1 +
 drivers/gpu/drm/i915/intel_uncore.c       |  9 +--
 12 files changed, 88 insertions(+), 57 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_pm.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index d3a8fc37d6b5..ab7ac0ac17a1 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -21,6 +21,7 @@ header_test := \
 	intel_hdcp.h \
 	intel_lspcon.h \
 	intel_panel.h \
+	intel_pm.h \
 	intel_psr.h \
 	intel_sdvo.h \
 	intel_workarounds_types.h
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index ebe85144ae9c..7c54c994de50 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -37,6 +37,7 @@
 #include "intel_fbc.h"
 #include "intel_guc_submission.h"
 #include "intel_hdcp.h"
+#include "intel_pm.h"
 #include "intel_psr.h"
 
 static inline struct drm_i915_private *node_to_i915(struct drm_info_node *node)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 6d9711a767b4..85dac2f23197 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -56,6 +56,7 @@
 #include "intel_audio.h"
 #include "intel_csr.h"
 #include "intel_drv.h"
+#include "intel_pm.h"
 #include "intel_uc.h"
 #include "intel_workarounds.h"
 
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index f25a1ba24927..bf3d12f94365 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -50,6 +50,7 @@
 #include "intel_drv.h"
 #include "intel_frontbuffer.h"
 #include "intel_mocs.h"
+#include "intel_pm.h"
 #include "intel_workarounds.h"
 
 static void i915_gem_flush_free_objects(struct drm_i915_private *i915);
diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index 82094b9f5ba7..91eec5075bc9 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -29,10 +29,11 @@
 #include <linux/sched/clock.h>
 #include <linux/sched/signal.h>
 
-#include "i915_drv.h"
 #include "i915_active.h"
+#include "i915_drv.h"
 #include "i915_globals.h"
 #include "i915_reset.h"
+#include "intel_pm.h"
 
 struct execute_cb {
 	struct list_head link;
diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
index 9d32a6fcf840..42821f8e6031 100644
--- a/drivers/gpu/drm/i915/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
@@ -36,6 +36,7 @@
 #include <drm/drm_plane_helper.h>
 
 #include "intel_drv.h"
+#include "intel_pm.h"
 
 struct intel_plane *intel_plane_alloc(void)
 {
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e725597ce730..f81a5c50120e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -56,6 +56,7 @@
 #include "intel_fbc.h"
 #include "intel_frontbuffer.h"
 #include "intel_hdcp.h"
+#include "intel_pm.h"
 #include "intel_psr.h"
 #include "intel_sdvo.h"
 
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 8e23827a03d9..173f88935169 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -2203,57 +2203,6 @@ void chv_phy_powergate_lanes(struct intel_encoder *encoder,
 bool chv_phy_powergate_ch(struct drm_i915_private *dev_priv, enum dpio_phy phy,
 			  enum dpio_channel ch, bool override);
 
-
-/* intel_pm.c */
-void intel_init_clock_gating(struct drm_i915_private *dev_priv);
-void intel_suspend_hw(struct drm_i915_private *dev_priv);
-int ilk_wm_max_level(const struct drm_i915_private *dev_priv);
-void intel_update_watermarks(struct intel_crtc *crtc);
-void intel_init_pm(struct drm_i915_private *dev_priv);
-void intel_init_clock_gating_hooks(struct drm_i915_private *dev_priv);
-void intel_pm_setup(struct drm_i915_private *dev_priv);
-void intel_gpu_ips_init(struct drm_i915_private *dev_priv);
-void intel_gpu_ips_teardown(void);
-void intel_init_gt_powersave(struct drm_i915_private *dev_priv);
-void intel_cleanup_gt_powersave(struct drm_i915_private *dev_priv);
-void intel_sanitize_gt_powersave(struct drm_i915_private *dev_priv);
-void intel_enable_gt_powersave(struct drm_i915_private *dev_priv);
-void intel_disable_gt_powersave(struct drm_i915_private *dev_priv);
-void gen6_rps_busy(struct drm_i915_private *dev_priv);
-void gen6_rps_reset_ei(struct drm_i915_private *dev_priv);
-void gen6_rps_idle(struct drm_i915_private *dev_priv);
-void gen6_rps_boost(struct i915_request *rq);
-void g4x_wm_get_hw_state(struct drm_i915_private *dev_priv);
-void vlv_wm_get_hw_state(struct drm_i915_private *dev_priv);
-void ilk_wm_get_hw_state(struct drm_i915_private *dev_priv);
-void skl_wm_get_hw_state(struct drm_i915_private *dev_priv);
-void skl_pipe_ddb_get_hw_state(struct intel_crtc *crtc,
-			       struct skl_ddb_entry *ddb_y,
-			       struct skl_ddb_entry *ddb_uv);
-void skl_ddb_get_hw_state(struct drm_i915_private *dev_priv,
-			  struct skl_ddb_allocation *ddb /* out */);
-void skl_pipe_wm_get_hw_state(struct intel_crtc *crtc,
-			      struct skl_pipe_wm *out);
-void g4x_wm_sanitize(struct drm_i915_private *dev_priv);
-void vlv_wm_sanitize(struct drm_i915_private *dev_priv);
-bool intel_can_enable_sagv(struct drm_atomic_state *state);
-int intel_enable_sagv(struct drm_i915_private *dev_priv);
-int intel_disable_sagv(struct drm_i915_private *dev_priv);
-bool skl_wm_level_equals(const struct skl_wm_level *l1,
-			 const struct skl_wm_level *l2);
-bool skl_ddb_allocation_overlaps(const struct skl_ddb_entry *ddb,
-				 const struct skl_ddb_entry entries[],
-				 int num_entries, int ignore_idx);
-void skl_write_plane_wm(struct intel_plane *plane,
-			const struct intel_crtc_state *crtc_state);
-void skl_write_cursor_wm(struct intel_plane *plane,
-			 const struct intel_crtc_state *crtc_state);
-bool ilk_disable_lp_wm(struct drm_device *dev);
-int skl_check_pipe_max_pixel_rate(struct intel_crtc *intel_crtc,
-				  struct intel_crtc_state *cstate);
-void intel_init_ipc(struct drm_i915_private *dev_priv);
-void intel_enable_ipc(struct drm_i915_private *dev_priv);
-
 /* intel_sprite.c */
 bool is_planar_yuv_format(u32 pixelformat);
 int intel_usecs_to_scanlines(const struct drm_display_mode *adjusted_mode,
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index b3c4f640117f..b48b3e9257d6 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -36,6 +36,7 @@
 #include "i915_drv.h"
 #include "intel_drv.h"
 #include "intel_fbc.h"
+#include "intel_pm.h"
 #include "../../../platform/x86/intel_ips.h"
 
 /**
@@ -5252,7 +5253,7 @@ static inline bool skl_ddb_entries_overlap(const struct skl_ddb_entry *a,
 }
 
 bool skl_ddb_allocation_overlaps(const struct skl_ddb_entry *ddb,
-				 const struct skl_ddb_entry entries[],
+				 const struct skl_ddb_entry *entries,
 				 int num_entries, int ignore_idx)
 {
 	int i;
diff --git a/drivers/gpu/drm/i915/intel_pm.h b/drivers/gpu/drm/i915/intel_pm.h
new file mode 100644
index 000000000000..de719160e8fe
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_pm.h
@@ -0,0 +1,72 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_PM_H__
+#define __INTEL_PM_H__
+
+#include <linux/types.h>
+
+struct drm_atomic_state;
+struct drm_device;
+struct drm_i915_private;
+struct i915_request;
+struct intel_crtc;
+struct intel_crtc_state;
+struct intel_plane;
+struct skl_ddb_allocation;
+struct skl_ddb_entry;
+struct skl_pipe_wm;
+struct skl_wm_level;
+
+void intel_init_clock_gating(struct drm_i915_private *dev_priv);
+void intel_suspend_hw(struct drm_i915_private *dev_priv);
+int ilk_wm_max_level(const struct drm_i915_private *dev_priv);
+void intel_update_watermarks(struct intel_crtc *crtc);
+void intel_init_pm(struct drm_i915_private *dev_priv);
+void intel_init_clock_gating_hooks(struct drm_i915_private *dev_priv);
+void intel_pm_setup(struct drm_i915_private *dev_priv);
+void intel_gpu_ips_init(struct drm_i915_private *dev_priv);
+void intel_gpu_ips_teardown(void);
+void intel_init_gt_powersave(struct drm_i915_private *dev_priv);
+void intel_cleanup_gt_powersave(struct drm_i915_private *dev_priv);
+void intel_sanitize_gt_powersave(struct drm_i915_private *dev_priv);
+void intel_enable_gt_powersave(struct drm_i915_private *dev_priv);
+void intel_disable_gt_powersave(struct drm_i915_private *dev_priv);
+void gen6_rps_busy(struct drm_i915_private *dev_priv);
+void gen6_rps_reset_ei(struct drm_i915_private *dev_priv);
+void gen6_rps_idle(struct drm_i915_private *dev_priv);
+void gen6_rps_boost(struct i915_request *rq);
+void g4x_wm_get_hw_state(struct drm_i915_private *dev_priv);
+void vlv_wm_get_hw_state(struct drm_i915_private *dev_priv);
+void ilk_wm_get_hw_state(struct drm_i915_private *dev_priv);
+void skl_wm_get_hw_state(struct drm_i915_private *dev_priv);
+void skl_pipe_ddb_get_hw_state(struct intel_crtc *crtc,
+			       struct skl_ddb_entry *ddb_y,
+			       struct skl_ddb_entry *ddb_uv);
+void skl_ddb_get_hw_state(struct drm_i915_private *dev_priv,
+			  struct skl_ddb_allocation *ddb /* out */);
+void skl_pipe_wm_get_hw_state(struct intel_crtc *crtc,
+			      struct skl_pipe_wm *out);
+void g4x_wm_sanitize(struct drm_i915_private *dev_priv);
+void vlv_wm_sanitize(struct drm_i915_private *dev_priv);
+bool intel_can_enable_sagv(struct drm_atomic_state *state);
+int intel_enable_sagv(struct drm_i915_private *dev_priv);
+int intel_disable_sagv(struct drm_i915_private *dev_priv);
+bool skl_wm_level_equals(const struct skl_wm_level *l1,
+			 const struct skl_wm_level *l2);
+bool skl_ddb_allocation_overlaps(const struct skl_ddb_entry *ddb,
+				 const struct skl_ddb_entry *entries,
+				 int num_entries, int ignore_idx);
+void skl_write_plane_wm(struct intel_plane *plane,
+			const struct intel_crtc_state *crtc_state);
+void skl_write_cursor_wm(struct intel_plane *plane,
+			 const struct intel_crtc_state *crtc_state);
+bool ilk_disable_lp_wm(struct drm_device *dev);
+int skl_check_pipe_max_pixel_rate(struct intel_crtc *intel_crtc,
+				  struct intel_crtc_state *cstate);
+void intel_init_ipc(struct drm_i915_private *dev_priv);
+void intel_enable_ipc(struct drm_i915_private *dev_priv);
+
+#endif /* __INTEL_PM_H__ */
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index d02da53e9806..0274e70f6034 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -42,6 +42,7 @@
 #include "i915_drv.h"
 #include "intel_drv.h"
 #include "intel_frontbuffer.h"
+#include "intel_pm.h"
 #include "intel_psr.h"
 
 bool is_planar_yuv_format(u32 pixelformat)
diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index a01d1b352a7c..d1d51e1121e2 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -21,12 +21,13 @@
  * IN THE SOFTWARE.
  */
 
+#include <linux/pm_runtime.h>
+#include <asm/iosf_mbi.h>
+
 #include "i915_drv.h"
-#include "intel_drv.h"
 #include "i915_vgpu.h"
-
-#include <asm/iosf_mbi.h>
-#include <linux/pm_runtime.h>
+#include "intel_drv.h"
+#include "intel_pm.h"
 
 #define FORCEWAKE_ACK_TIMEOUT_MS 50
 #define GT_FIFO_TIMEOUT_MS	 10
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 15/25] drm/i915: extract intel_fbdev.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (13 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 14/25] drm/i915: extract intel_pm.h " Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 16/25] drm/i915: extract intel_dp.h " Jani Nikula
                   ` (13 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/i915_drv.c           |  1 +
 drivers/gpu/drm/i915/i915_pci.c           |  1 +
 drivers/gpu/drm/i915/intel_display.c      |  1 +
 drivers/gpu/drm/i915/intel_drv.h          | 40 -----------------
 drivers/gpu/drm/i915/intel_fbdev.c        | 17 ++++----
 drivers/gpu/drm/i915/intel_fbdev.h        | 53 +++++++++++++++++++++++
 7 files changed, 66 insertions(+), 48 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_fbdev.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index ab7ac0ac17a1..9fd6f3460334 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -17,6 +17,7 @@ header_test := \
 	intel_ddi.h \
 	intel_engine_types.h \
 	intel_fbc.h \
+	intel_fbdev.h \
 	intel_frontbuffer.h \
 	intel_hdcp.h \
 	intel_lspcon.h \
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 85dac2f23197..fc11c215e0a2 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -56,6 +56,7 @@
 #include "intel_audio.h"
 #include "intel_csr.h"
 #include "intel_drv.h"
+#include "intel_fbdev.h"
 #include "intel_pm.h"
 #include "intel_uc.h"
 #include "intel_workarounds.h"
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 6ffb85ddac53..f893c2cbce15 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -31,6 +31,7 @@
 #include "i915_drv.h"
 #include "i915_globals.h"
 #include "i915_selftest.h"
+#include "intel_fbdev.h"
 
 #define PLATFORM(x) .platform = (x)
 #define GEN(x) .gen = (x), .gen_mask = BIT((x) - 1)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index f81a5c50120e..a1a29a7f2db0 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -54,6 +54,7 @@
 #include "intel_drv.h"
 #include "intel_dsi.h"
 #include "intel_fbc.h"
+#include "intel_fbdev.h"
 #include "intel_frontbuffer.h"
 #include "intel_hdcp.h"
 #include "intel_pm.h"
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 173f88935169..d23abd7cff49 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1972,46 +1972,6 @@ void intel_hpd_poll_init(struct drm_i915_private *dev_priv);
 bool intel_encoder_hotplug(struct intel_encoder *encoder,
 			   struct intel_connector *connector);
 
-/* legacy fbdev emulation in intel_fbdev.c */
-#ifdef CONFIG_DRM_FBDEV_EMULATION
-extern int intel_fbdev_init(struct drm_device *dev);
-extern void intel_fbdev_initial_config_async(struct drm_device *dev);
-extern void intel_fbdev_unregister(struct drm_i915_private *dev_priv);
-extern void intel_fbdev_fini(struct drm_i915_private *dev_priv);
-extern void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous);
-extern void intel_fbdev_output_poll_changed(struct drm_device *dev);
-extern void intel_fbdev_restore_mode(struct drm_device *dev);
-#else
-static inline int intel_fbdev_init(struct drm_device *dev)
-{
-	return 0;
-}
-
-static inline void intel_fbdev_initial_config_async(struct drm_device *dev)
-{
-}
-
-static inline void intel_fbdev_unregister(struct drm_i915_private *dev_priv)
-{
-}
-
-static inline void intel_fbdev_fini(struct drm_i915_private *dev_priv)
-{
-}
-
-static inline void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous)
-{
-}
-
-static inline void intel_fbdev_output_poll_changed(struct drm_device *dev)
-{
-}
-
-static inline void intel_fbdev_restore_mode(struct drm_device *dev)
-{
-}
-#endif
-
 /* intel_hdmi.c */
 void intel_hdmi_init(struct drm_i915_private *dev_priv, i915_reg_t hdmi_reg,
 		     enum port port);
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
index ef93c27e60b4..bc532e99b5dc 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -25,26 +25,27 @@
  */
 
 #include <linux/async.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
 #include <linux/console.h>
+#include <linux/delay.h>
 #include <linux/errno.h>
-#include <linux/string.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
 #include <linux/mm.h>
-#include <linux/tty.h>
+#include <linux/module.h>
+#include <linux/string.h>
 #include <linux/sysrq.h>
-#include <linux/delay.h>
-#include <linux/init.h>
+#include <linux/tty.h>
 #include <linux/vga_switcheroo.h>
 
 #include <drm/drm_crtc.h>
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_fourcc.h>
+#include <drm/i915_drm.h>
 
+#include "i915_drv.h"
 #include "intel_drv.h"
+#include "intel_fbdev.h"
 #include "intel_frontbuffer.h"
-#include <drm/i915_drm.h>
-#include "i915_drv.h"
 
 static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
 {
diff --git a/drivers/gpu/drm/i915/intel_fbdev.h b/drivers/gpu/drm/i915/intel_fbdev.h
new file mode 100644
index 000000000000..de7c84250eb5
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_fbdev.h
@@ -0,0 +1,53 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_FBDEV_H__
+#define __INTEL_FBDEV_H__
+
+#include <linux/types.h>
+
+struct drm_device;
+struct drm_i915_private;
+
+#ifdef CONFIG_DRM_FBDEV_EMULATION
+int intel_fbdev_init(struct drm_device *dev);
+void intel_fbdev_initial_config_async(struct drm_device *dev);
+void intel_fbdev_unregister(struct drm_i915_private *dev_priv);
+void intel_fbdev_fini(struct drm_i915_private *dev_priv);
+void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous);
+void intel_fbdev_output_poll_changed(struct drm_device *dev);
+void intel_fbdev_restore_mode(struct drm_device *dev);
+#else
+static inline int intel_fbdev_init(struct drm_device *dev)
+{
+	return 0;
+}
+
+static inline void intel_fbdev_initial_config_async(struct drm_device *dev)
+{
+}
+
+static inline void intel_fbdev_unregister(struct drm_i915_private *dev_priv)
+{
+}
+
+static inline void intel_fbdev_fini(struct drm_i915_private *dev_priv)
+{
+}
+
+static inline void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous)
+{
+}
+
+static inline void intel_fbdev_output_poll_changed(struct drm_device *dev)
+{
+}
+
+static inline void intel_fbdev_restore_mode(struct drm_device *dev)
+{
+}
+#endif
+
+#endif /* __INTEL_FBDEV_H__ */
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 16/25] drm/i915: extract intel_dp.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (14 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 15/25] drm/i915: extract intel_fbdev.h " Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 17/25] drm/i915: extract intel_hdmi.h " Jani Nikula
                   ` (12 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test     |   1 +
 drivers/gpu/drm/i915/i915_debugfs.c           |   1 +
 drivers/gpu/drm/i915/i915_drv.c               |   1 +
 drivers/gpu/drm/i915/intel_ddi.c              |   1 +
 drivers/gpu/drm/i915/intel_display.c          |   1 +
 drivers/gpu/drm/i915/intel_dp.c               |   1 +
 drivers/gpu/drm/i915/intel_dp.h               | 121 ++++++++++++++++++
 drivers/gpu/drm/i915/intel_dp_link_training.c |   1 +
 drivers/gpu/drm/i915/intel_dp_mst.c           |   1 +
 drivers/gpu/drm/i915/intel_dpio_phy.c         |   1 +
 drivers/gpu/drm/i915/intel_drv.h              |  97 +-------------
 drivers/gpu/drm/i915/intel_frontbuffer.c      |   1 +
 drivers/gpu/drm/i915/intel_hdmi.c             |   1 +
 drivers/gpu/drm/i915/intel_lspcon.c           |   5 +-
 drivers/gpu/drm/i915/intel_psr.c              |   1 +
 drivers/gpu/drm/i915/intel_runtime_pm.c       |   1 +
 16 files changed, 140 insertions(+), 96 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_dp.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index 9fd6f3460334..fbc172a26cb1 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -15,6 +15,7 @@ header_test := \
 	intel_crt.h \
 	intel_csr.h \
 	intel_ddi.h \
+	intel_dp.h \
 	intel_engine_types.h \
 	intel_fbc.h \
 	intel_fbdev.h \
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 7c54c994de50..859f77a8a09e 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -33,6 +33,7 @@
 #include <drm/drm_fourcc.h>
 
 #include "i915_reset.h"
+#include "intel_dp.h"
 #include "intel_drv.h"
 #include "intel_fbc.h"
 #include "intel_guc_submission.h"
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index fc11c215e0a2..08a64e5cc869 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -55,6 +55,7 @@
 #include "i915_vgpu.h"
 #include "intel_audio.h"
 #include "intel_csr.h"
+#include "intel_dp.h"
 #include "intel_drv.h"
 #include "intel_fbdev.h"
 #include "intel_pm.h"
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 887903d89cd8..406eb9088935 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -30,6 +30,7 @@
 #include "i915_drv.h"
 #include "intel_audio.h"
 #include "intel_connector.h"
+#include "intel_dp.h"
 #include "intel_drv.h"
 #include "intel_dsi.h"
 #include "intel_hdcp.h"
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index a1a29a7f2db0..e1b38634ba42 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -51,6 +51,7 @@
 #include "intel_color.h"
 #include "intel_crt.h"
 #include "intel_ddi.h"
+#include "intel_dp.h"
 #include "intel_drv.h"
 #include "intel_dsi.h"
 #include "intel_fbc.h"
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 02d662ff5df9..46d27ed6954b 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -45,6 +45,7 @@
 #include "intel_audio.h"
 #include "intel_connector.h"
 #include "intel_ddi.h"
+#include "intel_dp.h"
 #include "intel_drv.h"
 #include "intel_hdcp.h"
 #include "intel_lspcon.h"
diff --git a/drivers/gpu/drm/i915/intel_dp.h b/drivers/gpu/drm/i915/intel_dp.h
new file mode 100644
index 000000000000..5c152ca6f9ed
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_dp.h
@@ -0,0 +1,121 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_DP_H__
+#define __INTEL_DP_H__
+
+#include <linux/types.h>
+
+#include <drm/i915_drm.h>
+
+#include "i915_reg.h"
+
+enum pipe;
+struct drm_connector_state;
+struct drm_encoder;
+struct drm_i915_private;
+struct drm_modeset_acquire_ctx;
+struct intel_connector;
+struct intel_crtc_state;
+struct intel_digital_port;
+struct intel_dp;
+struct intel_encoder;
+
+struct link_config_limits {
+	int min_clock, max_clock;
+	int min_lane_count, max_lane_count;
+	int min_bpp, max_bpp;
+};
+
+void intel_dp_adjust_compliance_config(struct intel_dp *intel_dp,
+				       struct intel_crtc_state *pipe_config,
+				       struct link_config_limits *limits);
+bool intel_dp_limited_color_range(const struct intel_crtc_state *crtc_state,
+				  const struct drm_connector_state *conn_state);
+bool intel_dp_port_enabled(struct drm_i915_private *dev_priv,
+			   i915_reg_t dp_reg, enum port port,
+			   enum pipe *pipe);
+bool intel_dp_init(struct drm_i915_private *dev_priv, i915_reg_t output_reg,
+		   enum port port);
+bool intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
+			     struct intel_connector *intel_connector);
+void intel_dp_set_link_params(struct intel_dp *intel_dp,
+			      int link_rate, u8 lane_count,
+			      bool link_mst);
+int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp,
+					    int link_rate, u8 lane_count);
+int intel_dp_retrain_link(struct intel_encoder *encoder,
+			  struct drm_modeset_acquire_ctx *ctx);
+void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode);
+void intel_dp_sink_set_decompression_state(struct intel_dp *intel_dp,
+					   const struct intel_crtc_state *crtc_state,
+					   bool enable);
+void intel_dp_encoder_reset(struct drm_encoder *encoder);
+void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder);
+void intel_dp_encoder_flush_work(struct drm_encoder *encoder);
+int intel_dp_compute_config(struct intel_encoder *encoder,
+			    struct intel_crtc_state *pipe_config,
+			    struct drm_connector_state *conn_state);
+bool intel_dp_is_edp(struct intel_dp *intel_dp);
+bool intel_dp_is_port_edp(struct drm_i915_private *dev_priv, enum port port);
+enum irqreturn intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port,
+				  bool long_hpd);
+void intel_edp_backlight_on(const struct intel_crtc_state *crtc_state,
+			    const struct drm_connector_state *conn_state);
+void intel_edp_backlight_off(const struct drm_connector_state *conn_state);
+void intel_edp_panel_vdd_on(struct intel_dp *intel_dp);
+void intel_edp_panel_on(struct intel_dp *intel_dp);
+void intel_edp_panel_off(struct intel_dp *intel_dp);
+void intel_dp_mst_suspend(struct drm_i915_private *dev_priv);
+void intel_dp_mst_resume(struct drm_i915_private *dev_priv);
+int intel_dp_max_link_rate(struct intel_dp *intel_dp);
+int intel_dp_max_lane_count(struct intel_dp *intel_dp);
+int intel_dp_rate_select(struct intel_dp *intel_dp, int rate);
+void intel_power_sequencer_reset(struct drm_i915_private *dev_priv);
+u32 intel_dp_pack_aux(const u8 *src, int src_bytes);
+
+void intel_edp_drrs_enable(struct intel_dp *intel_dp,
+			   const struct intel_crtc_state *crtc_state);
+void intel_edp_drrs_disable(struct intel_dp *intel_dp,
+			    const struct intel_crtc_state *crtc_state);
+void intel_edp_drrs_invalidate(struct drm_i915_private *dev_priv,
+			       unsigned int frontbuffer_bits);
+void intel_edp_drrs_flush(struct drm_i915_private *dev_priv,
+			  unsigned int frontbuffer_bits);
+
+void
+intel_dp_program_link_training_pattern(struct intel_dp *intel_dp,
+				       u8 dp_train_pat);
+void
+intel_dp_set_signal_levels(struct intel_dp *intel_dp);
+void intel_dp_set_idle_link_train(struct intel_dp *intel_dp);
+u8
+intel_dp_voltage_max(struct intel_dp *intel_dp);
+u8
+intel_dp_pre_emphasis_max(struct intel_dp *intel_dp, u8 voltage_swing);
+void intel_dp_compute_rate(struct intel_dp *intel_dp, int port_clock,
+			   u8 *link_bw, u8 *rate_select);
+bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp);
+bool intel_dp_source_supports_hbr3(struct intel_dp *intel_dp);
+bool
+intel_dp_get_link_status(struct intel_dp *intel_dp, u8 *link_status);
+u16 intel_dp_dsc_get_output_bpp(int link_clock, u8 lane_count,
+				int mode_clock, int mode_hdisplay);
+u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp, int mode_clock,
+				int mode_hdisplay);
+
+bool intel_dp_read_dpcd(struct intel_dp *intel_dp);
+int intel_dp_link_required(int pixel_clock, int bpp);
+int intel_dp_max_data_rate(int max_link_clock, int max_lanes);
+bool intel_digital_port_connected(struct intel_encoder *encoder);
+void icl_tc_phy_disconnect(struct drm_i915_private *dev_priv,
+			   struct intel_digital_port *dig_port);
+
+static inline unsigned int intel_dp_unused_lane_mask(int lane_count)
+{
+	return ~((1 << lane_count) - 1) & 0xf;
+}
+
+#endif /* __INTEL_DP_H__ */
diff --git a/drivers/gpu/drm/i915/intel_dp_link_training.c b/drivers/gpu/drm/i915/intel_dp_link_training.c
index b59c87daa4f7..54b069333e2f 100644
--- a/drivers/gpu/drm/i915/intel_dp_link_training.c
+++ b/drivers/gpu/drm/i915/intel_dp_link_training.c
@@ -21,6 +21,7 @@
  * IN THE SOFTWARE.
  */
 
+#include "intel_dp.h"
 #include "intel_drv.h"
 
 static void
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index 041003884860..9c4c0589c0fc 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -31,6 +31,7 @@
 #include "intel_audio.h"
 #include "intel_connector.h"
 #include "intel_ddi.h"
+#include "intel_dp.h"
 #include "intel_drv.h"
 
 static int intel_dp_mst_compute_link_config(struct intel_encoder *encoder,
diff --git a/drivers/gpu/drm/i915/intel_dpio_phy.c b/drivers/gpu/drm/i915/intel_dpio_phy.c
index db295c77ff0d..ab4ac7158b79 100644
--- a/drivers/gpu/drm/i915/intel_dpio_phy.c
+++ b/drivers/gpu/drm/i915/intel_dpio_phy.c
@@ -21,6 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
+#include "intel_dp.h"
 #include "intel_drv.h"
 
 /**
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index d23abd7cff49..4847db9f87e2 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1663,6 +1663,7 @@ void intel_dump_cdclk_state(const struct intel_cdclk_state *cdclk_state,
 			    const char *context);
 
 /* intel_display.c */
+void intel_plane_destroy(struct drm_plane *plane);
 void i830_enable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe);
 void i830_disable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe);
 enum pipe intel_crtc_pch_transcoder(struct intel_crtc *crtc);
@@ -1846,91 +1847,9 @@ unsigned int i9xx_plane_max_stride(struct intel_plane *plane,
 				   u32 pixel_format, u64 modifier,
 				   unsigned int rotation);
 
-/* intel_dp.c */
-struct link_config_limits {
-	int min_clock, max_clock;
-	int min_lane_count, max_lane_count;
-	int min_bpp, max_bpp;
-};
-void intel_dp_adjust_compliance_config(struct intel_dp *intel_dp,
-				       struct intel_crtc_state *pipe_config,
-				       struct link_config_limits *limits);
-bool intel_dp_limited_color_range(const struct intel_crtc_state *crtc_state,
-				  const struct drm_connector_state *conn_state);
-bool intel_dp_port_enabled(struct drm_i915_private *dev_priv,
-			   i915_reg_t dp_reg, enum port port,
-			   enum pipe *pipe);
-bool intel_dp_init(struct drm_i915_private *dev_priv, i915_reg_t output_reg,
-		   enum port port);
-bool intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
-			     struct intel_connector *intel_connector);
-void intel_dp_set_link_params(struct intel_dp *intel_dp,
-			      int link_rate, u8 lane_count,
-			      bool link_mst);
-int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp,
-					    int link_rate, u8 lane_count);
+/* intel_dp_link_training.c */
 void intel_dp_start_link_train(struct intel_dp *intel_dp);
 void intel_dp_stop_link_train(struct intel_dp *intel_dp);
-int intel_dp_retrain_link(struct intel_encoder *encoder,
-			  struct drm_modeset_acquire_ctx *ctx);
-void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode);
-void intel_dp_sink_set_decompression_state(struct intel_dp *intel_dp,
-					   const struct intel_crtc_state *crtc_state,
-					   bool enable);
-void intel_dp_encoder_reset(struct drm_encoder *encoder);
-void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder);
-void intel_dp_encoder_flush_work(struct drm_encoder *encoder);
-int intel_dp_compute_config(struct intel_encoder *encoder,
-			    struct intel_crtc_state *pipe_config,
-			    struct drm_connector_state *conn_state);
-bool intel_dp_is_edp(struct intel_dp *intel_dp);
-bool intel_dp_is_port_edp(struct drm_i915_private *dev_priv, enum port port);
-enum irqreturn intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port,
-				  bool long_hpd);
-void intel_edp_backlight_on(const struct intel_crtc_state *crtc_state,
-			    const struct drm_connector_state *conn_state);
-void intel_edp_backlight_off(const struct drm_connector_state *conn_state);
-void intel_edp_panel_vdd_on(struct intel_dp *intel_dp);
-void intel_edp_panel_on(struct intel_dp *intel_dp);
-void intel_edp_panel_off(struct intel_dp *intel_dp);
-void intel_dp_mst_suspend(struct drm_i915_private *dev_priv);
-void intel_dp_mst_resume(struct drm_i915_private *dev_priv);
-int intel_dp_max_link_rate(struct intel_dp *intel_dp);
-int intel_dp_max_lane_count(struct intel_dp *intel_dp);
-int intel_dp_rate_select(struct intel_dp *intel_dp, int rate);
-void intel_dp_hot_plug(struct intel_encoder *intel_encoder);
-void intel_power_sequencer_reset(struct drm_i915_private *dev_priv);
-u32 intel_dp_pack_aux(const u8 *src, int src_bytes);
-void intel_plane_destroy(struct drm_plane *plane);
-void intel_edp_drrs_enable(struct intel_dp *intel_dp,
-			   const struct intel_crtc_state *crtc_state);
-void intel_edp_drrs_disable(struct intel_dp *intel_dp,
-			    const struct intel_crtc_state *crtc_state);
-void intel_edp_drrs_invalidate(struct drm_i915_private *dev_priv,
-			       unsigned int frontbuffer_bits);
-void intel_edp_drrs_flush(struct drm_i915_private *dev_priv,
-			  unsigned int frontbuffer_bits);
-
-void
-intel_dp_program_link_training_pattern(struct intel_dp *intel_dp,
-				       u8 dp_train_pat);
-void
-intel_dp_set_signal_levels(struct intel_dp *intel_dp);
-void intel_dp_set_idle_link_train(struct intel_dp *intel_dp);
-u8
-intel_dp_voltage_max(struct intel_dp *intel_dp);
-u8
-intel_dp_pre_emphasis_max(struct intel_dp *intel_dp, u8 voltage_swing);
-void intel_dp_compute_rate(struct intel_dp *intel_dp, int port_clock,
-			   u8 *link_bw, u8 *rate_select);
-bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp);
-bool intel_dp_source_supports_hbr3(struct intel_dp *intel_dp);
-bool
-intel_dp_get_link_status(struct intel_dp *intel_dp, u8 link_status[DP_LINK_STATUS_SIZE]);
-u16 intel_dp_dsc_get_output_bpp(int link_clock, u8 lane_count,
-				int mode_clock, int mode_hdisplay);
-u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp, int mode_clock,
-				int mode_hdisplay);
 
 /* intel_vdsc.c */
 int intel_dp_compute_dsc_params(struct intel_dp *intel_dp,
@@ -1938,18 +1857,6 @@ int intel_dp_compute_dsc_params(struct intel_dp *intel_dp,
 enum intel_display_power_domain
 intel_dsc_power_domain(const struct intel_crtc_state *crtc_state);
 
-static inline unsigned int intel_dp_unused_lane_mask(int lane_count)
-{
-	return ~((1 << lane_count) - 1) & 0xf;
-}
-
-bool intel_dp_read_dpcd(struct intel_dp *intel_dp);
-int intel_dp_link_required(int pixel_clock, int bpp);
-int intel_dp_max_data_rate(int max_link_clock, int max_lanes);
-bool intel_digital_port_connected(struct intel_encoder *encoder);
-void icl_tc_phy_disconnect(struct drm_i915_private *dev_priv,
-			   struct intel_digital_port *dig_port);
-
 /* intel_dp_aux_backlight.c */
 int intel_dp_aux_init_backlight_funcs(struct intel_connector *intel_connector);
 
diff --git a/drivers/gpu/drm/i915/intel_frontbuffer.c b/drivers/gpu/drm/i915/intel_frontbuffer.c
index a42f859ad22e..aa34e33b6087 100644
--- a/drivers/gpu/drm/i915/intel_frontbuffer.c
+++ b/drivers/gpu/drm/i915/intel_frontbuffer.c
@@ -62,6 +62,7 @@
 
 
 #include "i915_drv.h"
+#include "intel_dp.h"
 #include "intel_drv.h"
 #include "intel_fbc.h"
 #include "intel_frontbuffer.h"
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 5725fedaceec..2207cc4f5012 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -43,6 +43,7 @@
 #include "intel_audio.h"
 #include "intel_connector.h"
 #include "intel_ddi.h"
+#include "intel_dp.h"
 #include "intel_drv.h"
 #include "intel_hdcp.h"
 #include "intel_lspcon.h"
diff --git a/drivers/gpu/drm/i915/intel_lspcon.c b/drivers/gpu/drm/i915/intel_lspcon.c
index 8d202b13e24f..e8c294dc597a 100644
--- a/drivers/gpu/drm/i915/intel_lspcon.c
+++ b/drivers/gpu/drm/i915/intel_lspcon.c
@@ -22,9 +22,12 @@
  *
  *
  */
-#include <drm/drm_edid.h>
+
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_dp_dual_mode_helper.h>
+#include <drm/drm_edid.h>
+
+#include "intel_dp.h"
 #include "intel_drv.h"
 
 /* LSPCON OUI Vendor ID(signatures) */
diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
index 6592aa48c8ef..30016e054344 100644
--- a/drivers/gpu/drm/i915/intel_psr.c
+++ b/drivers/gpu/drm/i915/intel_psr.c
@@ -24,6 +24,7 @@
 #include <drm/drm_atomic_helper.h>
 
 #include "i915_drv.h"
+#include "intel_dp.h"
 #include "intel_drv.h"
 #include "intel_psr.h"
 
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index b72af95b893b..d78256116cb8 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -34,6 +34,7 @@
 #include "i915_drv.h"
 #include "intel_crt.h"
 #include "intel_csr.h"
+#include "intel_dp.h"
 #include "intel_drv.h"
 
 /**
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 17/25] drm/i915: extract intel_hdmi.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (15 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 16/25] drm/i915: extract intel_dp.h " Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 18/25] drm/i915: extract intel_atomic_plane.h " Jani Nikula
                   ` (11 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/i915_debugfs.c       |  1 +
 drivers/gpu/drm/i915/intel_ddi.c          |  1 +
 drivers/gpu/drm/i915/intel_display.c      |  1 +
 drivers/gpu/drm/i915/intel_dp.c           |  1 +
 drivers/gpu/drm/i915/intel_drv.h          | 38 ++++-------------
 drivers/gpu/drm/i915/intel_hdmi.h         | 51 +++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_sdvo.c         |  1 +
 8 files changed, 64 insertions(+), 31 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_hdmi.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index fbc172a26cb1..e78eeaa8ec33 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -21,6 +21,7 @@ header_test := \
 	intel_fbdev.h \
 	intel_frontbuffer.h \
 	intel_hdcp.h \
+	intel_hdmi.h \
 	intel_lspcon.h \
 	intel_panel.h \
 	intel_pm.h \
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 859f77a8a09e..527b995a4d7a 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -38,6 +38,7 @@
 #include "intel_fbc.h"
 #include "intel_guc_submission.h"
 #include "intel_hdcp.h"
+#include "intel_hdmi.h"
 #include "intel_pm.h"
 #include "intel_psr.h"
 
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 406eb9088935..46ab56755365 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -34,6 +34,7 @@
 #include "intel_drv.h"
 #include "intel_dsi.h"
 #include "intel_hdcp.h"
+#include "intel_hdmi.h"
 #include "intel_lspcon.h"
 #include "intel_panel.h"
 #include "intel_psr.h"
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e1b38634ba42..472388592951 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -58,6 +58,7 @@
 #include "intel_fbdev.h"
 #include "intel_frontbuffer.h"
 #include "intel_hdcp.h"
+#include "intel_hdmi.h"
 #include "intel_pm.h"
 #include "intel_psr.h"
 #include "intel_sdvo.h"
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 46d27ed6954b..a5eeb1b89376 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -48,6 +48,7 @@
 #include "intel_dp.h"
 #include "intel_drv.h"
 #include "intel_hdcp.h"
+#include "intel_hdmi.h"
 #include "intel_lspcon.h"
 #include "intel_panel.h"
 #include "intel_psr.h"
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 4847db9f87e2..ae5714ef6c11 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -27,23 +27,24 @@
 
 #include <linux/async.h>
 #include <linux/i2c.h>
-#include <linux/hdmi.h>
 #include <linux/sched/clock.h>
 #include <linux/stackdepot.h>
-#include <drm/i915_drm.h>
-#include "i915_drv.h"
+
+#include <drm/drm_atomic.h>
 #include <drm/drm_crtc.h>
-#include <drm/drm_encoder.h>
-#include <drm/drm_fb_helper.h>
 #include <drm/drm_dp_dual_mode_helper.h>
 #include <drm/drm_dp_mst_helper.h>
+#include <drm/drm_encoder.h>
+#include <drm/drm_fb_helper.h>
 #include <drm/drm_probe_helper.h>
 #include <drm/drm_rect.h>
 #include <drm/drm_vblank.h>
-#include <drm/drm_atomic.h>
+#include <drm/i915_drm.h>
 #include <drm/i915_mei_hdcp_interface.h>
 #include <media/cec-notifier.h>
 
+#include "i915_drv.h"
+
 struct drm_printer;
 
 /**
@@ -1879,31 +1880,6 @@ void intel_hpd_poll_init(struct drm_i915_private *dev_priv);
 bool intel_encoder_hotplug(struct intel_encoder *encoder,
 			   struct intel_connector *connector);
 
-/* intel_hdmi.c */
-void intel_hdmi_init(struct drm_i915_private *dev_priv, i915_reg_t hdmi_reg,
-		     enum port port);
-void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
-			       struct intel_connector *intel_connector);
-struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder);
-int intel_hdmi_compute_config(struct intel_encoder *encoder,
-			      struct intel_crtc_state *pipe_config,
-			      struct drm_connector_state *conn_state);
-bool intel_hdmi_handle_sink_scrambling(struct intel_encoder *encoder,
-				       struct drm_connector *connector,
-				       bool high_tmds_clock_ratio,
-				       bool scrambling);
-void intel_dp_dual_mode_set_tmds_output(struct intel_hdmi *hdmi, bool enable);
-void intel_infoframe_init(struct intel_digital_port *intel_dig_port);
-u32 intel_hdmi_infoframes_enabled(struct intel_encoder *encoder,
-				  const struct intel_crtc_state *crtc_state);
-u32 intel_hdmi_infoframe_enable(unsigned int type);
-void intel_hdmi_read_gcp_infoframe(struct intel_encoder *encoder,
-				   struct intel_crtc_state *crtc_state);
-void intel_read_infoframe(struct intel_encoder *encoder,
-			  const struct intel_crtc_state *crtc_state,
-			  enum hdmi_infoframe_type type,
-			  union hdmi_infoframe *frame);
-
 /* intel_lvds.c */
 bool intel_lvds_port_enabled(struct drm_i915_private *dev_priv,
 			     i915_reg_t lvds_reg, enum pipe *pipe);
diff --git a/drivers/gpu/drm/i915/intel_hdmi.h b/drivers/gpu/drm/i915/intel_hdmi.h
new file mode 100644
index 000000000000..106c2e0bc3c9
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_hdmi.h
@@ -0,0 +1,51 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_HDMI_H__
+#define __INTEL_HDMI_H__
+
+#include <linux/hdmi.h>
+#include <linux/types.h>
+
+#include <drm/i915_drm.h>
+
+#include "i915_reg.h"
+
+struct drm_connector;
+struct drm_encoder;
+struct drm_i915_private;
+struct intel_connector;
+struct intel_digital_port;
+struct intel_encoder;
+struct intel_crtc_state;
+struct intel_hdmi;
+struct drm_connector_state;
+union hdmi_infoframe;
+
+void intel_hdmi_init(struct drm_i915_private *dev_priv, i915_reg_t hdmi_reg,
+		     enum port port);
+void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
+			       struct intel_connector *intel_connector);
+struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder);
+int intel_hdmi_compute_config(struct intel_encoder *encoder,
+			      struct intel_crtc_state *pipe_config,
+			      struct drm_connector_state *conn_state);
+bool intel_hdmi_handle_sink_scrambling(struct intel_encoder *encoder,
+				       struct drm_connector *connector,
+				       bool high_tmds_clock_ratio,
+				       bool scrambling);
+void intel_dp_dual_mode_set_tmds_output(struct intel_hdmi *hdmi, bool enable);
+void intel_infoframe_init(struct intel_digital_port *intel_dig_port);
+u32 intel_hdmi_infoframes_enabled(struct intel_encoder *encoder,
+				  const struct intel_crtc_state *crtc_state);
+u32 intel_hdmi_infoframe_enable(unsigned int type);
+void intel_hdmi_read_gcp_infoframe(struct intel_encoder *encoder,
+				   struct intel_crtc_state *crtc_state);
+void intel_read_infoframe(struct intel_encoder *encoder,
+			  const struct intel_crtc_state *crtc_state,
+			  enum hdmi_infoframe_type type,
+			  union hdmi_infoframe *frame);
+
+#endif /* __INTEL_HDMI_H__ */
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 9a4c54dd2e5c..7eb578a57064 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -39,6 +39,7 @@
 #include "i915_drv.h"
 #include "intel_connector.h"
 #include "intel_drv.h"
+#include "intel_hdmi.h"
 #include "intel_panel.h"
 #include "intel_sdvo_regs.h"
 
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 18/25] drm/i915: extract intel_atomic_plane.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (16 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 17/25] drm/i915: extract intel_hdmi.h " Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 19/25] drm/i915: extract intel_pipe_crc.h " Jani Nikula
                   ` (10 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/intel_atomic_plane.c | 34 +++++++++----------
 drivers/gpu/drm/i915/intel_atomic_plane.h | 40 +++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_display.c      |  1 +
 drivers/gpu/drm/i915/intel_drv.h          | 24 --------------
 drivers/gpu/drm/i915/intel_sprite.c       |  1 +
 6 files changed, 60 insertions(+), 41 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_atomic_plane.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index e78eeaa8ec33..43c939da9665 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -8,6 +8,7 @@ header_test := \
 	i915_priolist_types.h \
 	i915_scheduler_types.h \
 	i915_timeline_types.h \
+	intel_atomic_plane.h \
 	intel_audio.h \
 	intel_color.h \
 	intel_connector.h \
diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
index 42821f8e6031..381234ce1bc4 100644
--- a/drivers/gpu/drm/i915/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
@@ -59,6 +59,23 @@ struct intel_plane *intel_plane_alloc(void)
 	return plane;
 }
 
+/**
+ * intel_plane_destroy_state - destroy plane state
+ * @plane: drm plane
+ * @state: state object to destroy
+ *
+ * Destroys the plane state (both common and Intel-specific) for the
+ * specified plane.
+ */
+void
+intel_plane_destroy_state(struct drm_plane *plane,
+			  struct drm_plane_state *state)
+{
+	WARN_ON(to_intel_plane_state(state)->vma);
+
+	drm_atomic_helper_plane_destroy_state(plane, state);
+}
+
 void intel_plane_free(struct intel_plane *plane)
 {
 	intel_plane_destroy_state(&plane->base, plane->base.state);
@@ -95,23 +112,6 @@ intel_plane_duplicate_state(struct drm_plane *plane)
 	return state;
 }
 
-/**
- * intel_plane_destroy_state - destroy plane state
- * @plane: drm plane
- * @state: state object to destroy
- *
- * Destroys the plane state (both common and Intel-specific) for the
- * specified plane.
- */
-void
-intel_plane_destroy_state(struct drm_plane *plane,
-			  struct drm_plane_state *state)
-{
-	WARN_ON(to_intel_plane_state(state)->vma);
-
-	drm_atomic_helper_plane_destroy_state(plane, state);
-}
-
 int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_state,
 					struct intel_crtc_state *new_crtc_state,
 					const struct intel_plane_state *old_plane_state,
diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.h b/drivers/gpu/drm/i915/intel_atomic_plane.h
new file mode 100644
index 000000000000..14678620440f
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_atomic_plane.h
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_ATOMIC_PLANE_H__
+#define __INTEL_ATOMIC_PLANE_H__
+
+struct drm_plane;
+struct intel_atomic_state;
+struct intel_crtc;
+struct intel_crtc_state;
+struct intel_plane;
+struct intel_plane_state;
+
+extern const struct drm_plane_helper_funcs intel_plane_helper_funcs;
+
+void intel_update_plane(struct intel_plane *plane,
+			const struct intel_crtc_state *crtc_state,
+			const struct intel_plane_state *plane_state);
+void intel_update_slave(struct intel_plane *plane,
+			const struct intel_crtc_state *crtc_state,
+			const struct intel_plane_state *plane_state);
+void intel_disable_plane(struct intel_plane *plane,
+			 const struct intel_crtc_state *crtc_state);
+struct intel_plane *intel_plane_alloc(void);
+void intel_plane_free(struct intel_plane *plane);
+struct drm_plane_state *intel_plane_duplicate_state(struct drm_plane *plane);
+void intel_plane_destroy_state(struct drm_plane *plane,
+			       struct drm_plane_state *state);
+void skl_update_planes_on_crtc(struct intel_atomic_state *state,
+			       struct intel_crtc *crtc);
+void i9xx_update_planes_on_crtc(struct intel_atomic_state *state,
+				struct intel_crtc *crtc);
+int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_state,
+					struct intel_crtc_state *crtc_state,
+					const struct intel_plane_state *old_plane_state,
+					struct intel_plane_state *intel_state);
+
+#endif /* __INTEL_ATOMIC_PLANE_H__ */
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 472388592951..54ba021ad4ea 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -48,6 +48,7 @@
 #include "i915_gem_clflush.h"
 #include "i915_reset.h"
 #include "i915_trace.h"
+#include "intel_atomic_plane.h"
 #include "intel_color.h"
 #include "intel_crt.h"
 #include "intel_ddi.h"
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index ae5714ef6c11..9b8435f9ccaf 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -2120,30 +2120,6 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,
 			       struct intel_crtc *intel_crtc,
 			       struct intel_crtc_state *crtc_state);
 
-/* intel_atomic_plane.c */
-void intel_update_plane(struct intel_plane *plane,
-			const struct intel_crtc_state *crtc_state,
-			const struct intel_plane_state *plane_state);
-void intel_update_slave(struct intel_plane *plane,
-			const struct intel_crtc_state *crtc_state,
-			const struct intel_plane_state *plane_state);
-void intel_disable_plane(struct intel_plane *plane,
-			 const struct intel_crtc_state *crtc_state);
-struct intel_plane *intel_plane_alloc(void);
-void intel_plane_free(struct intel_plane *plane);
-struct drm_plane_state *intel_plane_duplicate_state(struct drm_plane *plane);
-void intel_plane_destroy_state(struct drm_plane *plane,
-			       struct drm_plane_state *state);
-extern const struct drm_plane_helper_funcs intel_plane_helper_funcs;
-void skl_update_planes_on_crtc(struct intel_atomic_state *state,
-			       struct intel_crtc *crtc);
-void i9xx_update_planes_on_crtc(struct intel_atomic_state *state,
-				struct intel_crtc *crtc);
-int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_state,
-					struct intel_crtc_state *crtc_state,
-					const struct intel_plane_state *old_plane_state,
-					struct intel_plane_state *intel_state);
-
 /* intel_pipe_crc.c */
 #ifdef CONFIG_DEBUG_FS
 int intel_crtc_set_crc_source(struct drm_crtc *crtc, const char *source_name);
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 0274e70f6034..50ba32eaee9e 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -40,6 +40,7 @@
 #include <drm/i915_drm.h>
 
 #include "i915_drv.h"
+#include "intel_atomic_plane.h"
 #include "intel_drv.h"
 #include "intel_frontbuffer.h"
 #include "intel_pm.h"
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 19/25] drm/i915: extract intel_pipe_crc.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (17 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 18/25] drm/i915: extract intel_atomic_plane.h " Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 20/25] drm/i915: extract intel_tv.h " Jani Nikula
                   ` (9 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/intel_display.c      |  1 +
 drivers/gpu/drm/i915/intel_drv.h          | 21 --------------
 drivers/gpu/drm/i915/intel_pipe_crc.h     | 35 +++++++++++++++++++++++
 4 files changed, 37 insertions(+), 21 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_pipe_crc.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index 43c939da9665..2724ccff61ea 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -25,6 +25,7 @@ header_test := \
 	intel_hdmi.h \
 	intel_lspcon.h \
 	intel_panel.h \
+	intel_pipe_crc.h \
 	intel_pm.h \
 	intel_psr.h \
 	intel_sdvo.h \
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 54ba021ad4ea..77348a9e68e7 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -60,6 +60,7 @@
 #include "intel_frontbuffer.h"
 #include "intel_hdcp.h"
 #include "intel_hdmi.h"
+#include "intel_pipe_crc.h"
 #include "intel_pm.h"
 #include "intel_psr.h"
 #include "intel_sdvo.h"
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 9b8435f9ccaf..5bf36ea9fc08 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -2120,25 +2120,4 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,
 			       struct intel_crtc *intel_crtc,
 			       struct intel_crtc_state *crtc_state);
 
-/* intel_pipe_crc.c */
-#ifdef CONFIG_DEBUG_FS
-int intel_crtc_set_crc_source(struct drm_crtc *crtc, const char *source_name);
-int intel_crtc_verify_crc_source(struct drm_crtc *crtc,
-				 const char *source_name, size_t *values_cnt);
-const char *const *intel_crtc_get_crc_sources(struct drm_crtc *crtc,
-					      size_t *count);
-void intel_crtc_disable_pipe_crc(struct intel_crtc *crtc);
-void intel_crtc_enable_pipe_crc(struct intel_crtc *crtc);
-#else
-#define intel_crtc_set_crc_source NULL
-#define intel_crtc_verify_crc_source NULL
-#define intel_crtc_get_crc_sources NULL
-static inline void intel_crtc_disable_pipe_crc(struct intel_crtc *crtc)
-{
-}
-
-static inline void intel_crtc_enable_pipe_crc(struct intel_crtc *crtc)
-{
-}
-#endif
 #endif /* __INTEL_DRV_H__ */
diff --git a/drivers/gpu/drm/i915/intel_pipe_crc.h b/drivers/gpu/drm/i915/intel_pipe_crc.h
new file mode 100644
index 000000000000..81eaf1854788
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_pipe_crc.h
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_PIPE_CRC_H__
+#define __INTEL_PIPE_CRC_H__
+
+#include <linux/types.h>
+
+struct drm_crtc;
+struct intel_crtc;
+
+#ifdef CONFIG_DEBUG_FS
+int intel_crtc_set_crc_source(struct drm_crtc *crtc, const char *source_name);
+int intel_crtc_verify_crc_source(struct drm_crtc *crtc,
+				 const char *source_name, size_t *values_cnt);
+const char *const *intel_crtc_get_crc_sources(struct drm_crtc *crtc,
+					      size_t *count);
+void intel_crtc_disable_pipe_crc(struct intel_crtc *crtc);
+void intel_crtc_enable_pipe_crc(struct intel_crtc *crtc);
+#else
+#define intel_crtc_set_crc_source NULL
+#define intel_crtc_verify_crc_source NULL
+#define intel_crtc_get_crc_sources NULL
+static inline void intel_crtc_disable_pipe_crc(struct intel_crtc *crtc)
+{
+}
+
+static inline void intel_crtc_enable_pipe_crc(struct intel_crtc *crtc)
+{
+}
+#endif
+
+#endif /* __INTEL_PIPE_CRC_H__ */
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 20/25] drm/i915: extract intel_tv.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (18 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 19/25] drm/i915: extract intel_pipe_crc.h " Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 21/25] drm/i915: extract intel_lvds.h " Jani Nikula
                   ` (8 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/intel_display.c      |  1 +
 drivers/gpu/drm/i915/intel_drv.h          |  3 ---
 drivers/gpu/drm/i915/intel_tv.h           | 13 +++++++++++++
 4 files changed, 15 insertions(+), 3 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_tv.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index 2724ccff61ea..595d9b34d866 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -29,6 +29,7 @@ header_test := \
 	intel_pm.h \
 	intel_psr.h \
 	intel_sdvo.h \
+	intel_tv.h \
 	intel_workarounds_types.h
 
 quiet_cmd_header_test = HDRTEST $@
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 77348a9e68e7..5f4771d0f489 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -64,6 +64,7 @@
 #include "intel_pm.h"
 #include "intel_psr.h"
 #include "intel_sdvo.h"
+#include "intel_tv.h"
 
 /* Primary plane formats for gen <= 3 */
 static const u32 i8xx_primary_formats[] = {
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 5bf36ea9fc08..fab363d9af2e 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -2081,9 +2081,6 @@ static inline bool icl_is_hdr_plane(struct drm_i915_private *dev_priv,
 	return plane_id < PLANE_SPRITE2;
 }
 
-/* intel_tv.c */
-void intel_tv_init(struct drm_i915_private *dev_priv);
-
 /* intel_atomic.c */
 int intel_digital_connector_atomic_get_property(struct drm_connector *connector,
 						const struct drm_connector_state *state,
diff --git a/drivers/gpu/drm/i915/intel_tv.h b/drivers/gpu/drm/i915/intel_tv.h
new file mode 100644
index 000000000000..44518575ec5c
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_tv.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_TV_H__
+#define __INTEL_TV_H__
+
+struct drm_i915_private;
+
+void intel_tv_init(struct drm_i915_private *dev_priv);
+
+#endif /* __INTEL_TV_H__ */
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 21/25] drm/i915: extract intel_lvds.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (19 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 20/25] drm/i915: extract intel_tv.h " Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 22/25] drm/i915: extract intel_dvo.h " Jani Nikula
                   ` (7 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/intel_display.c      |  1 +
 drivers/gpu/drm/i915/intel_dp.c           |  1 +
 drivers/gpu/drm/i915/intel_drv.h          |  7 -------
 drivers/gpu/drm/i915/intel_lvds.h         | 22 ++++++++++++++++++++++
 5 files changed, 25 insertions(+), 7 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_lvds.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index 595d9b34d866..486ad9679d7f 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -24,6 +24,7 @@ header_test := \
 	intel_hdcp.h \
 	intel_hdmi.h \
 	intel_lspcon.h \
+	intel_lvds.h \
 	intel_panel.h \
 	intel_pipe_crc.h \
 	intel_pm.h \
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 5f4771d0f489..806fe9db2de8 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -60,6 +60,7 @@
 #include "intel_frontbuffer.h"
 #include "intel_hdcp.h"
 #include "intel_hdmi.h"
+#include "intel_lvds.h"
 #include "intel_pipe_crc.h"
 #include "intel_pm.h"
 #include "intel_psr.h"
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index a5eeb1b89376..c4e36759a756 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -50,6 +50,7 @@
 #include "intel_hdcp.h"
 #include "intel_hdmi.h"
 #include "intel_lspcon.h"
+#include "intel_lvds.h"
 #include "intel_panel.h"
 #include "intel_psr.h"
 
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index fab363d9af2e..75035d663491 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1880,13 +1880,6 @@ void intel_hpd_poll_init(struct drm_i915_private *dev_priv);
 bool intel_encoder_hotplug(struct intel_encoder *encoder,
 			   struct intel_connector *connector);
 
-/* intel_lvds.c */
-bool intel_lvds_port_enabled(struct drm_i915_private *dev_priv,
-			     i915_reg_t lvds_reg, enum pipe *pipe);
-void intel_lvds_init(struct drm_i915_private *dev_priv);
-struct intel_encoder *intel_get_lvds_encoder(struct drm_i915_private *dev_priv);
-bool intel_is_dual_link_lvds(struct drm_i915_private *dev_priv);
-
 /* intel_overlay.c */
 void intel_overlay_setup(struct drm_i915_private *dev_priv);
 void intel_overlay_cleanup(struct drm_i915_private *dev_priv);
diff --git a/drivers/gpu/drm/i915/intel_lvds.h b/drivers/gpu/drm/i915/intel_lvds.h
new file mode 100644
index 000000000000..bc9c8b84ba2f
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_lvds.h
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_LVDS_H__
+#define __INTEL_LVDS_H__
+
+#include <linux/types.h>
+
+#include "i915_reg.h"
+
+enum pipe;
+struct drm_i915_private;
+
+bool intel_lvds_port_enabled(struct drm_i915_private *dev_priv,
+			     i915_reg_t lvds_reg, enum pipe *pipe);
+void intel_lvds_init(struct drm_i915_private *dev_priv);
+struct intel_encoder *intel_get_lvds_encoder(struct drm_i915_private *dev_priv);
+bool intel_is_dual_link_lvds(struct drm_i915_private *dev_priv);
+
+#endif /* __INTEL_LVDS_H__ */
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 22/25] drm/i915: extract intel_dvo.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (20 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 21/25] drm/i915: extract intel_lvds.h " Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 23/25] drm/i915: extract intel_sprite.h " Jani Nikula
                   ` (6 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/intel_display.c      |  1 +
 drivers/gpu/drm/i915/intel_drv.h          |  2 --
 drivers/gpu/drm/i915/intel_dvo.h          | 13 +++++++++++++
 4 files changed, 15 insertions(+), 2 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_dvo.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index 486ad9679d7f..24cfbb5c0f51 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -17,6 +17,7 @@ header_test := \
 	intel_csr.h \
 	intel_ddi.h \
 	intel_dp.h \
+	intel_dvo.h \
 	intel_engine_types.h \
 	intel_fbc.h \
 	intel_fbdev.h \
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 806fe9db2de8..4c465a3eb7a1 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -55,6 +55,7 @@
 #include "intel_dp.h"
 #include "intel_drv.h"
 #include "intel_dsi.h"
+#include "intel_dvo.h"
 #include "intel_fbc.h"
 #include "intel_fbdev.h"
 #include "intel_frontbuffer.h"
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 75035d663491..dba3ab28428d 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1873,8 +1873,6 @@ void icl_dsi_init(struct drm_i915_private *dev_priv);
 /* intel_dsi_dcs_backlight.c */
 int intel_dsi_dcs_init_backlight_funcs(struct intel_connector *intel_connector);
 
-/* intel_dvo.c */
-void intel_dvo_init(struct drm_i915_private *dev_priv);
 /* intel_hotplug.c */
 void intel_hpd_poll_init(struct drm_i915_private *dev_priv);
 bool intel_encoder_hotplug(struct intel_encoder *encoder,
diff --git a/drivers/gpu/drm/i915/intel_dvo.h b/drivers/gpu/drm/i915/intel_dvo.h
new file mode 100644
index 000000000000..3ed0fdf8efff
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_dvo.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_DVO_H__
+#define __INTEL_DVO_H__
+
+struct drm_i915_private;
+
+void intel_dvo_init(struct drm_i915_private *dev_priv);
+
+#endif /* __INTEL_DVO_H__ */
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 23/25] drm/i915: extract intel_sprite.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (21 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 22/25] drm/i915: extract intel_dvo.h " Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 24/25] drm/i915: extract intel_cdclk.h " Jani Nikula
                   ` (5 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/i915_drv.c           |  1 +
 drivers/gpu/drm/i915/intel_atomic.c       |  1 +
 drivers/gpu/drm/i915/intel_atomic_plane.c |  1 +
 drivers/gpu/drm/i915/intel_display.c      |  1 +
 drivers/gpu/drm/i915/intel_drv.h          | 35 ---------------
 drivers/gpu/drm/i915/intel_pm.c           |  1 +
 drivers/gpu/drm/i915/intel_psr.c          |  1 +
 drivers/gpu/drm/i915/intel_sprite.c       |  1 +
 drivers/gpu/drm/i915/intel_sprite.h       | 55 +++++++++++++++++++++++
 10 files changed, 63 insertions(+), 35 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_sprite.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index 24cfbb5c0f51..83db8f79e3bc 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -31,6 +31,7 @@ header_test := \
 	intel_pm.h \
 	intel_psr.h \
 	intel_sdvo.h \
+	intel_sprite.h \
 	intel_tv.h \
 	intel_workarounds_types.h
 
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 08a64e5cc869..23f16fd47b4d 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -59,6 +59,7 @@
 #include "intel_drv.h"
 #include "intel_fbdev.h"
 #include "intel_pm.h"
+#include "intel_sprite.h"
 #include "intel_uc.h"
 #include "intel_workarounds.h"
 
diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
index 2cbcf6ac24d8..8c8fae32ec50 100644
--- a/drivers/gpu/drm/i915/intel_atomic.c
+++ b/drivers/gpu/drm/i915/intel_atomic.c
@@ -36,6 +36,7 @@
 
 #include "intel_drv.h"
 #include "intel_hdcp.h"
+#include "intel_sprite.h"
 
 /**
  * intel_digital_connector_atomic_get_property - hook for connector->atomic_get_property.
diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
index 381234ce1bc4..0c662dec9eee 100644
--- a/drivers/gpu/drm/i915/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
@@ -37,6 +37,7 @@
 
 #include "intel_drv.h"
 #include "intel_pm.h"
+#include "intel_sprite.h"
 
 struct intel_plane *intel_plane_alloc(void)
 {
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 4c465a3eb7a1..7d1eb8e2e6a8 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -66,6 +66,7 @@
 #include "intel_pm.h"
 #include "intel_psr.h"
 #include "intel_sdvo.h"
+#include "intel_sprite.h"
 #include "intel_tv.h"
 
 /* Primary plane formats for gen <= 3 */
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index dba3ab28428d..a5f81dcb4380 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -2037,41 +2037,6 @@ void chv_phy_powergate_lanes(struct intel_encoder *encoder,
 bool chv_phy_powergate_ch(struct drm_i915_private *dev_priv, enum dpio_phy phy,
 			  enum dpio_channel ch, bool override);
 
-/* intel_sprite.c */
-bool is_planar_yuv_format(u32 pixelformat);
-int intel_usecs_to_scanlines(const struct drm_display_mode *adjusted_mode,
-			     int usecs);
-struct intel_plane *intel_sprite_plane_create(struct drm_i915_private *dev_priv,
-					      enum pipe pipe, int plane);
-int intel_sprite_set_colorkey_ioctl(struct drm_device *dev, void *data,
-				    struct drm_file *file_priv);
-void intel_pipe_update_start(const struct intel_crtc_state *new_crtc_state);
-void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state);
-int intel_plane_check_stride(const struct intel_plane_state *plane_state);
-int intel_plane_check_src_coordinates(struct intel_plane_state *plane_state);
-int chv_plane_check_rotation(const struct intel_plane_state *plane_state);
-struct intel_plane *
-skl_universal_plane_create(struct drm_i915_private *dev_priv,
-			   enum pipe pipe, enum plane_id plane_id);
-
-static inline bool icl_is_nv12_y_plane(enum plane_id id)
-{
-	/* Don't need to do a gen check, these planes are only available on gen11 */
-	if (id == PLANE_SPRITE4 || id == PLANE_SPRITE5)
-		return true;
-
-	return false;
-}
-
-static inline bool icl_is_hdr_plane(struct drm_i915_private *dev_priv,
-				    enum plane_id plane_id)
-{
-	if (INTEL_GEN(dev_priv) < 11)
-		return false;
-
-	return plane_id < PLANE_SPRITE2;
-}
-
 /* intel_atomic.c */
 int intel_digital_connector_atomic_get_property(struct drm_connector *connector,
 						const struct drm_connector_state *state,
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index b48b3e9257d6..bba477e62a12 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -37,6 +37,7 @@
 #include "intel_drv.h"
 #include "intel_fbc.h"
 #include "intel_pm.h"
+#include "intel_sprite.h"
 #include "../../../platform/x86/intel_ips.h"
 
 /**
diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
index 30016e054344..aacf5c6f6d95 100644
--- a/drivers/gpu/drm/i915/intel_psr.c
+++ b/drivers/gpu/drm/i915/intel_psr.c
@@ -27,6 +27,7 @@
 #include "intel_dp.h"
 #include "intel_drv.h"
 #include "intel_psr.h"
+#include "intel_sprite.h"
 
 /**
  * DOC: Panel Self Refresh (PSR/SRD)
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 50ba32eaee9e..2913e89280d7 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -45,6 +45,7 @@
 #include "intel_frontbuffer.h"
 #include "intel_pm.h"
 #include "intel_psr.h"
+#include "intel_sprite.h"
 
 bool is_planar_yuv_format(u32 pixelformat)
 {
diff --git a/drivers/gpu/drm/i915/intel_sprite.h b/drivers/gpu/drm/i915/intel_sprite.h
new file mode 100644
index 000000000000..84be8686be16
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_sprite.h
@@ -0,0 +1,55 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_SPRITE_H__
+#define __INTEL_SPRITE_H__
+
+#include <linux/types.h>
+
+#include "i915_drv.h"
+#include "intel_display.h"
+
+struct drm_device;
+struct drm_display_mode;
+struct drm_file;
+struct drm_i915_private;
+struct intel_crtc_state;
+struct intel_plane_state;
+
+bool is_planar_yuv_format(u32 pixelformat);
+int intel_usecs_to_scanlines(const struct drm_display_mode *adjusted_mode,
+			     int usecs);
+struct intel_plane *intel_sprite_plane_create(struct drm_i915_private *dev_priv,
+					      enum pipe pipe, int plane);
+int intel_sprite_set_colorkey_ioctl(struct drm_device *dev, void *data,
+				    struct drm_file *file_priv);
+void intel_pipe_update_start(const struct intel_crtc_state *new_crtc_state);
+void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state);
+int intel_plane_check_stride(const struct intel_plane_state *plane_state);
+int intel_plane_check_src_coordinates(struct intel_plane_state *plane_state);
+int chv_plane_check_rotation(const struct intel_plane_state *plane_state);
+struct intel_plane *
+skl_universal_plane_create(struct drm_i915_private *dev_priv,
+			   enum pipe pipe, enum plane_id plane_id);
+
+static inline bool icl_is_nv12_y_plane(enum plane_id id)
+{
+	/* Don't need to do a gen check, these planes are only available on gen11 */
+	if (id == PLANE_SPRITE4 || id == PLANE_SPRITE5)
+		return true;
+
+	return false;
+}
+
+static inline bool icl_is_hdr_plane(struct drm_i915_private *dev_priv,
+				    enum plane_id plane_id)
+{
+	if (INTEL_GEN(dev_priv) < 11)
+		return false;
+
+	return plane_id < PLANE_SPRITE2;
+}
+
+#endif /* __INTEL_SPRITE_H__ */
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 24/25] drm/i915: extract intel_cdclk.h from intel_drv.h
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (22 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 23/25] drm/i915: extract intel_sprite.h " Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:14 ` [PATCH 25/25] drm/i915/cdclk: have only one init/uninit function Jani Nikula
                   ` (4 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/i915_drv.c           |  1 +
 drivers/gpu/drm/i915/intel_cdclk.c        |  1 +
 drivers/gpu/drm/i915/intel_cdclk.h        | 52 +++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_display.c      |  1 +
 drivers/gpu/drm/i915/intel_drv.h          | 35 ---------------
 drivers/gpu/drm/i915/intel_runtime_pm.c   |  1 +
 7 files changed, 57 insertions(+), 35 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_cdclk.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index 83db8f79e3bc..c1c391816fa7 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -10,6 +10,7 @@ header_test := \
 	i915_timeline_types.h \
 	intel_atomic_plane.h \
 	intel_audio.h \
+	intel_cdclk.h \
 	intel_color.h \
 	intel_connector.h \
 	intel_context_types.h \
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 23f16fd47b4d..402acdb953c4 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -54,6 +54,7 @@
 #include "i915_trace.h"
 #include "i915_vgpu.h"
 #include "intel_audio.h"
+#include "intel_cdclk.h"
 #include "intel_csr.h"
 #include "intel_dp.h"
 #include "intel_drv.h"
diff --git a/drivers/gpu/drm/i915/intel_cdclk.c b/drivers/gpu/drm/i915/intel_cdclk.c
index b911fe86be56..c6e163d26158 100644
--- a/drivers/gpu/drm/i915/intel_cdclk.c
+++ b/drivers/gpu/drm/i915/intel_cdclk.c
@@ -21,6 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
+#include "intel_cdclk.h"
 #include "intel_drv.h"
 
 /**
diff --git a/drivers/gpu/drm/i915/intel_cdclk.h b/drivers/gpu/drm/i915/intel_cdclk.h
new file mode 100644
index 000000000000..ae4a60b76756
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_cdclk.h
@@ -0,0 +1,52 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_CDCLK_H__
+#define __INTEL_CDCLK_H__
+
+#include <linux/types.h>
+
+#include "intel_display.h"
+
+struct drm_i915_private;
+struct intel_atomic_state;
+struct intel_cdclk_state;
+struct intel_crtc_state;
+
+int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state);
+void skl_init_cdclk(struct drm_i915_private *dev_priv);
+void skl_uninit_cdclk(struct drm_i915_private *dev_priv);
+void cnl_init_cdclk(struct drm_i915_private *dev_priv);
+void cnl_uninit_cdclk(struct drm_i915_private *dev_priv);
+void bxt_init_cdclk(struct drm_i915_private *dev_priv);
+void bxt_uninit_cdclk(struct drm_i915_private *dev_priv);
+void icl_init_cdclk(struct drm_i915_private *dev_priv);
+void icl_uninit_cdclk(struct drm_i915_private *dev_priv);
+void intel_init_cdclk_hooks(struct drm_i915_private *dev_priv);
+void intel_update_max_cdclk(struct drm_i915_private *dev_priv);
+void intel_update_cdclk(struct drm_i915_private *dev_priv);
+void intel_update_rawclk(struct drm_i915_private *dev_priv);
+bool intel_cdclk_needs_cd2x_update(struct drm_i915_private *dev_priv,
+				   const struct intel_cdclk_state *a,
+				   const struct intel_cdclk_state *b);
+bool intel_cdclk_needs_modeset(const struct intel_cdclk_state *a,
+			       const struct intel_cdclk_state *b);
+bool intel_cdclk_changed(const struct intel_cdclk_state *a,
+			 const struct intel_cdclk_state *b);
+void intel_cdclk_swap_state(struct intel_atomic_state *state);
+void
+intel_set_cdclk_pre_plane_update(struct drm_i915_private *dev_priv,
+				 const struct intel_cdclk_state *old_state,
+				 const struct intel_cdclk_state *new_state,
+				 enum pipe pipe);
+void
+intel_set_cdclk_post_plane_update(struct drm_i915_private *dev_priv,
+				  const struct intel_cdclk_state *old_state,
+				  const struct intel_cdclk_state *new_state,
+				  enum pipe pipe);
+void intel_dump_cdclk_state(const struct intel_cdclk_state *cdclk_state,
+			    const char *context);
+
+#endif /* __INTEL_CDCLK_H__ */
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 7d1eb8e2e6a8..f8938b5a4936 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -50,6 +50,7 @@
 #include "i915_trace.h"
 #include "intel_atomic_plane.h"
 #include "intel_color.h"
+#include "intel_cdclk.h"
 #include "intel_crt.h"
 #include "intel_ddi.h"
 #include "intel_dp.h"
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index a5f81dcb4380..a69654ff0288 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1628,41 +1628,6 @@ void gen9_reset_guc_interrupts(struct drm_i915_private *dev_priv);
 void gen9_enable_guc_interrupts(struct drm_i915_private *dev_priv);
 void gen9_disable_guc_interrupts(struct drm_i915_private *dev_priv);
 
-/* intel_cdclk.c */
-int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state);
-void skl_init_cdclk(struct drm_i915_private *dev_priv);
-void skl_uninit_cdclk(struct drm_i915_private *dev_priv);
-void cnl_init_cdclk(struct drm_i915_private *dev_priv);
-void cnl_uninit_cdclk(struct drm_i915_private *dev_priv);
-void bxt_init_cdclk(struct drm_i915_private *dev_priv);
-void bxt_uninit_cdclk(struct drm_i915_private *dev_priv);
-void icl_init_cdclk(struct drm_i915_private *dev_priv);
-void icl_uninit_cdclk(struct drm_i915_private *dev_priv);
-void intel_init_cdclk_hooks(struct drm_i915_private *dev_priv);
-void intel_update_max_cdclk(struct drm_i915_private *dev_priv);
-void intel_update_cdclk(struct drm_i915_private *dev_priv);
-void intel_update_rawclk(struct drm_i915_private *dev_priv);
-bool intel_cdclk_needs_cd2x_update(struct drm_i915_private *dev_priv,
-				   const struct intel_cdclk_state *a,
-				   const struct intel_cdclk_state *b);
-bool intel_cdclk_needs_modeset(const struct intel_cdclk_state *a,
-			       const struct intel_cdclk_state *b);
-bool intel_cdclk_changed(const struct intel_cdclk_state *a,
-			 const struct intel_cdclk_state *b);
-void intel_cdclk_swap_state(struct intel_atomic_state *state);
-void
-intel_set_cdclk_pre_plane_update(struct drm_i915_private *dev_priv,
-				 const struct intel_cdclk_state *old_state,
-				 const struct intel_cdclk_state *new_state,
-				 enum pipe pipe);
-void
-intel_set_cdclk_post_plane_update(struct drm_i915_private *dev_priv,
-				  const struct intel_cdclk_state *old_state,
-				  const struct intel_cdclk_state *new_state,
-				  enum pipe pipe);
-void intel_dump_cdclk_state(const struct intel_cdclk_state *cdclk_state,
-			    const char *context);
-
 /* intel_display.c */
 void intel_plane_destroy(struct drm_plane *plane);
 void i830_enable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe);
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index d78256116cb8..606f7a1074d8 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -32,6 +32,7 @@
 #include <drm/drm_print.h>
 
 #include "i915_drv.h"
+#include "intel_cdclk.h"
 #include "intel_crt.h"
 #include "intel_csr.h"
 #include "intel_dp.h"
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 25/25] drm/i915/cdclk: have only one init/uninit function
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (23 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 24/25] drm/i915: extract intel_cdclk.h " Jani Nikula
@ 2019-04-04 21:14 ` Jani Nikula
  2019-04-04 21:32 ` [PATCH 00/25] drm/i915: the great header refactoring, part one Chris Wilson
                   ` (3 subsequent siblings)
  28 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

While transitioning to having better clarity between the modules, it's
desirable to have the function name prefixes reflect the
module. Functions in intel_foo.c should be prefixed intel_foo_.

Expose only one CDCLK init/uninit function from intel_cdclk.c instead of
one per platform. Obviously this adds one "unnecessary" if ladder within
the entry points. However it should be considered more of a CDCLK
implementation detail how this is done per platform, instead of exposing
the fact. In other words, abstract the CDCLK module better.

No functional changes.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_cdclk.c      | 120 ++++++++++--------------
 drivers/gpu/drm/i915/intel_cdclk.h      |  10 +-
 drivers/gpu/drm/i915/intel_runtime_pm.c |  16 ++--
 3 files changed, 58 insertions(+), 88 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_cdclk.c b/drivers/gpu/drm/i915/intel_cdclk.c
index c6e163d26158..7f060eaf1b17 100644
--- a/drivers/gpu/drm/i915/intel_cdclk.c
+++ b/drivers/gpu/drm/i915/intel_cdclk.c
@@ -1129,16 +1129,7 @@ static void skl_sanitize_cdclk(struct drm_i915_private *dev_priv)
 	dev_priv->cdclk.hw.vco = -1;
 }
 
-/**
- * skl_init_cdclk - Initialize CDCLK on SKL
- * @dev_priv: i915 device
- *
- * Initialize CDCLK for SKL and derivatives. This is generally
- * done only during the display core initialization sequence,
- * after which the DMC will take care of turning CDCLK off/on
- * as needed.
- */
-void skl_init_cdclk(struct drm_i915_private *dev_priv)
+static void skl_init_cdclk(struct drm_i915_private *dev_priv)
 {
 	struct intel_cdclk_state cdclk_state;
 
@@ -1167,14 +1158,7 @@ void skl_init_cdclk(struct drm_i915_private *dev_priv)
 	skl_set_cdclk(dev_priv, &cdclk_state, INVALID_PIPE);
 }
 
-/**
- * skl_uninit_cdclk - Uninitialize CDCLK on SKL
- * @dev_priv: i915 device
- *
- * Uninitialize CDCLK for SKL and derivatives. This is done only
- * during the display core uninitialization sequence.
- */
-void skl_uninit_cdclk(struct drm_i915_private *dev_priv)
+static void skl_uninit_cdclk(struct drm_i915_private *dev_priv)
 {
 	struct intel_cdclk_state cdclk_state = dev_priv->cdclk.hw;
 
@@ -1499,16 +1483,7 @@ static void bxt_sanitize_cdclk(struct drm_i915_private *dev_priv)
 	dev_priv->cdclk.hw.vco = -1;
 }
 
-/**
- * bxt_init_cdclk - Initialize CDCLK on BXT
- * @dev_priv: i915 device
- *
- * Initialize CDCLK for BXT and derivatives. This is generally
- * done only during the display core initialization sequence,
- * after which the DMC will take care of turning CDCLK off/on
- * as needed.
- */
-void bxt_init_cdclk(struct drm_i915_private *dev_priv)
+static void bxt_init_cdclk(struct drm_i915_private *dev_priv)
 {
 	struct intel_cdclk_state cdclk_state;
 
@@ -1537,14 +1512,7 @@ void bxt_init_cdclk(struct drm_i915_private *dev_priv)
 	bxt_set_cdclk(dev_priv, &cdclk_state, INVALID_PIPE);
 }
 
-/**
- * bxt_uninit_cdclk - Uninitialize CDCLK on BXT
- * @dev_priv: i915 device
- *
- * Uninitialize CDCLK for BXT and derivatives. This is done only
- * during the display core uninitialization sequence.
- */
-void bxt_uninit_cdclk(struct drm_i915_private *dev_priv)
+static void bxt_uninit_cdclk(struct drm_i915_private *dev_priv)
 {
 	struct intel_cdclk_state cdclk_state = dev_priv->cdclk.hw;
 
@@ -1977,16 +1945,7 @@ static void icl_get_cdclk(struct drm_i915_private *dev_priv,
 		icl_calc_voltage_level(cdclk_state->cdclk);
 }
 
-/**
- * icl_init_cdclk - Initialize CDCLK on ICL
- * @dev_priv: i915 device
- *
- * Initialize CDCLK for ICL. This consists mainly of initializing
- * dev_priv->cdclk.hw and sanitizing the state of the hardware if needed. This
- * is generally done only during the display core initialization sequence, after
- * which the DMC will take care of turning CDCLK off/on as needed.
- */
-void icl_init_cdclk(struct drm_i915_private *dev_priv)
+static void icl_init_cdclk(struct drm_i915_private *dev_priv)
 {
 	struct intel_cdclk_state sanitized_state;
 	u32 val;
@@ -2023,14 +1982,7 @@ void icl_init_cdclk(struct drm_i915_private *dev_priv)
 	icl_set_cdclk(dev_priv, &sanitized_state, INVALID_PIPE);
 }
 
-/**
- * icl_uninit_cdclk - Uninitialize CDCLK on ICL
- * @dev_priv: i915 device
- *
- * Uninitialize CDCLK for ICL. This is done only during the display core
- * uninitialization sequence.
- */
-void icl_uninit_cdclk(struct drm_i915_private *dev_priv)
+static void icl_uninit_cdclk(struct drm_i915_private *dev_priv)
 {
 	struct intel_cdclk_state cdclk_state = dev_priv->cdclk.hw;
 
@@ -2041,16 +1993,7 @@ void icl_uninit_cdclk(struct drm_i915_private *dev_priv)
 	icl_set_cdclk(dev_priv, &cdclk_state, INVALID_PIPE);
 }
 
-/**
- * cnl_init_cdclk - Initialize CDCLK on CNL
- * @dev_priv: i915 device
- *
- * Initialize CDCLK for CNL. This is generally
- * done only during the display core initialization sequence,
- * after which the DMC will take care of turning CDCLK off/on
- * as needed.
- */
-void cnl_init_cdclk(struct drm_i915_private *dev_priv)
+static void cnl_init_cdclk(struct drm_i915_private *dev_priv)
 {
 	struct intel_cdclk_state cdclk_state;
 
@@ -2069,14 +2012,7 @@ void cnl_init_cdclk(struct drm_i915_private *dev_priv)
 	cnl_set_cdclk(dev_priv, &cdclk_state, INVALID_PIPE);
 }
 
-/**
- * cnl_uninit_cdclk - Uninitialize CDCLK on CNL
- * @dev_priv: i915 device
- *
- * Uninitialize CDCLK for CNL. This is done only
- * during the display core uninitialization sequence.
- */
-void cnl_uninit_cdclk(struct drm_i915_private *dev_priv)
+static void cnl_uninit_cdclk(struct drm_i915_private *dev_priv)
 {
 	struct intel_cdclk_state cdclk_state = dev_priv->cdclk.hw;
 
@@ -2087,6 +2023,46 @@ void cnl_uninit_cdclk(struct drm_i915_private *dev_priv)
 	cnl_set_cdclk(dev_priv, &cdclk_state, INVALID_PIPE);
 }
 
+/**
+ * intel_cdclk_init - Initialize CDCLK
+ * @i915: i915 device
+ *
+ * Initialize CDCLK. This consists mainly of initializing dev_priv->cdclk.hw and
+ * sanitizing the state of the hardware if needed. This is generally done only
+ * during the display core initialization sequence, after which the DMC will
+ * take care of turning CDCLK off/on as needed.
+ */
+void intel_cdclk_init(struct drm_i915_private *i915)
+{
+	if (IS_ICELAKE(i915))
+		icl_init_cdclk(i915);
+	else if (IS_CANNONLAKE(i915))
+		cnl_init_cdclk(i915);
+	else if (IS_GEN9_BC(i915))
+		skl_init_cdclk(i915);
+	else if (IS_GEN9_LP(i915))
+		bxt_init_cdclk(i915);
+}
+
+/**
+ * intel_cdclk_uninit - Uninitialize CDCLK
+ * @i915: i915 device
+ *
+ * Uninitialize CDCLK. This is done only during the display core
+ * uninitialization sequence.
+ */
+void intel_cdclk_uninit(struct drm_i915_private *i915)
+{
+	if (IS_ICELAKE(i915))
+		icl_uninit_cdclk(i915);
+	else if (IS_CANNONLAKE(i915))
+		cnl_uninit_cdclk(i915);
+	else if (IS_GEN9_BC(i915))
+		skl_uninit_cdclk(i915);
+	else if (IS_GEN9_LP(i915))
+		bxt_uninit_cdclk(i915);
+}
+
 /**
  * intel_cdclk_needs_modeset - Determine if two CDCLK states require a modeset on all pipes
  * @a: first CDCLK state
diff --git a/drivers/gpu/drm/i915/intel_cdclk.h b/drivers/gpu/drm/i915/intel_cdclk.h
index ae4a60b76756..4d6f7f5f8930 100644
--- a/drivers/gpu/drm/i915/intel_cdclk.h
+++ b/drivers/gpu/drm/i915/intel_cdclk.h
@@ -16,14 +16,8 @@ struct intel_cdclk_state;
 struct intel_crtc_state;
 
 int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state);
-void skl_init_cdclk(struct drm_i915_private *dev_priv);
-void skl_uninit_cdclk(struct drm_i915_private *dev_priv);
-void cnl_init_cdclk(struct drm_i915_private *dev_priv);
-void cnl_uninit_cdclk(struct drm_i915_private *dev_priv);
-void bxt_init_cdclk(struct drm_i915_private *dev_priv);
-void bxt_uninit_cdclk(struct drm_i915_private *dev_priv);
-void icl_init_cdclk(struct drm_i915_private *dev_priv);
-void icl_uninit_cdclk(struct drm_i915_private *dev_priv);
+void intel_cdclk_init(struct drm_i915_private *i915);
+void intel_cdclk_uninit(struct drm_i915_private *i915);
 void intel_init_cdclk_hooks(struct drm_i915_private *dev_priv);
 void intel_update_max_cdclk(struct drm_i915_private *dev_priv);
 void intel_update_cdclk(struct drm_i915_private *dev_priv);
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index 606f7a1074d8..e6d1e592225b 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -3664,7 +3664,7 @@ static void skl_display_core_init(struct drm_i915_private *dev_priv,
 
 	mutex_unlock(&power_domains->lock);
 
-	skl_init_cdclk(dev_priv);
+	intel_cdclk_init(dev_priv);
 
 	gen9_dbuf_enable(dev_priv);
 
@@ -3681,7 +3681,7 @@ static void skl_display_core_uninit(struct drm_i915_private *dev_priv)
 
 	gen9_dbuf_disable(dev_priv);
 
-	skl_uninit_cdclk(dev_priv);
+	intel_cdclk_uninit(dev_priv);
 
 	/* The spec doesn't call for removing the reset handshake flag */
 	/* disable PG1 and Misc I/O */
@@ -3726,7 +3726,7 @@ void bxt_display_core_init(struct drm_i915_private *dev_priv,
 
 	mutex_unlock(&power_domains->lock);
 
-	bxt_init_cdclk(dev_priv);
+	intel_cdclk_init(dev_priv);
 
 	gen9_dbuf_enable(dev_priv);
 
@@ -3743,7 +3743,7 @@ void bxt_display_core_uninit(struct drm_i915_private *dev_priv)
 
 	gen9_dbuf_disable(dev_priv);
 
-	bxt_uninit_cdclk(dev_priv);
+	intel_cdclk_uninit(dev_priv);
 
 	/* The spec doesn't call for removing the reset handshake flag */
 
@@ -3785,7 +3785,7 @@ static void cnl_display_core_init(struct drm_i915_private *dev_priv, bool resume
 	mutex_unlock(&power_domains->lock);
 
 	/* 5. Enable CD clock */
-	cnl_init_cdclk(dev_priv);
+	intel_cdclk_init(dev_priv);
 
 	/* 6. Enable DBUF */
 	gen9_dbuf_enable(dev_priv);
@@ -3807,7 +3807,7 @@ static void cnl_display_core_uninit(struct drm_i915_private *dev_priv)
 	gen9_dbuf_disable(dev_priv);
 
 	/* 3. Disable CD clock */
-	cnl_uninit_cdclk(dev_priv);
+	intel_cdclk_uninit(dev_priv);
 
 	/*
 	 * 4. Disable Power Well 1 (PG1).
@@ -3849,7 +3849,7 @@ void icl_display_core_init(struct drm_i915_private *dev_priv,
 	mutex_unlock(&power_domains->lock);
 
 	/* 5. Enable CDCLK. */
-	icl_init_cdclk(dev_priv);
+	intel_cdclk_init(dev_priv);
 
 	/* 6. Enable DBUF. */
 	icl_dbuf_enable(dev_priv);
@@ -3874,7 +3874,7 @@ void icl_display_core_uninit(struct drm_i915_private *dev_priv)
 	icl_dbuf_disable(dev_priv);
 
 	/* 3. Disable CD clock */
-	icl_uninit_cdclk(dev_priv);
+	intel_cdclk_uninit(dev_priv);
 
 	/*
 	 * 4. Disable Power Well 1 (PG1).
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* Re: [PATCH 03/25] drm/i915: extract intel_crt.h from intel_drv.h
  2019-04-04 21:14 ` [PATCH 03/25] drm/i915: extract intel_crt.h " Jani Nikula
@ 2019-04-04 21:22   ` Jani Nikula
  0 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2019-04-04 21:22 UTC (permalink / raw)
  To: intel-gfx

On Fri, 05 Apr 2019, Jani Nikula <jani.nikula@intel.com> wrote:
> 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.

The tabs are a copy-paste fail that happen to align so that I didn't
spot them in either git log or looking at the patches before
sending. Ugh.

BR,
Jani.

>
> 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.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/Makefile.header-test |  1 +
>  drivers/gpu/drm/i915/intel_crt.c          |  5 ++++-
>  drivers/gpu/drm/i915/intel_crt.h          | 21 +++++++++++++++++++++
>  drivers/gpu/drm/i915/intel_display.c      | 11 ++---------
>  drivers/gpu/drm/i915/intel_drv.h          |  6 ------
>  drivers/gpu/drm/i915/intel_runtime_pm.c   |  1 +
>  6 files changed, 29 insertions(+), 16 deletions(-)
>  create mode 100644 drivers/gpu/drm/i915/intel_crt.h
>
> diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
> index 09bba7c9376c..fd0f33ea896d 100644
> --- a/drivers/gpu/drm/i915/Makefile.header-test
> +++ b/drivers/gpu/drm/i915/Makefile.header-test
> @@ -10,6 +10,7 @@ header_test := \
>  	i915_timeline_types.h \
>  	intel_audio.h \
>  	intel_context_types.h \
> +	intel_crt.h \
>  	intel_engine_types.h \
>  	intel_frontbuffer.h \
>  	intel_workarounds_types.h
> diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
> index 50530e49982c..a14afbe51b08 100644
> --- a/drivers/gpu/drm/i915/intel_crt.c
> +++ b/drivers/gpu/drm/i915/intel_crt.c
> @@ -27,13 +27,16 @@
>  #include <linux/dmi.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 <drm/drm_probe_helper.h>
> -#include "intel_drv.h"
>  #include <drm/i915_drm.h>
> +
>  #include "i915_drv.h"
> +#include "intel_crt.h"
> +#include "intel_drv.h"
>  
>  /* Here's the desired hotplug mode */
>  #define ADPA_HOTPLUG_BITS (ADPA_CRT_HOTPLUG_PERIOD_128 |		\
> diff --git a/drivers/gpu/drm/i915/intel_crt.h b/drivers/gpu/drm/i915/intel_crt.h
> new file mode 100644
> index 000000000000..1b3fba359efc
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/intel_crt.h
> @@ -0,0 +1,21 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2019 Intel Corporation
> + */
> +
> +#ifndef __INTEL_CRT_H__
> +#define __INTEL_CRT_H__
> +
> +#include "i915_reg.h"
> +
> +enum pipe;
> +struct drm_encoder;
> +struct drm_i915_private;
> +struct drm_i915_private;
> +
> +bool intel_crt_port_enabled(struct drm_i915_private *dev_priv,
> +			    i915_reg_t adpa_reg, enum pipe *pipe);
> +void intel_crt_init(struct drm_i915_private *dev_priv);
> +void intel_crt_reset(struct drm_encoder *encoder);
> +
> +#endif /* __INTEL_CRT_H__ */
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 7ecfb7d98839..5cf82dbead65 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -46,20 +46,13 @@
>  
>  #include "i915_drv.h"
>  #include "i915_gem_clflush.h"
> +#include "i915_reset.h"
>  #include "i915_trace.h"
> +#include "intel_crt.h"
>  #include "intel_drv.h"
>  #include "intel_dsi.h"
>  #include "intel_frontbuffer.h"
>  
> -#include "intel_drv.h"
> -#include "intel_dsi.h"
> -#include "intel_frontbuffer.h"
> -
> -#include "i915_drv.h"
> -#include "i915_gem_clflush.h"
> -#include "i915_reset.h"
> -#include "i915_trace.h"
> -
>  /* Primary plane formats for gen <= 3 */
>  static const u32 i8xx_primary_formats[] = {
>  	DRM_FORMAT_C8,
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 5dc434d74ada..847da5b24548 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1627,12 +1627,6 @@ void gen9_reset_guc_interrupts(struct drm_i915_private *dev_priv);
>  void gen9_enable_guc_interrupts(struct drm_i915_private *dev_priv);
>  void gen9_disable_guc_interrupts(struct drm_i915_private *dev_priv);
>  
> -/* intel_crt.c */
> -bool intel_crt_port_enabled(struct drm_i915_private *dev_priv,
> -			    i915_reg_t adpa_reg, enum pipe *pipe);
> -void intel_crt_init(struct drm_i915_private *dev_priv);
> -void intel_crt_reset(struct drm_encoder *encoder);
> -
>  /* intel_ddi.c */
>  void intel_ddi_fdi_post_disable(struct intel_encoder *intel_encoder,
>  				const struct intel_crtc_state *old_crtc_state,
> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
> index 40ddfbb97acb..a9931081462b 100644
> --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> @@ -32,6 +32,7 @@
>  #include <drm/drm_print.h>
>  
>  #include "i915_drv.h"
> +#include "intel_crt.h"
>  #include "intel_drv.h"
>  
>  /**

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 07/25] drm/i915: extract intel_fbc.h from intel_drv.h
  2019-04-04 21:14 ` [PATCH 07/25] drm/i915: extract intel_fbc.h " Jani Nikula
@ 2019-04-04 21:22   ` Chris Wilson
  0 siblings, 0 replies; 33+ messages in thread
From: Chris Wilson @ 2019-04-04 21:22 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

Quoting Jani Nikula (2019-04-04 22:14:31)
> diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
> index d2f2a9c2fabd..eec48d856adb 100644
> --- a/drivers/gpu/drm/i915/i915_suspend.c
> +++ b/drivers/gpu/drm/i915/i915_suspend.c
> @@ -24,9 +24,12 @@
>   * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
>   */
>  
> +

Stray

>  #include <drm/i915_drm.h>
> -#include "intel_drv.h"
> +
>  #include "i915_reg.h"
> +#include "intel_drv.h"
> +#include "intel_fbc.h"
>  
>  static void i915_save_display(struct drm_i915_private *dev_priv)
>  {
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 00/25] drm/i915: the great header refactoring, part one
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (24 preceding siblings ...)
  2019-04-04 21:14 ` [PATCH 25/25] drm/i915/cdclk: have only one init/uninit function Jani Nikula
@ 2019-04-04 21:32 ` Chris Wilson
  2019-04-05  7:50   ` Joonas Lahtinen
  2019-04-04 21:48 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
                   ` (2 subsequent siblings)
  28 siblings, 1 reply; 33+ messages in thread
From: Chris Wilson @ 2019-04-04 21:32 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

Quoting Jani Nikula (2019-04-04 22:14:24)
> intel_drv.h has grown out of proportions, and turned into a dumping
> ground. Way back when it was useful to have only a handful of headers,
> but we're long past that.
> 
> Start splitting off per-module headers. The basic principles:
> 
> * Make the new headers self-contained (i.e. can be compiled without
>   including other headers first), and test this using the new infra for
>   that.
> 
> * Use minimal includes for making the headers self-contained. Use
>   forward declarations for structs where applicable, and e.g. include
>   <linux/types.h> instead of <linux/kernel.h>.
> 
> * Only split off the headers, and mostly refrain from doing other
>   refactoring while at it. (There are a few minor things.)
> 
> * Mostly only split off function declarations. Splitting off types is
>   left for follow-up work.
> 
> * Include the new headers only where needed. This leads to a lot of
>   includes here and there, but on the other hand increases the clarity
>   of the relationships between the modules. (And already raises a bunch
>   of questions about the split and cross-calls between some
>   modules. It'll be easier to analyze this.)
> 
> * Wherever adding new includes, group the includes by <linux/...> first,
>   then <drm/...>, then "...", and sort the groups alphabetically.
> 
> * Choice of what to extract first here is purely arbitrary.
> 
> * Follow-up work should consider renaming functions according to the
>   module, i.e. functions in intel_foo.c should be prefixed
>   intel_foo_. Better naming will be helpful in further organizing the
>   driver, as well as grasping the structure to begin with.

I wholeheartedly agree. Recent experience shows that with a small number
of very large headers, getting the types defined at the right point is
much harder than with small scoped headers. (And don't get me started on
trying to avoid circular definitions for inlines.)

The counterpoint is that it can be harder to find the right header. But
it's no harder than trying to find the right c-file, and if we keep to
the rule that object-name.c is accompanied by object-name.h, once you
know object name, it is easy to find.

> Jani Nikula (25):
>   drm/i915: make intel_frontbuffer.h self-contained
>   drm/i915: extract intel_audio.h from intel_drv.h
>   drm/i915: extract intel_crt.h from intel_drv.h
>   drm/i915: extract intel_ddi.h from intel_drv.h
>   drm/i915: extract intel_connector.h from intel_drv.h
>   drm/i915: extract intel_csr.h from intel_drv.h
>   drm/i915: extract intel_fbc.h from intel_drv.h
>   drm/i915: extract intel_psr.h from intel_drv.h
>   drm/i915: extract intel_color.h from intel_drv.h
>   drm/i915: extract intel_lspcon.h from intel_drv.h
>   drm/i915: extract intel_sdvo.h from intel_drv.h
>   drm/i915: extract intel_hdcp.h from intel_drv.h
>   drm/i915: extract intel_panel.h from intel_drv.h
>   drm/i915: extract intel_pm.h from intel_drv.h
>   drm/i915: extract intel_fbdev.h from intel_drv.h
>   drm/i915: extract intel_dp.h from intel_drv.h
>   drm/i915: extract intel_hdmi.h from intel_drv.h
>   drm/i915: extract intel_atomic_plane.h from intel_drv.h
>   drm/i915: extract intel_pipe_crc.h from intel_drv.h
>   drm/i915: extract intel_tv.h from intel_drv.h
>   drm/i915: extract intel_lvds.h from intel_drv.h
>   drm/i915: extract intel_dvo.h from intel_drv.h
>   drm/i915: extract intel_sprite.h from intel_drv.h
>   drm/i915: extract intel_cdclk.h from intel_drv.h
>   drm/i915/cdclk: have only one init/uninit function

Read through the patches, and they are just code motion.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

The real work is done by the compiler.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 33+ messages in thread

* ✗ Fi.CI.CHECKPATCH: warning for drm/i915: the great header refactoring, part one
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (25 preceding siblings ...)
  2019-04-04 21:32 ` [PATCH 00/25] drm/i915: the great header refactoring, part one Chris Wilson
@ 2019-04-04 21:48 ` Patchwork
  2019-04-04 22:01 ` ✗ Fi.CI.SPARSE: " Patchwork
  2019-04-04 22:07 ` ✓ Fi.CI.BAT: success " Patchwork
  28 siblings, 0 replies; 33+ messages in thread
From: Patchwork @ 2019-04-04 21:48 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: the great header refactoring, part one
URL   : https://patchwork.freedesktop.org/series/59022/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
e3273176ce64 drm/i915: make intel_frontbuffer.h self-contained
9173569bc454 drm/i915: extract intel_audio.h from intel_drv.h
-:94: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#94: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 178 lines checked
17593127dc04 drm/i915: extract intel_crt.h from intel_drv.h
-:55: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#55: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 86 lines checked
f7505cd98351 drm/i915: extract intel_ddi.h from intel_drv.h
-:61: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#61: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 156 lines checked
29b3cb9772fe drm/i915: extract intel_connector.h from intel_drv.h
-:45: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#45: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 214 lines checked
d3dbcf35782d drm/i915: extract intel_csr.h from intel_drv.h
-:45: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#45: 
new file mode 100644

-:60: WARNING:FUNCTION_ARGUMENTS: function definition argument 'struct drm_i915_private *' should also have an identifier name
#60: FILE: drivers/gpu/drm/i915/intel_csr.h:11:
+void intel_csr_ucode_init(struct drm_i915_private *);

-:61: WARNING:FUNCTION_ARGUMENTS: function definition argument 'struct drm_i915_private *' should also have an identifier name
#61: FILE: drivers/gpu/drm/i915/intel_csr.h:12:
+void intel_csr_load_program(struct drm_i915_private *);

-:62: WARNING:FUNCTION_ARGUMENTS: function definition argument 'struct drm_i915_private *' should also have an identifier name
#62: FILE: drivers/gpu/drm/i915/intel_csr.h:13:
+void intel_csr_ucode_fini(struct drm_i915_private *);

-:63: WARNING:FUNCTION_ARGUMENTS: function definition argument 'struct drm_i915_private *' should also have an identifier name
#63: FILE: drivers/gpu/drm/i915/intel_csr.h:14:
+void intel_csr_ucode_suspend(struct drm_i915_private *);

-:64: WARNING:FUNCTION_ARGUMENTS: function definition argument 'struct drm_i915_private *' should also have an identifier name
#64: FILE: drivers/gpu/drm/i915/intel_csr.h:15:
+void intel_csr_ucode_resume(struct drm_i915_private *);

total: 0 errors, 6 warnings, 0 checks, 51 lines checked
3b0c7907b1c7 drm/i915: extract intel_fbc.h from intel_drv.h
-:76: CHECK:LINE_SPACING: Please don't use multiple blank lines
#76: FILE: drivers/gpu/drm/i915/i915_suspend.c:27:
 
+

-:134: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#134: 
new file mode 100644

total: 0 errors, 1 warnings, 1 checks, 150 lines checked
1d43269827e3 drm/i915: extract intel_psr.h from intel_drv.h
-:202: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#202: 
new file mode 100644

-:221: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'dev_priv' - possible side-effects?
#221: FILE: drivers/gpu/drm/i915/intel_psr.h:15:
+#define CAN_PSR(dev_priv) (HAS_PSR(dev_priv) && dev_priv->psr.sink_support)

-:226: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#226: FILE: drivers/gpu/drm/i915/intel_psr.h:20:
+void intel_psr_disable(struct intel_dp *intel_dp,
+		      const struct intel_crtc_state *old_crtc_state);

-:231: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#231: FILE: drivers/gpu/drm/i915/intel_psr.h:25:
+			  unsigned frontbuffer_bits,

-:234: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#234: FILE: drivers/gpu/drm/i915/intel_psr.h:28:
+		     unsigned frontbuffer_bits,

total: 0 errors, 3 warnings, 2 checks, 195 lines checked
1e02d4859ef6 drm/i915: extract intel_color.h from intel_drv.h
-:33: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#33: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 43 lines checked
4aef051c5084 drm/i915: extract intel_lspcon.h from intel_drv.h
-:101: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#101: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 93 lines checked
a9b1119a8b8a drm/i915: extract intel_sdvo.h from intel_drv.h
-:75: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#75: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 57 lines checked
444cceac5b34 drm/i915: extract intel_hdcp.h from intel_drv.h
-:141: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#141: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 120 lines checked
7764ec95da8a drm/i915: extract intel_panel.h from intel_drv.h
-:189: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#189: 
new file mode 100644

-:253: CHECK:LINE_SPACING: Please use a blank line after function/struct/union/enum declarations
#253: FILE: drivers/gpu/drm/i915/intel_panel.h:60:
+}
+static inline void intel_backlight_device_unregister(struct intel_connector *connector)

total: 0 errors, 1 warnings, 1 checks, 197 lines checked
9169ad03c189 drm/i915: extract intel_pm.h from intel_drv.h
-:193: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#193: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 222 lines checked
9b50c8a6f31f drm/i915: extract intel_fbdev.h from intel_drv.h
-:160: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#160: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 162 lines checked
c9dd8b09cf61 drm/i915: extract intel_dp.h from intel_drv.h
-:93: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#93: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 342 lines checked
de1853ccd427 drm/i915: extract intel_hdmi.h from intel_drv.h
-:148: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#148: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 154 lines checked
4fcb1b6c3c6d drm/i915: extract intel_atomic_plane.h from intel_drv.h
-:85: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#85: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 137 lines checked
c2bed9041cd5 drm/i915: extract intel_pipe_crc.h from intel_drv.h
-:75: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#75: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 74 lines checked
8552e096cde2 drm/i915: extract intel_tv.h from intel_drv.h
-:59: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#59: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 36 lines checked
1baaf662b096 drm/i915: extract intel_lvds.h from intel_drv.h
-:75: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#75: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 56 lines checked
afe139e73b37 drm/i915: extract intel_dvo.h from intel_drv.h
-:58: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#58: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 35 lines checked
502027133de0 drm/i915: extract intel_sprite.h from intel_drv.h
-:163: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#163: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 152 lines checked
eef88940ccfa drm/i915: extract intel_cdclk.h from intel_drv.h
-:57: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#57: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 128 lines checked
65c3d8e5d782 drm/i915/cdclk: have only one init/uninit function

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 33+ messages in thread

* ✗ Fi.CI.SPARSE: warning for drm/i915: the great header refactoring, part one
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (26 preceding siblings ...)
  2019-04-04 21:48 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
@ 2019-04-04 22:01 ` Patchwork
  2019-04-04 22:07 ` ✓ Fi.CI.BAT: success " Patchwork
  28 siblings, 0 replies; 33+ messages in thread
From: Patchwork @ 2019-04-04 22:01 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: the great header refactoring, part one
URL   : https://patchwork.freedesktop.org/series/59022/
State : warning

== Summary ==

$ dim sparse origin/drm-tip
Sparse version: v0.5.2
Commit: drm/i915: make intel_frontbuffer.h self-contained
-drivers/gpu/drm/i915/selftests/../i915_drv.h:3623:16: warning: expression using sizeof(void)
+drivers/gpu/drm/i915/selftests/../i915_drv.h:3616:16: warning: expression using sizeof(void)
+./include/uapi/linux/perf_event.h:147:56: warning: cast truncates bits from constant value (8000000000000000 becomes 0)

Commit: drm/i915: extract intel_audio.h from intel_drv.h
Okay!

Commit: drm/i915: extract intel_crt.h from intel_drv.h
Okay!

Commit: drm/i915: extract intel_ddi.h from intel_drv.h
+drivers/gpu/drm/i915/intel_ddi.c:1046:6: warning: symbol 'hsw_fdi_link_train' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_ddi.c:1300:5: warning: symbol 'cnl_calc_wrpll_link' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_ddi.c:1663:6: warning: symbol 'intel_ddi_set_pipe_settings' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_ddi.c:1708:6: warning: symbol 'intel_ddi_set_vc_payload_alloc' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_ddi.c:1724:6: warning: symbol 'intel_ddi_enable_transcoder_func' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_ddi.c:1810:6: warning: symbol 'intel_ddi_disable_transcoder_func' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_ddi.c:1830:5: warning: symbol 'intel_ddi_toggle_hdcp_signalling' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_ddi.c:1861:6: warning: symbol 'intel_ddi_connector_get_hw_state' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_ddi.c:2013:6: warning: symbol 'intel_ddi_get_hw_state' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_ddi.c:2083:6: warning: symbol 'intel_ddi_enable_pipe_clock' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_ddi.c:2096:6: warning: symbol 'intel_ddi_disable_pipe_clock' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_ddi.c:2191:4: warning: symbol 'intel_ddi_dp_voltage_max' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_ddi.c:2235:4: warning: symbol 'intel_ddi_dp_pre_emphasis_max' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_ddi.c:2664:5: warning: symbol 'bxt_signal_levels' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_ddi.c:2682:5: warning: symbol 'ddi_signal_levels' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_ddi.c:2751:6: warning: symbol 'icl_sanitize_encoder_pll_mapping' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_ddi.c:3326:6: warning: symbol 'intel_ddi_fdi_post_disable' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_ddi.c:3624:6: warning: symbol 'intel_ddi_prepare_link_retrain' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_ddi.c:3683:6: warning: symbol 'intel_ddi_compute_min_voltage_level' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_ddi.c:3692:6: warning: symbol 'intel_ddi_get_config' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_ddi.c:4136:6: warning: symbol 'intel_ddi_init' was not declared. Should it be static?

Commit: drm/i915: extract intel_connector.h from intel_drv.h
+drivers/gpu/drm/i915/intel_connector.c:106:5: warning: symbol 'intel_connector_register' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_connector.c:128:6: warning: symbol 'intel_connector_unregister' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_connector.c:135:6: warning: symbol 'intel_connector_attach_encoder' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_connector.c:147:6: warning: symbol 'intel_connector_get_hw_state' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_connector.c:155:11: warning: symbol 'intel_connector_get_pipe' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_connector.c:172:5: warning: symbol 'intel_connector_update_modes' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_connector.c:190:5: warning: symbol 'intel_ddc_get_modes' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_connector.c:214:1: warning: symbol 'intel_attach_force_audio_property' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_connector.c:241:1: warning: symbol 'intel_attach_broadcast_rgb_property' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_connector.c:263:1: warning: symbol 'intel_attach_aspect_ratio_property' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_connector.c:272:1: warning: symbol 'intel_attach_colorspace_property' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_connector.c:33:5: warning: symbol 'intel_connector_init' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_connector.c:53:24: warning: symbol 'intel_connector_alloc' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_connector.c:76:6: warning: symbol 'intel_connector_free' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_connector.c:85:6: warning: symbol 'intel_connector_destroy' was not declared. Should it be static?

Commit: drm/i915: extract intel_csr.h from intel_drv.h
+drivers/gpu/drm/i915/intel_csr.c:257:6: warning: symbol 'intel_csr_load_program' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_csr.c:467:6: warning: symbol 'intel_csr_ucode_init' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_csr.c:546:6: warning: symbol 'intel_csr_ucode_suspend' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_csr.c:565:6: warning: symbol 'intel_csr_ucode_resume' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_csr.c:585:6: warning: symbol 'intel_csr_ucode_fini' was not declared. Should it be static?

Commit: drm/i915: extract intel_fbc.h from intel_drv.h
+drivers/gpu/drm/i915/intel_fbc.c:1020:6: warning: symbol 'intel_fbc_choose_crtc' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_fbc.c:1078:6: warning: symbol 'intel_fbc_enable' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_fbc.c:1126:6: warning: symbol 'intel_fbc_disable' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_fbc.c:1146:6: warning: symbol 'intel_fbc_global_disable' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_fbc.c:1188:5: warning: symbol 'intel_fbc_reset_underrun' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_fbc.c:1223:6: warning: symbol 'intel_fbc_handle_fifo_underrun_irq' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_fbc.c:1250:6: warning: symbol 'intel_fbc_init_pipe_state' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_fbc.c:1305:6: warning: symbol 'intel_fbc_init' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_fbc.c:399:6: warning: symbol 'intel_fbc_is_active' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_fbc.c:563:6: warning: symbol 'intel_fbc_cleanup_cfb' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_fbc.c:852:6: warning: symbol 'intel_fbc_pre_update' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_fbc.c:938:6: warning: symbol 'intel_fbc_post_update' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_fbc.c:959:6: warning: symbol 'intel_fbc_invalidate' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_fbc.c:981:6: warning: symbol 'intel_fbc_flush' was not declared. Should it be static?
+./include/uapi/linux/perf_event.h:147:56: warning: cast truncates bits from constant value (8000000000000000 becomes 0)

Commit: drm/i915: extract intel_psr.h from intel_drv.h
+./include/uapi/linux/perf_event.h:147:56: warning: cast truncates bits from constant value (8000000000000000 becomes 0)

Commit: drm/i915: extract intel_color.h from intel_drv.h
+drivers/gpu/drm/i915/intel_color.c:1223:6: warning: symbol 'intel_color_init' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_color.c:838:6: warning: symbol 'intel_color_load_luts' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_color.c:845:6: warning: symbol 'intel_color_commit' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_color.c:852:5: warning: symbol 'intel_color_check' was not declared. Should it be static?

Commit: drm/i915: extract intel_lspcon.h from intel_drv.h
+drivers/gpu/drm/i915/intel_lspcon.c:183:6: warning: symbol 'lspcon_ycbcr420_config' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_lspcon.c:427:6: warning: symbol 'lspcon_write_infoframe' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_lspcon.c:455:6: warning: symbol 'lspcon_read_infoframe' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_lspcon.c:463:6: warning: symbol 'lspcon_set_infoframes' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_lspcon.c:517:5: warning: symbol 'lspcon_infoframes_enabled' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_lspcon.c:524:6: warning: symbol 'lspcon_resume' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_lspcon.c:544:6: warning: symbol 'lspcon_wait_pcon_mode' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_lspcon.c:549:6: warning: symbol 'lspcon_init' was not declared. Should it be static?

Commit: drm/i915: extract intel_sdvo.h from intel_drv.h
+drivers/gpu/drm/i915/intel_sdvo.c:1520:6: warning: symbol 'intel_sdvo_port_enabled' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_sdvo.c:3159:6: warning: symbol 'intel_sdvo_init' was not declared. Should it be static?

Commit: drm/i915: extract intel_hdcp.h from intel_drv.h
-O:drivers/gpu/drm/i915/intel_connector.c:33:5: warning: symbol 'intel_connector_init' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_connector.c:36:5: warning: symbol 'intel_connector_init' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_hdcp.c:1752:6: warning: symbol 'intel_hdcp_component_init' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_hdcp.c:1789:5: warning: symbol 'intel_hdcp_init' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_hdcp.c:1815:5: warning: symbol 'intel_hdcp_enable' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_hdcp.c:1852:5: warning: symbol 'intel_hdcp_disable' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_hdcp.c:1875:6: warning: symbol 'intel_hdcp_component_fini' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_hdcp.c:1889:6: warning: symbol 'intel_hdcp_cleanup' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_hdcp.c:1899:6: warning: symbol 'intel_hdcp_atomic_check' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_hdcp.c:1933:6: warning: symbol 'intel_hdcp_handle_cp_irq' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_hdcp.c:58:6: warning: symbol 'intel_hdcp_capable' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_hdcp.c:871:6: warning: symbol 'is_hdcp_supported' was not declared. Should it be static?

Commit: drm/i915: extract intel_panel.h from intel_drv.h
-O:drivers/gpu/drm/i915/intel_connector.c:36:5: warning: symbol 'intel_connector_init' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_connector.c:37:5: warning: symbol 'intel_connector_init' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_panel.c:103:25: warning: symbol 'intel_panel_edid_fixed_mode' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_panel.c:1183:6: warning: symbol 'intel_panel_enable_backlight' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_panel.c:1308:5: warning: symbol 'intel_backlight_device_register' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_panel.c:1361:6: warning: symbol 'intel_backlight_device_unregister' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_panel.c:145:25: warning: symbol 'intel_panel_vbt_fixed_mode' was not declared. Should it be static?
-drivers/gpu/drm/i915/intel_panel.c:1717:34: warning: expression using sizeof(void)
-drivers/gpu/drm/i915/intel_panel.c:1717:34: warning: expression using sizeof(void)
-drivers/gpu/drm/i915/intel_panel.c:1717:34: warning: expression using sizeof(void)
-drivers/gpu/drm/i915/intel_panel.c:1717:34: warning: expression using sizeof(void)
-drivers/gpu/drm/i915/intel_panel.c:1750:34: warning: expression using sizeof(void)
-drivers/gpu/drm/i915/intel_panel.c:1750:34: warning: expression using sizeof(void)
-drivers/gpu/drm/i915/intel_panel.c:1750:34: warning: expression using sizeof(void)
-drivers/gpu/drm/i915/intel_panel.c:1750:34: warning: expression using sizeof(void)
-drivers/gpu/drm/i915/intel_panel.c:1750:34: warning: expression using sizeof(void)
-drivers/gpu/drm/i915/intel_panel.c:1750:34: warning: expression using sizeof(void)
-drivers/gpu/drm/i915/intel_panel.c:1750:34: warning: expression using sizeof(void)
-drivers/gpu/drm/i915/intel_panel.c:1750:34: warning: too many warnings
+drivers/gpu/drm/i915/intel_panel.c:1717:34: warning: too many warnings
+drivers/gpu/drm/i915/intel_panel.c:174:1: warning: symbol 'intel_pch_panel_fitting' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_panel.c:374:6: warning: symbol 'intel_gmch_panel_fitting' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_panel.c:43:1: warning: symbol 'intel_fixed_panel_mode' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_panel.c:61:25: warning: symbol 'intel_panel_edid_downclock_mode' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_panel.c:690:6: warning: symbol 'intel_panel_set_backlight_acpi' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_panel.c:841:6: warning: symbol 'intel_panel_disable_backlight' was not declared. Should it be static?
-drivers/gpu/drm/i915/vlv_dsi.c:116:33: warning: expression using sizeof(void)
+drivers/gpu/drm/i915/vlv_dsi.c:116:33: warning: expression using sizeof(void)

Commit: drm/i915: extract intel_pm.h from intel_drv.h
+drivers/gpu/drm/i915/i915_irq.c:1194:6: warning: symbol 'gen6_rps_reset_ei' was not declared. Should it be static?

Commit: drm/i915: extract intel_fbdev.h from intel_drv.h
Okay!

Commit: drm/i915: extract intel_dp.h from intel_drv.h
Okay!

Commit: drm/i915: extract intel_hdmi.h from intel_drv.h
+drivers/gpu/drm/i915/intel_hdmi.c:1190:6: warning: symbol 'intel_dp_dual_mode_set_tmds_output' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_hdmi.c:2259:5: warning: symbol 'intel_hdmi_compute_config' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_hdmi.c:2755:6: warning: symbol 'intel_hdmi_handle_sink_scrambling' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_hdmi.c:2931:6: warning: symbol 'intel_infoframe_init' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_hdmi.c:2971:6: warning: symbol 'intel_hdmi_init_connector' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_hdmi.c:3038:6: warning: symbol 'intel_hdmi_init' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_hdmi.c:570:5: warning: symbol 'intel_hdmi_infoframe_enable' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_hdmi.c:582:5: warning: symbol 'intel_hdmi_infoframes_enabled' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_hdmi.c:654:6: warning: symbol 'intel_read_infoframe' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_hdmi.c:80:19: warning: symbol 'enc_to_intel_hdmi' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_hdmi.c:940:6: warning: symbol 'intel_hdmi_read_gcp_infoframe' was not declared. Should it be static?

Commit: drm/i915: extract intel_atomic_plane.h from intel_drv.h
+drivers/gpu/drm/i915/intel_atomic_plane.c:115:5: warning: symbol 'intel_plane_atomic_check_with_state' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_atomic_plane.c:223:6: warning: symbol 'intel_update_plane' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_atomic_plane.c:233:6: warning: symbol 'intel_update_slave' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_atomic_plane.c:243:6: warning: symbol 'intel_disable_plane' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_atomic_plane.c:252:6: warning: symbol 'skl_update_planes_on_crtc' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_atomic_plane.c:300:6: warning: symbol 'i9xx_update_planes_on_crtc' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_atomic_plane.c:322:37: warning: symbol 'intel_plane_helper_funcs' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_atomic_plane.c:41:20: warning: symbol 'intel_plane_alloc' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_atomic_plane.c:71:1: warning: symbol 'intel_plane_destroy_state' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_atomic_plane.c:79:6: warning: symbol 'intel_plane_free' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_atomic_plane.c:94:24: warning: symbol 'intel_plane_duplicate_state' was not declared. Should it be static?

Commit: drm/i915: extract intel_pipe_crc.h from intel_drv.h
+drivers/gpu/drm/i915/intel_pipe_crc.c:558:12: warning: symbol 'intel_crtc_get_crc_sources' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_pipe_crc.c:565:5: warning: symbol 'intel_crtc_verify_crc_source' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_pipe_crc.c:585:5: warning: symbol 'intel_crtc_set_crc_source' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_pipe_crc.c:636:6: warning: symbol 'intel_crtc_enable_pipe_crc' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_pipe_crc.c:656:6: warning: symbol 'intel_crtc_disable_pipe_crc' was not declared. Should it be static?

Commit: drm/i915: extract intel_tv.h from intel_drv.h
+drivers/gpu/drm/i915/intel_tv.c:1858:1: warning: symbol 'intel_tv_init' was not declared. Should it be static?

Commit: drm/i915: extract intel_lvds.h from intel_drv.h
+drivers/gpu/drm/i915/intel_lvds.c:751:22: warning: symbol 'intel_get_lvds_encoder' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_lvds.c:763:6: warning: symbol 'intel_is_dual_link_lvds' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_lvds.c:80:6: warning: symbol 'intel_lvds_port_enabled' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_lvds.c:811:6: warning: symbol 'intel_lvds_init' was not declared. Should it be static?

Commit: drm/i915: extract intel_dvo.h from intel_drv.h
+drivers/gpu/drm/i915/intel_dvo.c:402:6: warning: symbol 'intel_dvo_init' was not declared. Should it be static?

Commit: drm/i915: extract intel_sprite.h from intel_drv.h
-O:drivers/gpu/drm/i915/intel_atomic_plane.c:41:20: warning: symbol 'intel_plane_alloc' was not declared. Should it be static?
+drivers/gpu/drm/i915/intel_atomic_plane.c:42:20: warning: symbol 'intel_plane_alloc' was not declared. Should it be static?
+./include/uapi/linux/perf_event.h:147:56: warning: cast truncates bits from constant value (8000000000000000 becomes 0)

Commit: drm/i915: extract intel_cdclk.h from intel_drv.h
Okay!

Commit: drm/i915/cdclk: have only one init/uninit function
Okay!

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 33+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915: the great header refactoring, part one
  2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
                   ` (27 preceding siblings ...)
  2019-04-04 22:01 ` ✗ Fi.CI.SPARSE: " Patchwork
@ 2019-04-04 22:07 ` Patchwork
  28 siblings, 0 replies; 33+ messages in thread
From: Patchwork @ 2019-04-04 22:07 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: the great header refactoring, part one
URL   : https://patchwork.freedesktop.org/series/59022/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5875 -> Patchwork_12687
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/59022/revisions/1/mbox/

Known issues
------------

  Here are the changes found in Patchwork_12687 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_basic@basic-bsd2:
    - fi-kbl-7500u:       NOTRUN -> SKIP [fdo#109271] +9

  * igt@gem_exec_basic@gtt-bsd2:
    - fi-byt-clapper:     NOTRUN -> SKIP [fdo#109271] +12

  * igt@gem_exec_suspend@basic-s3:
    - fi-byt-clapper:     NOTRUN -> INCOMPLETE [fdo#102657]

  * igt@i915_selftest@live_contexts:
    - fi-bdw-gvtdvm:      PASS -> DMESG-FAIL [fdo#110235 ]

  * igt@i915_selftest@live_execlists:
    - fi-apl-guc:         PASS -> INCOMPLETE [fdo#103927] / [fdo#109720]

  * igt@kms_busy@basic-flip-c:
    - fi-blb-e6850:       NOTRUN -> SKIP [fdo#109271] / [fdo#109278]

  * igt@kms_chamelium@dp-crc-fast:
    - fi-kbl-7500u:       NOTRUN -> DMESG-WARN [fdo#103841]

  * igt@kms_pipe_crc_basic@hang-read-crc-pipe-c:
    - fi-blb-e6850:       NOTRUN -> SKIP [fdo#109271] +48

  * igt@runner@aborted:
    - fi-kbl-7500u:       NOTRUN -> FAIL [fdo#103841]
    - fi-apl-guc:         NOTRUN -> FAIL [fdo#108622] / [fdo#109720]

  
#### Possible fixes ####

  * igt@gem_exec_suspend@basic-s3:
    - fi-blb-e6850:       INCOMPLETE [fdo#107718] -> PASS

  * igt@i915_selftest@live_hangcheck:
    - fi-skl-iommu:       INCOMPLETE [fdo#108602] / [fdo#108744] -> PASS

  * igt@kms_flip@basic-flip-vs-wf_vblank:
    - fi-bsw-n3050:       FAIL [fdo#100368] -> PASS

  * igt@kms_frontbuffer_tracking@basic:
    - {fi-icl-u3}:        FAIL [fdo#103167] -> PASS
    - fi-icl-u2:          FAIL [fdo#103167] -> PASS

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#100368]: https://bugs.freedesktop.org/show_bug.cgi?id=100368
  [fdo#102657]: https://bugs.freedesktop.org/show_bug.cgi?id=102657
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103841]: https://bugs.freedesktop.org/show_bug.cgi?id=103841
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
  [fdo#108602]: https://bugs.freedesktop.org/show_bug.cgi?id=108602
  [fdo#108622]: https://bugs.freedesktop.org/show_bug.cgi?id=108622
  [fdo#108744]: https://bugs.freedesktop.org/show_bug.cgi?id=108744
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109720]: https://bugs.freedesktop.org/show_bug.cgi?id=109720
  [fdo#110235 ]: https://bugs.freedesktop.org/show_bug.cgi?id=110235 


Participating hosts (48 -> 45)
------------------------------

  Additional (2): fi-byt-clapper fi-kbl-7500u 
  Missing    (5): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan 


Build changes
-------------

    * Linux: CI_DRM_5875 -> Patchwork_12687

  CI_DRM_5875: 5cc7c47c44aaef5bfe07e7307d06caa98e401fad @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4928: 014a6fa238322b497116b359cb92df1ce7fa8847 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_12687: 65c3d8e5d782f22612abb99cf76f5782a9641d0f @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

65c3d8e5d782 drm/i915/cdclk: have only one init/uninit function
eef88940ccfa drm/i915: extract intel_cdclk.h from intel_drv.h
502027133de0 drm/i915: extract intel_sprite.h from intel_drv.h
afe139e73b37 drm/i915: extract intel_dvo.h from intel_drv.h
1baaf662b096 drm/i915: extract intel_lvds.h from intel_drv.h
8552e096cde2 drm/i915: extract intel_tv.h from intel_drv.h
c2bed9041cd5 drm/i915: extract intel_pipe_crc.h from intel_drv.h
4fcb1b6c3c6d drm/i915: extract intel_atomic_plane.h from intel_drv.h
de1853ccd427 drm/i915: extract intel_hdmi.h from intel_drv.h
c9dd8b09cf61 drm/i915: extract intel_dp.h from intel_drv.h
9b50c8a6f31f drm/i915: extract intel_fbdev.h from intel_drv.h
9169ad03c189 drm/i915: extract intel_pm.h from intel_drv.h
7764ec95da8a drm/i915: extract intel_panel.h from intel_drv.h
444cceac5b34 drm/i915: extract intel_hdcp.h from intel_drv.h
a9b1119a8b8a drm/i915: extract intel_sdvo.h from intel_drv.h
4aef051c5084 drm/i915: extract intel_lspcon.h from intel_drv.h
1e02d4859ef6 drm/i915: extract intel_color.h from intel_drv.h
1d43269827e3 drm/i915: extract intel_psr.h from intel_drv.h
3b0c7907b1c7 drm/i915: extract intel_fbc.h from intel_drv.h
d3dbcf35782d drm/i915: extract intel_csr.h from intel_drv.h
29b3cb9772fe drm/i915: extract intel_connector.h from intel_drv.h
f7505cd98351 drm/i915: extract intel_ddi.h from intel_drv.h
17593127dc04 drm/i915: extract intel_crt.h from intel_drv.h
9173569bc454 drm/i915: extract intel_audio.h from intel_drv.h
e3273176ce64 drm/i915: make intel_frontbuffer.h self-contained

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12687/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 00/25] drm/i915: the great header refactoring, part one
  2019-04-04 21:32 ` [PATCH 00/25] drm/i915: the great header refactoring, part one Chris Wilson
@ 2019-04-05  7:50   ` Joonas Lahtinen
  0 siblings, 0 replies; 33+ messages in thread
From: Joonas Lahtinen @ 2019-04-05  7:50 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: jani.nikula

Quoting Chris Wilson (2019-04-05 00:32:13)
> Quoting Jani Nikula (2019-04-04 22:14:24)
> > intel_drv.h has grown out of proportions, and turned into a dumping
> > ground. Way back when it was useful to have only a handful of headers,
> > but we're long past that.
> > 
> > Start splitting off per-module headers. The basic principles:
> > 
> > * Make the new headers self-contained (i.e. can be compiled without
> >   including other headers first), and test this using the new infra for
> >   that.
> > 
> > * Use minimal includes for making the headers self-contained. Use
> >   forward declarations for structs where applicable, and e.g. include
> >   <linux/types.h> instead of <linux/kernel.h>.
> > 
> > * Only split off the headers, and mostly refrain from doing other
> >   refactoring while at it. (There are a few minor things.)
> > 
> > * Mostly only split off function declarations. Splitting off types is
> >   left for follow-up work.
> > 
> > * Include the new headers only where needed. This leads to a lot of
> >   includes here and there, but on the other hand increases the clarity
> >   of the relationships between the modules. (And already raises a bunch
> >   of questions about the split and cross-calls between some
> >   modules. It'll be easier to analyze this.)
> > 
> > * Wherever adding new includes, group the includes by <linux/...> first,
> >   then <drm/...>, then "...", and sort the groups alphabetically.
> > 
> > * Choice of what to extract first here is purely arbitrary.
> > 
> > * Follow-up work should consider renaming functions according to the
> >   module, i.e. functions in intel_foo.c should be prefixed
> >   intel_foo_. Better naming will be helpful in further organizing the
> >   driver, as well as grasping the structure to begin with.
> 
> I wholeheartedly agree. Recent experience shows that with a small number
> of very large headers, getting the types defined at the right point is
> much harder than with small scoped headers. (And don't get me started on
> trying to avoid circular definitions for inlines.)
> 
> The counterpoint is that it can be harder to find the right header. But
> it's no harder than trying to find the right c-file, and if we keep to
> the rule that object-name.c is accompanied by object-name.h, once you
> know object name, it is easy to find.

I'm also very much in favor of this split.

Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas

> > Jani Nikula (25):
> >   drm/i915: make intel_frontbuffer.h self-contained
> >   drm/i915: extract intel_audio.h from intel_drv.h
> >   drm/i915: extract intel_crt.h from intel_drv.h
> >   drm/i915: extract intel_ddi.h from intel_drv.h
> >   drm/i915: extract intel_connector.h from intel_drv.h
> >   drm/i915: extract intel_csr.h from intel_drv.h
> >   drm/i915: extract intel_fbc.h from intel_drv.h
> >   drm/i915: extract intel_psr.h from intel_drv.h
> >   drm/i915: extract intel_color.h from intel_drv.h
> >   drm/i915: extract intel_lspcon.h from intel_drv.h
> >   drm/i915: extract intel_sdvo.h from intel_drv.h
> >   drm/i915: extract intel_hdcp.h from intel_drv.h
> >   drm/i915: extract intel_panel.h from intel_drv.h
> >   drm/i915: extract intel_pm.h from intel_drv.h
> >   drm/i915: extract intel_fbdev.h from intel_drv.h
> >   drm/i915: extract intel_dp.h from intel_drv.h
> >   drm/i915: extract intel_hdmi.h from intel_drv.h
> >   drm/i915: extract intel_atomic_plane.h from intel_drv.h
> >   drm/i915: extract intel_pipe_crc.h from intel_drv.h
> >   drm/i915: extract intel_tv.h from intel_drv.h
> >   drm/i915: extract intel_lvds.h from intel_drv.h
> >   drm/i915: extract intel_dvo.h from intel_drv.h
> >   drm/i915: extract intel_sprite.h from intel_drv.h
> >   drm/i915: extract intel_cdclk.h from intel_drv.h
> >   drm/i915/cdclk: have only one init/uninit function
> 
> Read through the patches, and they are just code motion.
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> 
> The real work is done by the compiler.
> -Chris
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2019-04-05  7:50 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
2019-04-04 21:14 ` [PATCH 01/25] drm/i915: make intel_frontbuffer.h self-contained Jani Nikula
2019-04-04 21:14 ` [PATCH 02/25] drm/i915: extract intel_audio.h from intel_drv.h Jani Nikula
2019-04-04 21:14 ` [PATCH 03/25] drm/i915: extract intel_crt.h " Jani Nikula
2019-04-04 21:22   ` Jani Nikula
2019-04-04 21:14 ` [PATCH 04/25] drm/i915: extract intel_ddi.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 05/25] drm/i915: extract intel_connector.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 06/25] drm/i915: extract intel_csr.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 07/25] drm/i915: extract intel_fbc.h " Jani Nikula
2019-04-04 21:22   ` Chris Wilson
2019-04-04 21:14 ` [PATCH 08/25] drm/i915: extract intel_psr.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 09/25] drm/i915: extract intel_color.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 10/25] drm/i915: extract intel_lspcon.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 11/25] drm/i915: extract intel_sdvo.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 12/25] drm/i915: extract intel_hdcp.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 13/25] drm/i915: extract intel_panel.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 14/25] drm/i915: extract intel_pm.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 15/25] drm/i915: extract intel_fbdev.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 16/25] drm/i915: extract intel_dp.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 17/25] drm/i915: extract intel_hdmi.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 18/25] drm/i915: extract intel_atomic_plane.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 19/25] drm/i915: extract intel_pipe_crc.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 20/25] drm/i915: extract intel_tv.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 21/25] drm/i915: extract intel_lvds.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 22/25] drm/i915: extract intel_dvo.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 23/25] drm/i915: extract intel_sprite.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 24/25] drm/i915: extract intel_cdclk.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 25/25] drm/i915/cdclk: have only one init/uninit function Jani Nikula
2019-04-04 21:32 ` [PATCH 00/25] drm/i915: the great header refactoring, part one Chris Wilson
2019-04-05  7:50   ` Joonas Lahtinen
2019-04-04 21:48 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2019-04-04 22:01 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-04-04 22:07 ` ✓ Fi.CI.BAT: success " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.