Skip to contentSkip to conversation

drm/i915: the great header refactoring, part one

PATCH Superseded Jani Nikula 4 participants 33 messages Apr 4, 2019 – Apr 5, 2019

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover drm/i915: the great header refactoring, part one

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
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 1/25 drm/i915: make intel_frontbuffer.h self-contained

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

---
 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(-)
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index f7809b5c21ad..243a64fb4cc7 100644
@@ -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 $@
drivers/gpu/drm/i915/i915_drv.h +2 -9
index 4af815c3c02d..35fe464e5ed3 100644
@@ -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. */
drivers/gpu/drm/i915/intel_frontbuffer.h +10 -0
index 63cd9a753a72..d5894666f658 100644
@@ -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,
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH 2/25 drm/i915: extract intel_audio.h from intel_drv.h

In reply to 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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index 243a64fb4cc7..09bba7c9376c 100644
@@ -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 \
drivers/gpu/drm/i915/i915_drv.c +3 -2
index 0bbf3f5db5fc..80166e3ee68e 100644
@@ -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"
drivers/gpu/drm/i915/intel_audio.c +7 -5
index 20324b0d34c7..bca4cc025d3d 100644
@@ -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;
drivers/gpu/drm/i915/intel_audio.h new file +24 -0
new file mode 100644
index 000000000000..a3657c7a7ba2
@@ -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__ */
drivers/gpu/drm/i915/intel_ddi.c +2 -0
index 3f1e491bd0c0..46a6adea815a 100644
@@ -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"
 
drivers/gpu/drm/i915/intel_dp.c +7 -4
index 72c49070ed14..573cb04e2a56 100644
@@ -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
 
drivers/gpu/drm/i915/intel_dp_mst.c +4 -2
index 19d81cef2ab6..360e43b25fa5 100644
@@ -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,
drivers/gpu/drm/i915/intel_drv.h +0 -13
index 64544613920b..5dc434d74ada 100644
@@ -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);
drivers/gpu/drm/i915/intel_hdmi.c +6 -3
index 26767785f14a..1c76e20f9ebc 100644
@@ -26,19 +26,22 @@
  *	Jesse Barnes <[email protected]>
  */
 
-#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)
 {
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

PATCH 3/25 drm/i915: extract intel_crt.h from intel_drv.h

In reply to 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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index 09bba7c9376c..fd0f33ea896d 100644
@@ -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
drivers/gpu/drm/i915/intel_crt.c +4 -1
index 50530e49982c..a14afbe51b08 100644
@@ -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 |		\
drivers/gpu/drm/i915/intel_crt.h new file +21 -0
new file mode 100644
index 000000000000..1b3fba359efc
@@ -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__ */
drivers/gpu/drm/i915/intel_display.c +2 -9
index 7ecfb7d98839..5cf82dbead65 100644
@@ -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,
drivers/gpu/drm/i915/intel_drv.h +0 -6
index 5dc434d74ada..847da5b24548 100644
@@ -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,
drivers/gpu/drm/i915/intel_runtime_pm.c +1 -0
index 40ddfbb97acb..a9931081462b 100644
@@ -32,6 +32,7 @@
 #include <drm/drm_print.h>
 
 #include "i915_drv.h"
+#include "intel_crt.h"
 #include "intel_drv.h"
 
 /**
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

PATCH 4/25 drm/i915: extract intel_ddi.h from intel_drv.h

In reply to 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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index fd0f33ea896d..d9a6089f0de5 100644
@@ -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
drivers/gpu/drm/i915/icl_dsi.c +3 -1
index b67ffaa283dc..64beb141c1ec 100644
@@ -25,8 +25,10 @@
  *   Jani Nikula <[email protected]>
  */
 
-#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,
drivers/gpu/drm/i915/intel_crt.c +1 -0
index a14afbe51b08..d649dae3cc70 100644
@@ -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 */
drivers/gpu/drm/i915/intel_ddi.h new file +53 -0

53 lines not on this page · raw message

drivers/gpu/drm/i915/intel_display.c +1 -0
index 5cf82dbead65..cae807341553 100644
@@ -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"
drivers/gpu/drm/i915/intel_dp.c +1 -0
index 573cb04e2a56..ca3ed4ae253c 100644
@@ -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
drivers/gpu/drm/i915/intel_dp_mst.c +1 -0
index 360e43b25fa5..62c240be8cc9 100644
@@ -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,
drivers/gpu/drm/i915/intel_drv.h +2 -36
index 847da5b24548..b61ec71e971e 100644
@@ -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);
drivers/gpu/drm/i915/intel_hdmi.c +1 -0
index 1c76e20f9ebc..de1d420a73b9 100644
@@ -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)
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw

PATCH 5/25 drm/i915: extract intel_connector.h from intel_drv.h

In reply to 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.

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

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

PATCH 6/25 drm/i915: extract intel_csr.h from intel_drv.h

In reply to 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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index c0095a4ed26f..e03285ccad24 100644
@@ -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 \
drivers/gpu/drm/i915/i915_drv.c +1 -0
index 80166e3ee68e..6d9711a767b4 100644
@@ -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"
drivers/gpu/drm/i915/intel_csr.h new file +17 -0
new file mode 100644
index 000000000000..ade260fc484c
@@ -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__ */
drivers/gpu/drm/i915/intel_drv.h +0 -7
index 2b2aa634fd4b..9404dfcbfd3a 100644
@@ -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;
drivers/gpu/drm/i915/intel_runtime_pm.c +1 -0
index a9931081462b..b72af95b893b 100644
@@ -33,6 +33,7 @@
 
 #include "i915_drv.h"
 #include "intel_crt.h"
+#include "intel_csr.h"
 #include "intel_drv.h"
 
 /**
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw

PATCH 7/25 drm/i915: extract intel_fbc.h from intel_drv.h

In reply to 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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index e03285ccad24..1099de6c8bda 100644
@@ -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
 
drivers/gpu/drm/i915/i915_debugfs.c +5 -3
index a14a7bccffc1..bdb5daa59de5 100644
@@ -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)
 {
drivers/gpu/drm/i915/i915_reset.h +1 -0
index 86b1ac8116ce..3c0450289b8f 100644
@@ -14,6 +14,7 @@
 #include "intel_engine_types.h"
 
 struct drm_i915_private;
+struct i915_request;
 struct intel_engine_cs;
 struct intel_guc;
 
drivers/gpu/drm/i915/i915_suspend.c +4 -1
index d2f2a9c2fabd..eec48d856adb 100644
@@ -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)
 {
drivers/gpu/drm/i915/intel_display.c +1 -0
index cae807341553..08c9205a4e8a 100644
@@ -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 */
drivers/gpu/drm/i915/intel_drv.h +0 -24
index 9404dfcbfd3a..cc0d179b6c43 100644
@@ -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);
drivers/gpu/drm/i915/intel_fbc.h new file +42 -0

42 lines not on this page · raw message

drivers/gpu/drm/i915/intel_fifo_underrun.c +1 -0
index f33de4be4b89..74c8b0528294 100644
@@ -27,6 +27,7 @@
 
 #include "i915_drv.h"
 #include "intel_drv.h"
+#include "intel_fbc.h"
 
 /**
  * DOC: fifo underrun handling
drivers/gpu/drm/i915/intel_frontbuffer.c +2 -1
index 16f253deaf8d..1d19da2ffee8 100644
@@ -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,
drivers/gpu/drm/i915/intel_pm.c +1 -0
index 0e05ee1f3ea0..b3c4f640117f 100644
@@ -35,6 +35,7 @@
 
 #include "i915_drv.h"
 #include "intel_drv.h"
+#include "intel_fbc.h"
 #include "../../../platform/x86/intel_ips.h"
 
 /**
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#10 lore raw

PATCH 8/25 drm/i915: extract intel_psr.h from intel_drv.h

In reply to 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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index 1099de6c8bda..6da5c6722bee 100644
@@ -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 $@
drivers/gpu/drm/i915/i915_debugfs.c +1 -0
index bdb5daa59de5..1c3e19b9583e 100644
@@ -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)
 {
drivers/gpu/drm/i915/i915_irq.c +7 -4
index aa107a78cb36..6454ddc37f8b 100644
@@ -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
drivers/gpu/drm/i915/intel_ddi.c +1 -0
index 011a6fb621ad..625a12b02502 100644
@@ -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 */
drivers/gpu/drm/i915/intel_display.c +1 -0
index 08c9205a4e8a..8812b2776b28 100644
@@ -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[] = {
drivers/gpu/drm/i915/intel_dp.c +1 -0
index 466e5a6b9513..00efbb59c422 100644
@@ -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
 
drivers/gpu/drm/i915/intel_drv.h +0 -26
index cc0d179b6c43..3829d96d0233 100644
@@ -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);
 
drivers/gpu/drm/i915/intel_fbc.c +2 -1
index 43fe08be3b7d..9372a5c4d077 100644
@@ -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)
 {
drivers/gpu/drm/i915/intel_frontbuffer.c +1 -0
index 1d19da2ffee8..a42f859ad22e 100644
@@ -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,
drivers/gpu/drm/i915/intel_psr.c +6 -5
index ec874d802d48..6592aa48c8ef 100644
@@ -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) {
drivers/gpu/drm/i915/intel_psr.h new file +40 -0
new file mode 100644
index 000000000000..9a373c54c3ec
@@ -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__ */
drivers/gpu/drm/i915/intel_sprite.c +8 -5
index 65de7387bf1b..d02da53e9806 100644
@@ -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)
 {
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#11 lore raw

PATCH 9/25 drm/i915: extract intel_color.h from intel_drv.h

In reply to 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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index 6da5c6722bee..cf6e6fce7b2c 100644
@@ -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 \
drivers/gpu/drm/i915/intel_color.h new file +17 -0
new file mode 100644
index 000000000000..b8a3ce609587
@@ -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__ */
drivers/gpu/drm/i915/intel_display.c +1 -0
index 8812b2776b28..ed41f313e63f 100644
@@ -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"
drivers/gpu/drm/i915/intel_drv.h +0 -6
index 3829d96d0233..9fd356c614ae 100644
@@ -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);
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#12 lore raw

PATCH 10/25 drm/i915: extract intel_lspcon.h from intel_drv.h

In reply to 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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index cf6e6fce7b2c..589e5b513838 100644
@@ -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
 
drivers/gpu/drm/i915/intel_ddi.c +1 -0
index 625a12b02502..9da006f4ce35 100644
@@ -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 {
drivers/gpu/drm/i915/intel_dp.c +1 -0
index 00efbb59c422..2f50a4d81fcd 100644
@@ -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
drivers/gpu/drm/i915/intel_drv.h +0 -21
index 9fd356c614ae..5c1326c81cdb 100644
@@ -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);
drivers/gpu/drm/i915/intel_hdmi.c +1 -0
index 92f4d9b65150..012ae7b1bda5 100644
@@ -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)
 {
drivers/gpu/drm/i915/intel_lspcon.h new file +38 -0
new file mode 100644
index 000000000000..37cfddf8a9c5
@@ -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__ */
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#13 lore raw

PATCH 11/25 drm/i915: extract intel_sdvo.h from intel_drv.h

In reply to 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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index 589e5b513838..f1f62794b457 100644
@@ -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 $@
drivers/gpu/drm/i915/intel_display.c +1 -0
index ed41f313e63f..6d2a385d149e 100644
@@ -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[] = {
drivers/gpu/drm/i915/intel_drv.h +0 -7
index 5c1326c81cdb..681f232fd305 100644
@@ -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,
drivers/gpu/drm/i915/intel_hdmi.c +1 -0
index 012ae7b1bda5..03dcf5f7d69f 100644
@@ -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)
 {
drivers/gpu/drm/i915/intel_sdvo.h new file +23 -0
new file mode 100644
index 000000000000..c9e05bcdd141
@@ -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__ */
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#14 lore raw

PATCH 12/25 drm/i915: extract intel_hdcp.h from intel_drv.h

In reply to 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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index f1f62794b457..a4846d7eaf46 100644
@@ -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 \
drivers/gpu/drm/i915/i915_debugfs.c +1 -0
index 1c3e19b9583e..ebe85144ae9c 100644
@@ -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)
drivers/gpu/drm/i915/intel_atomic.c +1 -0
index b844e8840c6f..2cbcf6ac24d8 100644
@@ -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.
drivers/gpu/drm/i915/intel_connector.c +5 -2
index 848dd9e728d8..27031040f090 100644
@@ -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)
 {
drivers/gpu/drm/i915/intel_ddi.c +1 -0
index 9da006f4ce35..c7c8f7b1a0b8 100644
@@ -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"
 
drivers/gpu/drm/i915/intel_display.c +1 -0
index 6d2a385d149e..e725597ce730 100644
@@ -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"
 
drivers/gpu/drm/i915/intel_dp.c +1 -0
index 2f50a4d81fcd..efc411964bcc 100644
@@ -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"
 
drivers/gpu/drm/i915/intel_drv.h +0 -15
index 681f232fd305..e04a622a71ed 100644
@@ -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);
 
drivers/gpu/drm/i915/intel_hdcp.h new file +33 -0
new file mode 100644
index 000000000000..a75f25f09d39
@@ -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__ */
drivers/gpu/drm/i915/intel_hdmi.c +1 -0
index 03dcf5f7d69f..18fef71fc4f8 100644
@@ -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"
 
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#15 lore raw

PATCH 13/25 drm/i915: extract intel_panel.h from intel_drv.h

In reply to 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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index a4846d7eaf46..d3a8fc37d6b5 100644
@@ -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
drivers/gpu/drm/i915/icl_dsi.c +1 -0
index 08e471898c86..527aafc16e62 100644
@@ -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)
drivers/gpu/drm/i915/intel_connector.c +1 -0
index 27031040f090..40b3d6379ac9 100644
@@ -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)
 {
drivers/gpu/drm/i915/intel_ddi.c +1 -0
index c7c8f7b1a0b8..887903d89cd8 100644
@@ -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 {
drivers/gpu/drm/i915/intel_dp.c +1 -0
index efc411964bcc..02d662ff5df9 100644
@@ -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
drivers/gpu/drm/i915/intel_drv.h +0 -45

51 lines not on this page · raw message

drivers/gpu/drm/i915/intel_dvo.c +1 -0
index 58af409a6d58..4fda625ea2c1 100644
@@ -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
drivers/gpu/drm/i915/intel_hdmi.c +1 -0
index 18fef71fc4f8..5725fedaceec 100644
@@ -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)
 {
drivers/gpu/drm/i915/intel_lvds.c +1 -0
index fbc99af2158e..3788d2fe4a9e 100644
@@ -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 {
drivers/gpu/drm/i915/intel_opregion.c +2 -1
index 5437effcb396..dec22bbbeff5 100644
@@ -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
drivers/gpu/drm/i915/intel_panel.h new file +65 -0

65 lines not on this page · raw message

drivers/gpu/drm/i915/intel_sdvo.c +1 -0
index e148c8956cb5..9a4c54dd2e5c 100644
@@ -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)
drivers/gpu/drm/i915/vlv_dsi.c +1 -0
index f523bd70914c..c765cd50f0f6 100644
@@ -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,
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#16 lore raw

PATCH 14/25 drm/i915: extract intel_pm.h from intel_drv.h

In reply to 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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index d3a8fc37d6b5..ab7ac0ac17a1 100644
@@ -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
drivers/gpu/drm/i915/i915_debugfs.c +1 -0
index ebe85144ae9c..7c54c994de50 100644
@@ -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)
drivers/gpu/drm/i915/i915_drv.c +1 -0
index 6d9711a767b4..85dac2f23197 100644
@@ -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"
 
drivers/gpu/drm/i915/i915_gem.c +1 -0
index f25a1ba24927..bf3d12f94365 100644
@@ -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);
drivers/gpu/drm/i915/i915_request.c +2 -1
index 82094b9f5ba7..91eec5075bc9 100644
@@ -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;
drivers/gpu/drm/i915/intel_atomic_plane.c +1 -0
index 9d32a6fcf840..42821f8e6031 100644
@@ -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)
 {
drivers/gpu/drm/i915/intel_display.c +1 -0
index e725597ce730..f81a5c50120e 100644
@@ -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"
 
drivers/gpu/drm/i915/intel_drv.h +0 -51

57 lines not on this page · raw message

drivers/gpu/drm/i915/intel_pm.c +2 -1
index b3c4f640117f..b48b3e9257d6 100644
@@ -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;
drivers/gpu/drm/i915/intel_pm.h new file +72 -0

72 lines not on this page · raw message

drivers/gpu/drm/i915/intel_sprite.c +1 -0
index d02da53e9806..0274e70f6034 100644
@@ -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)
drivers/gpu/drm/i915/intel_uncore.c +5 -4
index a01d1b352a7c..d1d51e1121e2 100644
@@ -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
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#17 lore raw

PATCH 15/25 drm/i915: extract intel_fbdev.h from intel_drv.h

In reply to 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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index ab7ac0ac17a1..9fd6f3460334 100644
@@ -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 \
drivers/gpu/drm/i915/i915_drv.c +1 -0
index 85dac2f23197..fc11c215e0a2 100644
@@ -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"
drivers/gpu/drm/i915/i915_pci.c +1 -0
index 6ffb85ddac53..f893c2cbce15 100644
@@ -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)
drivers/gpu/drm/i915/intel_display.c +1 -0
index f81a5c50120e..a1a29a7f2db0 100644
@@ -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"
drivers/gpu/drm/i915/intel_drv.h +0 -40
index 173f88935169..d23abd7cff49 100644
@@ -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);
drivers/gpu/drm/i915/intel_fbdev.c +9 -8
index ef93c27e60b4..bc532e99b5dc 100644
@@ -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)
 {
drivers/gpu/drm/i915/intel_fbdev.h new file +53 -0

53 lines not on this page · raw message

Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#18 lore raw

PATCH 16/25 drm/i915: extract intel_dp.h from intel_drv.h

In reply to 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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index 9fd6f3460334..fbc172a26cb1 100644
@@ -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 \
drivers/gpu/drm/i915/i915_debugfs.c +1 -0
index 7c54c994de50..859f77a8a09e 100644
@@ -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"
drivers/gpu/drm/i915/i915_drv.c +1 -0
index fc11c215e0a2..08a64e5cc869 100644
@@ -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"
drivers/gpu/drm/i915/intel_ddi.c +1 -0
index 887903d89cd8..406eb9088935 100644
@@ -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"
drivers/gpu/drm/i915/intel_display.c +1 -0
index a1a29a7f2db0..e1b38634ba42 100644
@@ -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"
drivers/gpu/drm/i915/intel_dp.c +1 -0
index 02d662ff5df9..46d27ed6954b 100644
@@ -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"
drivers/gpu/drm/i915/intel_dp.h new file +121 -0

121 lines not on this page · raw message

drivers/gpu/drm/i915/intel_dp_link_training.c +1 -0
index b59c87daa4f7..54b069333e2f 100644
@@ -21,6 +21,7 @@
  * IN THE SOFTWARE.
  */
 
+#include "intel_dp.h"
 #include "intel_drv.h"
 
 static void
drivers/gpu/drm/i915/intel_dp_mst.c +1 -0
index 041003884860..9c4c0589c0fc 100644
@@ -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,
drivers/gpu/drm/i915/intel_dpio_phy.c +1 -0
index db295c77ff0d..ab4ac7158b79 100644
@@ -21,6 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
+#include "intel_dp.h"
 #include "intel_drv.h"
 
 /**
drivers/gpu/drm/i915/intel_drv.h +2 -95

117 lines not on this page · raw message

drivers/gpu/drm/i915/intel_frontbuffer.c +1 -0
index a42f859ad22e..aa34e33b6087 100644
@@ -62,6 +62,7 @@
 
 
 #include "i915_drv.h"
+#include "intel_dp.h"
 #include "intel_drv.h"
 #include "intel_fbc.h"
 #include "intel_frontbuffer.h"
drivers/gpu/drm/i915/intel_hdmi.c +1 -0
index 5725fedaceec..2207cc4f5012 100644
@@ -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"
drivers/gpu/drm/i915/intel_lspcon.c +4 -1
index 8d202b13e24f..e8c294dc597a 100644
@@ -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) */
drivers/gpu/drm/i915/intel_psr.c +1 -0
index 6592aa48c8ef..30016e054344 100644
@@ -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"
 
drivers/gpu/drm/i915/intel_runtime_pm.c +1 -0
index b72af95b893b..d78256116cb8 100644
@@ -34,6 +34,7 @@
 #include "i915_drv.h"
 #include "intel_crt.h"
 #include "intel_csr.h"
+#include "intel_dp.h"
 #include "intel_drv.h"
 
 /**
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#19 lore raw

PATCH 17/25 drm/i915: extract intel_hdmi.h from intel_drv.h

In reply to 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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index fbc172a26cb1..e78eeaa8ec33 100644
@@ -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 \
drivers/gpu/drm/i915/i915_debugfs.c +1 -0
index 859f77a8a09e..527b995a4d7a 100644
@@ -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"
 
drivers/gpu/drm/i915/intel_ddi.c +1 -0
index 406eb9088935..46ab56755365 100644
@@ -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"
drivers/gpu/drm/i915/intel_display.c +1 -0
index e1b38634ba42..472388592951 100644
@@ -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"
drivers/gpu/drm/i915/intel_dp.c +1 -0
index 46d27ed6954b..a5eeb1b89376 100644
@@ -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"
drivers/gpu/drm/i915/intel_drv.h +7 -31
index 4847db9f87e2..ae5714ef6c11 100644
@@ -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);
drivers/gpu/drm/i915/intel_hdmi.h new file +51 -0

51 lines not on this page · raw message

drivers/gpu/drm/i915/intel_sdvo.c +1 -0
index 9a4c54dd2e5c..7eb578a57064 100644
@@ -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"
 
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#20 lore raw

PATCH 18/25 drm/i915: extract intel_atomic_plane.h from intel_drv.h

In reply to 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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index e78eeaa8ec33..43c939da9665 100644
@@ -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 \
drivers/gpu/drm/i915/intel_atomic_plane.c +17 -17
index 42821f8e6031..381234ce1bc4 100644
@@ -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,
drivers/gpu/drm/i915/intel_atomic_plane.h new file +40 -0
new file mode 100644
index 000000000000..14678620440f
@@ -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__ */
drivers/gpu/drm/i915/intel_display.c +1 -0
index 472388592951..54ba021ad4ea 100644
@@ -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"
drivers/gpu/drm/i915/intel_drv.h +0 -24
index ae5714ef6c11..9b8435f9ccaf 100644
@@ -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);
drivers/gpu/drm/i915/intel_sprite.c +1 -0
index 0274e70f6034..50ba32eaee9e 100644
@@ -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"
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#21 lore raw

PATCH 19/25 drm/i915: extract intel_pipe_crc.h from intel_drv.h

In reply to 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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index 43c939da9665..2724ccff61ea 100644
@@ -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 \
drivers/gpu/drm/i915/intel_display.c +1 -0
index 54ba021ad4ea..77348a9e68e7 100644
@@ -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"
drivers/gpu/drm/i915/intel_drv.h +0 -21
index 9b8435f9ccaf..5bf36ea9fc08 100644
@@ -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__ */
drivers/gpu/drm/i915/intel_pipe_crc.h new file +35 -0
new file mode 100644
index 000000000000..81eaf1854788
@@ -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__ */
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#22 lore raw

PATCH 20/25 drm/i915: extract intel_tv.h from intel_drv.h

In reply to 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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index 2724ccff61ea..595d9b34d866 100644
@@ -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 $@
drivers/gpu/drm/i915/intel_display.c +1 -0
index 77348a9e68e7..5f4771d0f489 100644
@@ -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[] = {
drivers/gpu/drm/i915/intel_drv.h +0 -3
index 5bf36ea9fc08..fab363d9af2e 100644
@@ -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,
drivers/gpu/drm/i915/intel_tv.h new file +13 -0
new file mode 100644
index 000000000000..44518575ec5c
@@ -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__ */
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#23 lore raw

PATCH 21/25 drm/i915: extract intel_lvds.h from intel_drv.h

In reply to 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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index 595d9b34d866..486ad9679d7f 100644
@@ -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 \
drivers/gpu/drm/i915/intel_display.c +1 -0
index 5f4771d0f489..806fe9db2de8 100644
@@ -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"
drivers/gpu/drm/i915/intel_dp.c +1 -0
index a5eeb1b89376..c4e36759a756 100644
@@ -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"
 
drivers/gpu/drm/i915/intel_drv.h +0 -7
index fab363d9af2e..75035d663491 100644
@@ -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);
drivers/gpu/drm/i915/intel_lvds.h new file +22 -0
new file mode 100644
index 000000000000..bc9c8b84ba2f
@@ -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__ */
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#24 lore raw

PATCH 22/25 drm/i915: extract intel_dvo.h from intel_drv.h

In reply to 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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index 486ad9679d7f..24cfbb5c0f51 100644
@@ -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 \
drivers/gpu/drm/i915/intel_display.c +1 -0
index 806fe9db2de8..4c465a3eb7a1 100644
@@ -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"
drivers/gpu/drm/i915/intel_drv.h +0 -2
index 75035d663491..dba3ab28428d 100644
@@ -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,
drivers/gpu/drm/i915/intel_dvo.h new file +13 -0
new file mode 100644
index 000000000000..3ed0fdf8efff
@@ -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__ */
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#25 lore raw

PATCH 23/25 drm/i915: extract intel_sprite.h from intel_drv.h

In reply to 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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index 24cfbb5c0f51..83db8f79e3bc 100644
@@ -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
 
drivers/gpu/drm/i915/i915_drv.c +1 -0
index 08a64e5cc869..23f16fd47b4d 100644
@@ -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"
 
drivers/gpu/drm/i915/intel_atomic.c +1 -0
index 2cbcf6ac24d8..8c8fae32ec50 100644
@@ -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.
drivers/gpu/drm/i915/intel_atomic_plane.c +1 -0
index 381234ce1bc4..0c662dec9eee 100644
@@ -37,6 +37,7 @@
 
 #include "intel_drv.h"
 #include "intel_pm.h"
+#include "intel_sprite.h"
 
 struct intel_plane *intel_plane_alloc(void)
 {
drivers/gpu/drm/i915/intel_display.c +1 -0
index 4c465a3eb7a1..7d1eb8e2e6a8 100644
@@ -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 */
drivers/gpu/drm/i915/intel_drv.h +0 -35
index dba3ab28428d..a5f81dcb4380 100644
@@ -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,
drivers/gpu/drm/i915/intel_pm.c +1 -0
index b48b3e9257d6..bba477e62a12 100644
@@ -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"
 
 /**
drivers/gpu/drm/i915/intel_psr.c +1 -0
index 30016e054344..aacf5c6f6d95 100644
@@ -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)
drivers/gpu/drm/i915/intel_sprite.c +1 -0
index 50ba32eaee9e..2913e89280d7 100644
@@ -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)
 {
drivers/gpu/drm/i915/intel_sprite.h new file +55 -0

55 lines not on this page · raw message

Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#26 lore raw

PATCH 24/25 drm/i915: extract intel_cdclk.h from intel_drv.h

In reply to 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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index 83db8f79e3bc..c1c391816fa7 100644
@@ -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 \
drivers/gpu/drm/i915/i915_drv.c +1 -0
index 23f16fd47b4d..402acdb953c4 100644
@@ -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"
drivers/gpu/drm/i915/intel_cdclk.c +1 -0
index b911fe86be56..c6e163d26158 100644
@@ -21,6 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
+#include "intel_cdclk.h"
 #include "intel_drv.h"
 
 /**
drivers/gpu/drm/i915/intel_cdclk.h new file +52 -0

52 lines not on this page · raw message

drivers/gpu/drm/i915/intel_display.c +1 -0
index 7d1eb8e2e6a8..f8938b5a4936 100644
@@ -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"
drivers/gpu/drm/i915/intel_drv.h +0 -35
index a5f81dcb4380..a69654ff0288 100644
@@ -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);
drivers/gpu/drm/i915/intel_runtime_pm.c +1 -0
index d78256116cb8..606f7a1074d8 100644
@@ -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"
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#27 lore raw

PATCH 25/25 drm/i915/cdclk: have only one init/uninit function

In reply to 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.

---
 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(-)
drivers/gpu/drm/i915/intel_cdclk.c +48 -72
index c6e163d26158..7f060eaf1b17 100644
@@ -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
drivers/gpu/drm/i915/intel_cdclk.h +2 -8
index ae4a60b76756..4d6f7f5f8930 100644
@@ -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);
drivers/gpu/drm/i915/intel_runtime_pm.c +8 -8
index 606f7a1074d8..e6d1e592225b 100644
@@ -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).
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

Re: [PATCH 03/25] drm/i915: extract intel_crt.h from intel_drv.h

In reply to Jani Nikula
Quoted 4 lines · 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.

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.

Quoted 136 lines

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.

---
 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
drivers/gpu/drm/i915/Makefile.header-test +1 -0
index 09bba7c9376c..fd0f33ea896d 100644
@@ -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
drivers/gpu/drm/i915/intel_crt.c +4 -1
index 50530e49982c..a14afbe51b08 100644
@@ -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 |		\
drivers/gpu/drm/i915/intel_crt.h new file +21 -0
new file mode 100644
index 000000000000..1b3fba359efc
@@ -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__ */
drivers/gpu/drm/i915/intel_display.c +2 -9
index 7ecfb7d98839..5cf82dbead65 100644
@@ -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,
drivers/gpu/drm/i915/intel_drv.h +0 -6
index 5dc434d74ada..847da5b24548 100644
@@ -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,
drivers/gpu/drm/i915/intel_runtime_pm.c +1 -0
index 40ddfbb97acb..a9931081462b 100644
@@ -32,6 +32,7 @@
 #include <drm/drm_print.h>
 
 #include "i915_drv.h"
+#include "intel_crt.h"
 #include "intel_drv.h"
 
 /**
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw

Re: [PATCH 07/25] drm/i915: extract intel_fbc.h from intel_drv.h

In reply to Jani Nikula

Quoting Jani Nikula (2019-04-04 22:14:31)

drivers/gpu/drm/i915/i915_suspend.c line 27

Quoted 9 lines
drivers/gpu/drm/i915/i915_suspend.c +1 -0
index d2f2a9c2fabd..eec48d856adb 100644
@@ -24,9 +24,12 @@
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
+

Stray

drivers/gpu/drm/i915/i915_suspend.c line 35

Quoted 9 lines
drivers/gpu/drm/i915/i915_suspend.c +3 -1
 #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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on the v1 series
#28 lore raw
In reply to Jani Nikula

Quoting Jani Nikula (2019-04-04 22:14:24)

Quoted 29 lines

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.

Quoted 6 lines

* 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.

Quoted 18 lines

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

Quoted 8 lines

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.

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

#30 lore raw

✗ Fi.CI.CHECKPATCH: warning for drm/i915: the great header refactoring, part one

In reply to Jani Nikula
== Series Details ==

== 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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#31 lore raw

✗ Fi.CI.SPARSE: warning for drm/i915: the great header refactoring, part one

In reply to Jani Nikula
== Series Details ==

== 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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#32 lore raw

✓ Fi.CI.BAT: success for drm/i915: the great header refactoring, part one

In reply to Jani Nikula
== Series Details ==

== 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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

maintainer Acked-by
#29 lore raw
In reply to Chris Wilson

Quoting Chris Wilson (2019-04-05 00:32:13)

Quoted 42 lines

Quoting Jani Nikula (2019-04-04 22:14:24)

Quoted 29 lines

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.

Quoted 6 lines

* 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.)

Quoted 4 lines

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.

Regards, Joonas

Quoted 28 lines
Quoted 18 lines

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

Quoted 8 lines

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.

Quoted 8 lines

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

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx