dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/19] drm/i915: prepare for xe driver display integration
@ 2023-09-12 11:06 Jani Nikula
  2023-09-12 11:06 ` [PATCH 01/19] drm/i915: define I915 during i915 driver build Jani Nikula
                   ` (19 more replies)
  0 siblings, 20 replies; 22+ messages in thread
From: Jani Nikula @ 2023-09-12 11:06 UTC (permalink / raw)
  To: intel-gfx
  Cc: Tvrtko Ursulin, jani.nikula, Lucas De Marchi, dri-devel, Rodrigo Vivi

The upcoming drm/xe driver [1][2] will reuse the drm/i915 display code,
initially by compiling the relevant compilation units separately as part
of the xe driver. This series prepares for that in i915 side.

The first patch defines I915 during the i915 driver build, to allow
conditional compilation based on the driver the code is being built for.

The rest of the patches add stubs for functions in files that aren't
used in xe. The idea is that this is the least intrusive way of skipping
that code in xe, and is quite similar to the common kconfig stubs.

While this is arguably unused code for the time being, or only used in
an out-of-tree driver yet to be upstreamed, the upstreaming has to start
somewhere.


BR,
Jani.


[1] https://gitlab.freedesktop.org/drm/xe/kernel/-/tree/drm-xe-next
[2] https://patchwork.freedesktop.org/series/112188/

Cc: David Airlie <airlied@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>

Jani Nikula (19):
  drm/i915: define I915 during i915 driver build
  drm/i915/display: add I915 conditional build to intel_lvds.h
  drm/i915/display: add I915 conditional build to hsw_ips.h
  drm/i915/display: add I915 conditional build to i9xx_plane.h
  drm/i915/display: add I915 conditional build to intel_lpe_audio.h
  drm/i915/display: add I915 conditional build to intel_pch_refclk.h
  drm/i915/display: add I915 conditional build to intel_pch_display.h
  drm/i915/display: add I915 conditional build to intel_sprite.h
  drm/i915/display: add I915 conditional build to intel_overlay.h
  drm/i915/display: add I915 conditional build to g4x_dp.h
  drm/i915/display: add I915 conditional build to intel_dpio_phy.h
  drm/i915/display: add I915 conditional build to intel_crt.h
  drm/i915/display: add I915 conditional build to vlv_dsi.h
  drm/i915/display: add I915 conditional build to i9xx_wm.h
  drm/i915/display: add I915 conditional build to g4x_hdmi.h
  drm/i915/display: add I915 conditional build to intel_dvo.h
  drm/i915/display: add I915 conditional build to intel_sdvo.h
  drm/i915/display: add I915 conditional build to intel_tv.h
  drm/i915/display: add I915 conditional build to vlv_dsi_pll.h

 drivers/gpu/drm/i915/Makefile                 |  4 +
 drivers/gpu/drm/i915/display/g4x_dp.h         | 26 +++++
 drivers/gpu/drm/i915/display/g4x_hdmi.h       | 12 +++
 drivers/gpu/drm/i915/display/hsw_ips.h        | 35 +++++++
 drivers/gpu/drm/i915/display/i9xx_plane.h     | 23 +++++
 drivers/gpu/drm/i915/display/i9xx_wm.h        | 17 ++++
 drivers/gpu/drm/i915/display/intel_crt.h      | 14 +++
 drivers/gpu/drm/i915/display/intel_dpio_phy.h | 96 +++++++++++++++++++
 drivers/gpu/drm/i915/display/intel_dvo.h      |  6 ++
 .../gpu/drm/i915/display/intel_lpe_audio.h    | 18 ++++
 drivers/gpu/drm/i915/display/intel_lvds.h     | 19 ++++
 drivers/gpu/drm/i915/display/intel_overlay.h  | 35 +++++++
 .../gpu/drm/i915/display/intel_pch_display.h  | 53 ++++++++++
 .../gpu/drm/i915/display/intel_pch_refclk.h   | 23 +++++
 drivers/gpu/drm/i915/display/intel_sdvo.h     | 13 +++
 drivers/gpu/drm/i915/display/intel_sprite.h   |  8 ++
 drivers/gpu/drm/i915/display/intel_tv.h       |  6 ++
 drivers/gpu/drm/i915/display/vlv_dsi.h        | 13 +++
 drivers/gpu/drm/i915/display/vlv_dsi_pll.h    |  9 ++
 19 files changed, 430 insertions(+)

-- 
2.39.2


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

* [PATCH 01/19] drm/i915: define I915 during i915 driver build
  2023-09-12 11:06 [PATCH 00/19] drm/i915: prepare for xe driver display integration Jani Nikula
@ 2023-09-12 11:06 ` Jani Nikula
  2023-09-12 11:06 ` [PATCH 02/19] drm/i915/display: add I915 conditional build to intel_lvds.h Jani Nikula
                   ` (18 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Jani Nikula @ 2023-09-12 11:06 UTC (permalink / raw)
  To: intel-gfx
  Cc: Tvrtko Ursulin, jani.nikula, Lucas De Marchi, dri-devel, Rodrigo Vivi

The xe driver will reuse i915 display code by compiling it separately as
part of xe. We'll want to be able to distinguish between building the
i915 display code for i915 and xe. Define I915 when building i915.

Cc: David Airlie <airlied@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index 1b2e02e9d92c..fa6aa71bb749 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -28,6 +28,10 @@ CFLAGS_i915_pci.o = $(call cc-disable-warning, override-init)
 CFLAGS_display/intel_display_device.o = $(call cc-disable-warning, override-init)
 CFLAGS_display/intel_fbdev.o = $(call cc-disable-warning, override-init)
 
+# Support compiling the display code separately for both i915 and xe
+# drivers. Define I915 when building i915.
+subdir-ccflags-y += -DI915
+
 subdir-ccflags-y += -I$(srctree)/$(src)
 
 # Please keep these build lists sorted!
-- 
2.39.2


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

* [PATCH 02/19] drm/i915/display: add I915 conditional build to intel_lvds.h
  2023-09-12 11:06 [PATCH 00/19] drm/i915: prepare for xe driver display integration Jani Nikula
  2023-09-12 11:06 ` [PATCH 01/19] drm/i915: define I915 during i915 driver build Jani Nikula
@ 2023-09-12 11:06 ` Jani Nikula
  2023-09-12 11:06 ` [PATCH 03/19] drm/i915/display: add I915 conditional build to hsw_ips.h Jani Nikula
                   ` (17 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Jani Nikula @ 2023-09-12 11:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, dri-devel

Add stubs for !I915.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_lvds.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_lvds.h b/drivers/gpu/drm/i915/display/intel_lvds.h
index 9d3372dc503f..7ad5fa9c0434 100644
--- a/drivers/gpu/drm/i915/display/intel_lvds.h
+++ b/drivers/gpu/drm/i915/display/intel_lvds.h
@@ -13,10 +13,29 @@
 enum pipe;
 struct drm_i915_private;
 
+#ifdef I915
 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);
+#else
+static inline bool intel_lvds_port_enabled(struct drm_i915_private *dev_priv,
+					   i915_reg_t lvds_reg, enum pipe *pipe)
+{
+	return false;
+}
+static inline void intel_lvds_init(struct drm_i915_private *dev_priv)
+{
+}
+static inline struct intel_encoder *intel_get_lvds_encoder(struct drm_i915_private *dev_priv)
+{
+	return NULL;
+}
+static inline bool intel_is_dual_link_lvds(struct drm_i915_private *dev_priv)
+{
+	return false;
+}
+#endif
 
 #endif /* __INTEL_LVDS_H__ */
-- 
2.39.2


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

* [PATCH 03/19] drm/i915/display: add I915 conditional build to hsw_ips.h
  2023-09-12 11:06 [PATCH 00/19] drm/i915: prepare for xe driver display integration Jani Nikula
  2023-09-12 11:06 ` [PATCH 01/19] drm/i915: define I915 during i915 driver build Jani Nikula
  2023-09-12 11:06 ` [PATCH 02/19] drm/i915/display: add I915 conditional build to intel_lvds.h Jani Nikula
@ 2023-09-12 11:06 ` Jani Nikula
  2023-09-12 11:06 ` [PATCH 04/19] drm/i915/display: add I915 conditional build to i9xx_plane.h Jani Nikula
                   ` (16 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Jani Nikula @ 2023-09-12 11:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, dri-devel

Add stubs for !I915.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/hsw_ips.h | 35 ++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/hsw_ips.h b/drivers/gpu/drm/i915/display/hsw_ips.h
index 4eb83b350791..35364228e1c1 100644
--- a/drivers/gpu/drm/i915/display/hsw_ips.h
+++ b/drivers/gpu/drm/i915/display/hsw_ips.h
@@ -12,6 +12,7 @@ struct intel_atomic_state;
 struct intel_crtc;
 struct intel_crtc_state;
 
+#ifdef I915
 bool hsw_ips_disable(const struct intel_crtc_state *crtc_state);
 bool hsw_ips_pre_update(struct intel_atomic_state *state,
 			struct intel_crtc *crtc);
@@ -23,5 +24,39 @@ int hsw_ips_compute_config(struct intel_atomic_state *state,
 			   struct intel_crtc *crtc);
 void hsw_ips_get_config(struct intel_crtc_state *crtc_state);
 void hsw_ips_crtc_debugfs_add(struct intel_crtc *crtc);
+#else
+static inline bool hsw_ips_disable(const struct intel_crtc_state *crtc_state)
+{
+	return false;
+}
+static inline bool hsw_ips_pre_update(struct intel_atomic_state *state,
+				      struct intel_crtc *crtc)
+{
+	return false;
+}
+static inline void hsw_ips_post_update(struct intel_atomic_state *state,
+				       struct intel_crtc *crtc)
+{
+}
+static inline bool hsw_crtc_supports_ips(struct intel_crtc *crtc)
+{
+	return false;
+}
+static inline bool hsw_crtc_state_ips_capable(const struct intel_crtc_state *crtc_state)
+{
+	return false;
+}
+static inline int hsw_ips_compute_config(struct intel_atomic_state *state,
+					 struct intel_crtc *crtc)
+{
+	return 0;
+}
+static inline void hsw_ips_get_config(struct intel_crtc_state *crtc_state)
+{
+}
+static inline void hsw_ips_crtc_debugfs_add(struct intel_crtc *crtc)
+{
+}
+#endif
 
 #endif /* __HSW_IPS_H__ */
-- 
2.39.2


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

* [PATCH 04/19] drm/i915/display: add I915 conditional build to i9xx_plane.h
  2023-09-12 11:06 [PATCH 00/19] drm/i915: prepare for xe driver display integration Jani Nikula
                   ` (2 preceding siblings ...)
  2023-09-12 11:06 ` [PATCH 03/19] drm/i915/display: add I915 conditional build to hsw_ips.h Jani Nikula
@ 2023-09-12 11:06 ` Jani Nikula
  2023-09-12 11:06 ` [PATCH 05/19] drm/i915/display: add I915 conditional build to intel_lpe_audio.h Jani Nikula
                   ` (15 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Jani Nikula @ 2023-09-12 11:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, dri-devel

Add stubs for !I915.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/i9xx_plane.h | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/i9xx_plane.h b/drivers/gpu/drm/i915/display/i9xx_plane.h
index 027b66053984..b3d724a144cb 100644
--- a/drivers/gpu/drm/i915/display/i9xx_plane.h
+++ b/drivers/gpu/drm/i915/display/i9xx_plane.h
@@ -15,6 +15,7 @@ struct intel_initial_plane_config;
 struct intel_plane;
 struct intel_plane_state;
 
+#ifdef I915
 unsigned int i965_plane_max_stride(struct intel_plane *plane,
 				   u32 pixel_format, u64 modifier,
 				   unsigned int rotation);
@@ -25,4 +26,26 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe);
 
 void i9xx_get_initial_plane_config(struct intel_crtc *crtc,
 				   struct intel_initial_plane_config *plane_config);
+#else
+static inline unsigned int i965_plane_max_stride(struct intel_plane *plane,
+						 u32 pixel_format, u64 modifier,
+						 unsigned int rotation)
+{
+	return 0;
+}
+static inline int i9xx_check_plane_surface(struct intel_plane_state *plane_state)
+{
+	return 0;
+}
+static inline struct intel_plane *
+intel_primary_plane_create(struct drm_i915_private *dev_priv, int pipe)
+{
+	return NULL;
+}
+static inline void i9xx_get_initial_plane_config(struct intel_crtc *crtc,
+						 struct intel_initial_plane_config *plane_config)
+{
+}
+#endif
+
 #endif
-- 
2.39.2


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

* [PATCH 05/19] drm/i915/display: add I915 conditional build to intel_lpe_audio.h
  2023-09-12 11:06 [PATCH 00/19] drm/i915: prepare for xe driver display integration Jani Nikula
                   ` (3 preceding siblings ...)
  2023-09-12 11:06 ` [PATCH 04/19] drm/i915/display: add I915 conditional build to i9xx_plane.h Jani Nikula
@ 2023-09-12 11:06 ` Jani Nikula
  2023-09-12 11:06 ` [PATCH 06/19] drm/i915/display: add I915 conditional build to intel_pch_refclk.h Jani Nikula
                   ` (14 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Jani Nikula @ 2023-09-12 11:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, dri-devel

Add stubs for !I915.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_lpe_audio.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_lpe_audio.h b/drivers/gpu/drm/i915/display/intel_lpe_audio.h
index 0beecac267ae..2c5fcb6e1fd0 100644
--- a/drivers/gpu/drm/i915/display/intel_lpe_audio.h
+++ b/drivers/gpu/drm/i915/display/intel_lpe_audio.h
@@ -12,11 +12,29 @@ enum port;
 enum transcoder;
 struct drm_i915_private;
 
+#ifdef I915
 int  intel_lpe_audio_init(struct drm_i915_private *dev_priv);
 void intel_lpe_audio_teardown(struct drm_i915_private *dev_priv);
 void intel_lpe_audio_irq_handler(struct drm_i915_private *dev_priv);
 void intel_lpe_audio_notify(struct drm_i915_private *dev_priv,
 			    enum transcoder cpu_transcoder, enum port port,
 			    const void *eld, int ls_clock, bool dp_output);
+#else
+static inline int intel_lpe_audio_init(struct drm_i915_private *dev_priv)
+{
+	return -ENODEV;
+}
+static inline void intel_lpe_audio_teardown(struct drm_i915_private *dev_priv)
+{
+}
+static inline void intel_lpe_audio_irq_handler(struct drm_i915_private *dev_priv)
+{
+}
+static inline void intel_lpe_audio_notify(struct drm_i915_private *dev_priv,
+					  enum transcoder cpu_transcoder, enum port port,
+					  const void *eld, int ls_clock, bool dp_output)
+{
+}
+#endif
 
 #endif /* __INTEL_LPE_AUDIO_H__ */
-- 
2.39.2


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

* [PATCH 06/19] drm/i915/display: add I915 conditional build to intel_pch_refclk.h
  2023-09-12 11:06 [PATCH 00/19] drm/i915: prepare for xe driver display integration Jani Nikula
                   ` (4 preceding siblings ...)
  2023-09-12 11:06 ` [PATCH 05/19] drm/i915/display: add I915 conditional build to intel_lpe_audio.h Jani Nikula
@ 2023-09-12 11:06 ` Jani Nikula
  2023-09-12 11:06 ` [PATCH 07/19] drm/i915/display: add I915 conditional build to intel_pch_display.h Jani Nikula
                   ` (13 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Jani Nikula @ 2023-09-12 11:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, dri-devel

Add stubs for !I915.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 .../gpu/drm/i915/display/intel_pch_refclk.h   | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_pch_refclk.h b/drivers/gpu/drm/i915/display/intel_pch_refclk.h
index 9bcf56629f24..ae3403c0ced8 100644
--- a/drivers/gpu/drm/i915/display/intel_pch_refclk.h
+++ b/drivers/gpu/drm/i915/display/intel_pch_refclk.h
@@ -11,6 +11,7 @@
 struct drm_i915_private;
 struct intel_crtc_state;
 
+#ifdef I915
 void lpt_program_iclkip(const struct intel_crtc_state *crtc_state);
 void lpt_disable_iclkip(struct drm_i915_private *dev_priv);
 int lpt_get_iclkip(struct drm_i915_private *dev_priv);
@@ -18,5 +19,27 @@ int lpt_iclkip(const struct intel_crtc_state *crtc_state);
 
 void intel_init_pch_refclk(struct drm_i915_private *dev_priv);
 void lpt_disable_clkout_dp(struct drm_i915_private *dev_priv);
+#else
+static inline void lpt_program_iclkip(const struct intel_crtc_state *crtc_state)
+{
+}
+static inline void lpt_disable_iclkip(struct drm_i915_private *dev_priv)
+{
+}
+static inline int lpt_get_iclkip(struct drm_i915_private *dev_priv)
+{
+	return 0;
+}
+static inline int lpt_iclkip(const struct intel_crtc_state *crtc_state)
+{
+	return 0;
+}
+static inline void intel_init_pch_refclk(struct drm_i915_private *dev_priv)
+{
+}
+static inline void lpt_disable_clkout_dp(struct drm_i915_private *dev_priv)
+{
+}
+#endif
 
 #endif
-- 
2.39.2


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

* [PATCH 07/19] drm/i915/display: add I915 conditional build to intel_pch_display.h
  2023-09-12 11:06 [PATCH 00/19] drm/i915: prepare for xe driver display integration Jani Nikula
                   ` (5 preceding siblings ...)
  2023-09-12 11:06 ` [PATCH 06/19] drm/i915/display: add I915 conditional build to intel_pch_refclk.h Jani Nikula
@ 2023-09-12 11:06 ` Jani Nikula
  2023-09-12 11:06 ` [PATCH 08/19] drm/i915/display: add I915 conditional build to intel_sprite.h Jani Nikula
                   ` (12 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Jani Nikula @ 2023-09-12 11:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, dri-devel

Add stubs for !I915.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 .../gpu/drm/i915/display/intel_pch_display.h  | 53 +++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_pch_display.h b/drivers/gpu/drm/i915/display/intel_pch_display.h
index 41a63413cb3d..35f8288af3d1 100644
--- a/drivers/gpu/drm/i915/display/intel_pch_display.h
+++ b/drivers/gpu/drm/i915/display/intel_pch_display.h
@@ -15,6 +15,7 @@ struct intel_crtc;
 struct intel_crtc_state;
 struct intel_link_m_n;
 
+#ifdef I915
 bool intel_has_pch_trancoder(struct drm_i915_private *i915,
 			     enum pipe pch_transcoder);
 enum pipe intel_crtc_pch_transcoder(struct intel_crtc *crtc);
@@ -41,5 +42,57 @@ void intel_pch_transcoder_get_m2_n2(struct intel_crtc *crtc,
 				    struct intel_link_m_n *m_n);
 
 void intel_pch_sanitize(struct drm_i915_private *i915);
+#else
+static inline bool intel_has_pch_trancoder(struct drm_i915_private *i915,
+					   enum pipe pch_transcoder)
+{
+	return false;
+}
+static inline int intel_crtc_pch_transcoder(struct intel_crtc *crtc)
+{
+	return 0;
+}
+static inline void ilk_pch_pre_enable(struct intel_atomic_state *state,
+				      struct intel_crtc *crtc)
+{
+}
+static inline void ilk_pch_enable(struct intel_atomic_state *state,
+				  struct intel_crtc *crtc)
+{
+}
+static inline void ilk_pch_disable(struct intel_atomic_state *state,
+				   struct intel_crtc *crtc)
+{
+}
+static inline void ilk_pch_post_disable(struct intel_atomic_state *state,
+					struct intel_crtc *crtc)
+{
+}
+static inline void ilk_pch_get_config(struct intel_crtc_state *crtc_state)
+{
+}
+static inline void lpt_pch_enable(struct intel_atomic_state *state,
+				  struct intel_crtc *crtc)
+{
+}
+static inline void lpt_pch_disable(struct intel_atomic_state *state,
+				   struct intel_crtc *crtc)
+{
+}
+static inline void lpt_pch_get_config(struct intel_crtc_state *crtc_state)
+{
+}
+static inline void intel_pch_transcoder_get_m1_n1(struct intel_crtc *crtc,
+						  struct intel_link_m_n *m_n)
+{
+}
+static inline void intel_pch_transcoder_get_m2_n2(struct intel_crtc *crtc,
+						  struct intel_link_m_n *m_n)
+{
+}
+static inline void intel_pch_sanitize(struct drm_i915_private *i915)
+{
+}
+#endif
 
 #endif
-- 
2.39.2


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

* [PATCH 08/19] drm/i915/display: add I915 conditional build to intel_sprite.h
  2023-09-12 11:06 [PATCH 00/19] drm/i915: prepare for xe driver display integration Jani Nikula
                   ` (6 preceding siblings ...)
  2023-09-12 11:06 ` [PATCH 07/19] drm/i915/display: add I915 conditional build to intel_pch_display.h Jani Nikula
@ 2023-09-12 11:06 ` Jani Nikula
  2023-09-12 11:06 ` [PATCH 09/19] drm/i915/display: add I915 conditional build to intel_overlay.h Jani Nikula
                   ` (11 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Jani Nikula @ 2023-09-12 11:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, dri-devel

Add stubs for !I915.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_sprite.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_sprite.h b/drivers/gpu/drm/i915/display/intel_sprite.h
index 91c6dca342b2..044a032e41b9 100644
--- a/drivers/gpu/drm/i915/display/intel_sprite.h
+++ b/drivers/gpu/drm/i915/display/intel_sprite.h
@@ -16,6 +16,7 @@ struct intel_crtc_state;
 struct intel_plane_state;
 enum pipe;
 
+#ifdef I915
 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,
@@ -29,5 +30,12 @@ int hsw_plane_min_cdclk(const struct intel_crtc_state *crtc_state,
 			const struct intel_plane_state *plane_state);
 int vlv_plane_min_cdclk(const struct intel_crtc_state *crtc_state,
 			const struct intel_plane_state *plane_state);
+#else
+static inline struct intel_plane *intel_sprite_plane_create(struct drm_i915_private *dev_priv,
+							    int pipe, int plane)
+{
+	return NULL;
+}
+#endif
 
 #endif /* __INTEL_SPRITE_H__ */
-- 
2.39.2


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

* [PATCH 09/19] drm/i915/display: add I915 conditional build to intel_overlay.h
  2023-09-12 11:06 [PATCH 00/19] drm/i915: prepare for xe driver display integration Jani Nikula
                   ` (7 preceding siblings ...)
  2023-09-12 11:06 ` [PATCH 08/19] drm/i915/display: add I915 conditional build to intel_sprite.h Jani Nikula
@ 2023-09-12 11:06 ` Jani Nikula
  2023-09-12 11:06 ` [PATCH 10/19] drm/i915/display: add I915 conditional build to g4x_dp.h Jani Nikula
                   ` (10 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Jani Nikula @ 2023-09-12 11:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, dri-devel

Add stubs for !I915.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_overlay.h | 35 ++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_overlay.h b/drivers/gpu/drm/i915/display/intel_overlay.h
index a167c28acd27..c3f68fce6f08 100644
--- a/drivers/gpu/drm/i915/display/intel_overlay.h
+++ b/drivers/gpu/drm/i915/display/intel_overlay.h
@@ -13,6 +13,7 @@ struct drm_i915_private;
 struct intel_overlay;
 struct intel_overlay_error_state;
 
+#ifdef I915
 void intel_overlay_setup(struct drm_i915_private *dev_priv);
 void intel_overlay_cleanup(struct drm_i915_private *dev_priv);
 int intel_overlay_switch_off(struct intel_overlay *overlay);
@@ -25,5 +26,39 @@ struct intel_overlay_error_state *
 intel_overlay_capture_error_state(struct drm_i915_private *dev_priv);
 void intel_overlay_print_error_state(struct drm_i915_error_state_buf *e,
 				     struct intel_overlay_error_state *error);
+#else
+static inline void intel_overlay_setup(struct drm_i915_private *dev_priv)
+{
+}
+static inline void intel_overlay_cleanup(struct drm_i915_private *dev_priv)
+{
+}
+static inline int intel_overlay_switch_off(struct intel_overlay *overlay)
+{
+	return 0;
+}
+static inline int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data,
+				  struct drm_file *file_priv)
+{
+	return 0;
+}
+static inline int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data,
+					    struct drm_file *file_priv)
+{
+	return 0;
+}
+static inline void intel_overlay_reset(struct drm_i915_private *dev_priv)
+{
+}
+static inline struct intel_overlay_error_state *
+intel_overlay_capture_error_state(struct drm_i915_private *dev_priv)
+{
+	return NULL;
+}
+static inline void intel_overlay_print_error_state(struct drm_i915_error_state_buf *e,
+						   struct intel_overlay_error_state *error)
+{
+}
+#endif
 
 #endif /* __INTEL_OVERLAY_H__ */
-- 
2.39.2


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

* [PATCH 10/19] drm/i915/display: add I915 conditional build to g4x_dp.h
  2023-09-12 11:06 [PATCH 00/19] drm/i915: prepare for xe driver display integration Jani Nikula
                   ` (8 preceding siblings ...)
  2023-09-12 11:06 ` [PATCH 09/19] drm/i915/display: add I915 conditional build to intel_overlay.h Jani Nikula
@ 2023-09-12 11:06 ` Jani Nikula
  2023-09-12 11:06 ` [PATCH 11/19] drm/i915/display: add I915 conditional build to intel_dpio_phy.h Jani Nikula
                   ` (9 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Jani Nikula @ 2023-09-12 11:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, dri-devel

Add stubs for !I915.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/g4x_dp.h | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/g4x_dp.h b/drivers/gpu/drm/i915/display/g4x_dp.h
index a38b3e1e01d3..a10638ab749c 100644
--- a/drivers/gpu/drm/i915/display/g4x_dp.h
+++ b/drivers/gpu/drm/i915/display/g4x_dp.h
@@ -17,6 +17,7 @@ struct intel_crtc_state;
 struct intel_dp;
 struct intel_encoder;
 
+#ifdef I915
 const struct dpll *vlv_get_dpll(struct drm_i915_private *i915);
 enum pipe vlv_active_pipe(struct intel_dp *intel_dp);
 void g4x_dp_set_clock(struct intel_encoder *encoder,
@@ -26,5 +27,30 @@ bool g4x_dp_port_enabled(struct drm_i915_private *dev_priv,
 			 enum pipe *pipe);
 bool g4x_dp_init(struct drm_i915_private *dev_priv,
 		 i915_reg_t output_reg, enum port port);
+#else
+static inline const struct dpll *vlv_get_dpll(struct drm_i915_private *i915)
+{
+	return NULL;
+}
+static inline int vlv_active_pipe(struct intel_dp *intel_dp)
+{
+	return 0;
+}
+static inline void g4x_dp_set_clock(struct intel_encoder *encoder,
+				    struct intel_crtc_state *pipe_config)
+{
+}
+static inline bool g4x_dp_port_enabled(struct drm_i915_private *dev_priv,
+				       i915_reg_t dp_reg, int port,
+				       enum pipe *pipe)
+{
+	return false;
+}
+static inline bool g4x_dp_init(struct drm_i915_private *dev_priv,
+			       i915_reg_t output_reg, int port)
+{
+	return false;
+}
+#endif
 
 #endif
-- 
2.39.2


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

* [PATCH 11/19] drm/i915/display: add I915 conditional build to intel_dpio_phy.h
  2023-09-12 11:06 [PATCH 00/19] drm/i915: prepare for xe driver display integration Jani Nikula
                   ` (9 preceding siblings ...)
  2023-09-12 11:06 ` [PATCH 10/19] drm/i915/display: add I915 conditional build to g4x_dp.h Jani Nikula
@ 2023-09-12 11:06 ` Jani Nikula
  2023-09-12 11:06 ` [PATCH 12/19] drm/i915/display: add I915 conditional build to intel_crt.h Jani Nikula
                   ` (8 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Jani Nikula @ 2023-09-12 11:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, dri-devel

Add stubs for !I915.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dpio_phy.h | 96 +++++++++++++++++++
 1 file changed, 96 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_dpio_phy.h b/drivers/gpu/drm/i915/display/intel_dpio_phy.h
index 9c7725dacb47..4d43dbbdf81c 100644
--- a/drivers/gpu/drm/i915/display/intel_dpio_phy.h
+++ b/drivers/gpu/drm/i915/display/intel_dpio_phy.h
@@ -26,6 +26,7 @@ enum dpio_phy {
 	DPIO_PHY2,
 };
 
+#ifdef I915
 void bxt_port_to_phy_channel(struct drm_i915_private *dev_priv, enum port port,
 			     enum dpio_phy *phy, enum dpio_channel *ch);
 void bxt_ddi_phy_set_signal_levels(struct intel_encoder *encoder,
@@ -70,5 +71,100 @@ void vlv_phy_pre_encoder_enable(struct intel_encoder *encoder,
 				const struct intel_crtc_state *crtc_state);
 void vlv_phy_reset_lanes(struct intel_encoder *encoder,
 			 const struct intel_crtc_state *old_crtc_state);
+#else
+static inline void bxt_port_to_phy_channel(struct drm_i915_private *dev_priv, enum port port,
+					   enum dpio_phy *phy, enum dpio_channel *ch)
+{
+}
+static inline void bxt_ddi_phy_set_signal_levels(struct intel_encoder *encoder,
+						 const struct intel_crtc_state *crtc_state)
+{
+}
+static inline void bxt_ddi_phy_init(struct drm_i915_private *dev_priv, enum dpio_phy phy)
+{
+}
+static inline void bxt_ddi_phy_uninit(struct drm_i915_private *dev_priv, enum dpio_phy phy)
+{
+}
+static inline bool bxt_ddi_phy_is_enabled(struct drm_i915_private *dev_priv,
+					  enum dpio_phy phy)
+{
+	return false;
+}
+static inline bool bxt_ddi_phy_verify_state(struct drm_i915_private *dev_priv,
+					    enum dpio_phy phy)
+{
+	return true;
+}
+static inline u8 bxt_ddi_phy_calc_lane_lat_optim_mask(u8 lane_count)
+{
+	return 0;
+}
+static inline void bxt_ddi_phy_set_lane_optim_mask(struct intel_encoder *encoder,
+						   u8 lane_lat_optim_mask)
+{
+}
+static inline u8 bxt_ddi_phy_get_lane_lat_optim_mask(struct intel_encoder *encoder)
+{
+	return 0;
+}
+static inline enum dpio_channel vlv_dig_port_to_channel(struct intel_digital_port *dig_port)
+{
+	return DPIO_CH0;
+}
+static inline enum dpio_phy vlv_dig_port_to_phy(struct intel_digital_port *dig_port)
+{
+	return DPIO_PHY0;
+}
+static inline enum dpio_channel vlv_pipe_to_channel(enum pipe pipe)
+{
+	return DPIO_CH0;
+}
+static inline void chv_set_phy_signal_level(struct intel_encoder *encoder,
+					    const struct intel_crtc_state *crtc_state,
+					    u32 deemph_reg_value, u32 margin_reg_value,
+					    bool uniq_trans_scale)
+{
+}
+static inline void chv_data_lane_soft_reset(struct intel_encoder *encoder,
+					    const struct intel_crtc_state *crtc_state,
+					    bool reset)
+{
+}
+static inline void chv_phy_pre_pll_enable(struct intel_encoder *encoder,
+					  const struct intel_crtc_state *crtc_state)
+{
+}
+static inline void chv_phy_pre_encoder_enable(struct intel_encoder *encoder,
+					      const struct intel_crtc_state *crtc_state)
+{
+}
+static inline void chv_phy_release_cl2_override(struct intel_encoder *encoder)
+{
+}
+static inline void chv_phy_post_pll_disable(struct intel_encoder *encoder,
+					    const struct intel_crtc_state *old_crtc_state)
+{
+}
+
+static inline void vlv_set_phy_signal_level(struct intel_encoder *encoder,
+					    const struct intel_crtc_state *crtc_state,
+					    u32 demph_reg_value, u32 preemph_reg_value,
+					    u32 uniqtranscale_reg_value, u32 tx3_demph)
+{
+}
+static inline void vlv_phy_pre_pll_enable(struct intel_encoder *encoder,
+					  const struct intel_crtc_state *crtc_state)
+{
+}
+static inline void vlv_phy_pre_encoder_enable(struct intel_encoder *encoder,
+					      const struct intel_crtc_state *crtc_state)
+{
+}
+static inline void vlv_phy_reset_lanes(struct intel_encoder *encoder,
+				       const struct intel_crtc_state *old_crtc_state)
+{
+}
+#endif
 
 #endif /* __INTEL_DPIO_PHY_H__ */
-- 
2.39.2


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

* [PATCH 12/19] drm/i915/display: add I915 conditional build to intel_crt.h
  2023-09-12 11:06 [PATCH 00/19] drm/i915: prepare for xe driver display integration Jani Nikula
                   ` (10 preceding siblings ...)
  2023-09-12 11:06 ` [PATCH 11/19] drm/i915/display: add I915 conditional build to intel_dpio_phy.h Jani Nikula
@ 2023-09-12 11:06 ` Jani Nikula
  2023-09-12 11:06 ` [PATCH 13/19] drm/i915/display: add I915 conditional build to vlv_dsi.h Jani Nikula
                   ` (7 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Jani Nikula @ 2023-09-12 11:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, dri-devel

Add stubs for !I915.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_crt.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_crt.h b/drivers/gpu/drm/i915/display/intel_crt.h
index c6071efd93ce..fe7690c2b948 100644
--- a/drivers/gpu/drm/i915/display/intel_crt.h
+++ b/drivers/gpu/drm/i915/display/intel_crt.h
@@ -12,9 +12,23 @@ enum pipe;
 struct drm_encoder;
 struct drm_i915_private;
 
+#ifdef I915
 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);
+#else
+static inline bool intel_crt_port_enabled(struct drm_i915_private *dev_priv,
+					  i915_reg_t adpa_reg, enum pipe *pipe)
+{
+	return false;
+}
+static inline void intel_crt_init(struct drm_i915_private *dev_priv)
+{
+}
+static inline void intel_crt_reset(struct drm_encoder *encoder)
+{
+}
+#endif
 
 #endif /* __INTEL_CRT_H__ */
-- 
2.39.2


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

* [PATCH 13/19] drm/i915/display: add I915 conditional build to vlv_dsi.h
  2023-09-12 11:06 [PATCH 00/19] drm/i915: prepare for xe driver display integration Jani Nikula
                   ` (11 preceding siblings ...)
  2023-09-12 11:06 ` [PATCH 12/19] drm/i915/display: add I915 conditional build to intel_crt.h Jani Nikula
@ 2023-09-12 11:06 ` Jani Nikula
  2023-09-12 11:06 ` [PATCH 14/19] drm/i915/display: add I915 conditional build to i9xx_wm.h Jani Nikula
                   ` (6 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Jani Nikula @ 2023-09-12 11:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, dri-devel

Add stubs for !I915.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/vlv_dsi.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.h b/drivers/gpu/drm/i915/display/vlv_dsi.h
index 0c2b279df9d4..cf9d7b82f288 100644
--- a/drivers/gpu/drm/i915/display/vlv_dsi.h
+++ b/drivers/gpu/drm/i915/display/vlv_dsi.h
@@ -12,8 +12,21 @@ enum port;
 struct drm_i915_private;
 struct intel_dsi;
 
+#ifdef I915
 void vlv_dsi_wait_for_fifo_empty(struct intel_dsi *intel_dsi, enum port port);
 enum mipi_dsi_pixel_format pixel_format_from_register_bits(u32 fmt);
 void vlv_dsi_init(struct drm_i915_private *dev_priv);
+#else
+static inline void vlv_dsi_wait_for_fifo_empty(struct intel_dsi *intel_dsi, enum port port)
+{
+}
+static inline enum mipi_dsi_pixel_format pixel_format_from_register_bits(u32 fmt)
+{
+	return 0;
+}
+static inline void vlv_dsi_init(struct drm_i915_private *dev_priv)
+{
+}
+#endif
 
 #endif /* __VLV_DSI_H__ */
-- 
2.39.2


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

* [PATCH 14/19] drm/i915/display: add I915 conditional build to i9xx_wm.h
  2023-09-12 11:06 [PATCH 00/19] drm/i915: prepare for xe driver display integration Jani Nikula
                   ` (12 preceding siblings ...)
  2023-09-12 11:06 ` [PATCH 13/19] drm/i915/display: add I915 conditional build to vlv_dsi.h Jani Nikula
@ 2023-09-12 11:06 ` Jani Nikula
  2023-09-12 11:06 ` [PATCH 15/19] drm/i915/display: add I915 conditional build to g4x_hdmi.h Jani Nikula
                   ` (5 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Jani Nikula @ 2023-09-12 11:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, dri-devel

Add stubs for !I915.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/i9xx_wm.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/i9xx_wm.h b/drivers/gpu/drm/i915/display/i9xx_wm.h
index b87ae369685a..de0920730ab2 100644
--- a/drivers/gpu/drm/i915/display/i9xx_wm.h
+++ b/drivers/gpu/drm/i915/display/i9xx_wm.h
@@ -12,9 +12,26 @@ struct drm_i915_private;
 struct intel_crtc_state;
 struct intel_plane_state;
 
+#ifdef I915
 bool ilk_disable_lp_wm(struct drm_i915_private *i915);
 void ilk_wm_sanitize(struct drm_i915_private *i915);
 bool intel_set_memory_cxsr(struct drm_i915_private *i915, bool enable);
 void i9xx_wm_init(struct drm_i915_private *i915);
+#else
+static inline bool ilk_disable_lp_wm(struct drm_i915_private *i915)
+{
+	return false;
+}
+static inline void ilk_wm_sanitize(struct drm_i915_private *i915)
+{
+}
+static inline bool intel_set_memory_cxsr(struct drm_i915_private *i915, bool enable)
+{
+	return false;
+}
+static inline void i9xx_wm_init(struct drm_i915_private *i915)
+{
+}
+#endif
 
 #endif /* __I9XX_WM_H__ */
-- 
2.39.2


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

* [PATCH 15/19] drm/i915/display: add I915 conditional build to g4x_hdmi.h
  2023-09-12 11:06 [PATCH 00/19] drm/i915: prepare for xe driver display integration Jani Nikula
                   ` (13 preceding siblings ...)
  2023-09-12 11:06 ` [PATCH 14/19] drm/i915/display: add I915 conditional build to i9xx_wm.h Jani Nikula
@ 2023-09-12 11:06 ` Jani Nikula
  2023-09-12 11:06 ` [PATCH 16/19] drm/i915/display: add I915 conditional build to intel_dvo.h Jani Nikula
                   ` (4 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Jani Nikula @ 2023-09-12 11:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, dri-devel

Add stubs for !I915.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/g4x_hdmi.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/g4x_hdmi.h b/drivers/gpu/drm/i915/display/g4x_hdmi.h
index 1e3ea7f3c846..817f55c7a3a1 100644
--- a/drivers/gpu/drm/i915/display/g4x_hdmi.h
+++ b/drivers/gpu/drm/i915/display/g4x_hdmi.h
@@ -15,9 +15,21 @@ struct drm_atomic_state;
 struct drm_connector;
 struct drm_i915_private;
 
+#ifdef I915
 void g4x_hdmi_init(struct drm_i915_private *dev_priv,
 		   i915_reg_t hdmi_reg, enum port port);
 int g4x_hdmi_connector_atomic_check(struct drm_connector *connector,
 				    struct drm_atomic_state *state);
+#else
+static inline void g4x_hdmi_init(struct drm_i915_private *dev_priv,
+				 i915_reg_t hdmi_reg, int port)
+{
+}
+static inline int g4x_hdmi_connector_atomic_check(struct drm_connector *connector,
+						  struct drm_atomic_state *state)
+{
+	return 0;
+}
+#endif
 
 #endif
-- 
2.39.2


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

* [PATCH 16/19] drm/i915/display: add I915 conditional build to intel_dvo.h
  2023-09-12 11:06 [PATCH 00/19] drm/i915: prepare for xe driver display integration Jani Nikula
                   ` (14 preceding siblings ...)
  2023-09-12 11:06 ` [PATCH 15/19] drm/i915/display: add I915 conditional build to g4x_hdmi.h Jani Nikula
@ 2023-09-12 11:06 ` Jani Nikula
  2023-09-12 11:06 ` [PATCH 17/19] drm/i915/display: add I915 conditional build to intel_sdvo.h Jani Nikula
                   ` (3 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Jani Nikula @ 2023-09-12 11:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, dri-devel

Add stubs for !I915.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dvo.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_dvo.h b/drivers/gpu/drm/i915/display/intel_dvo.h
index 3ed0fdf8efff..bf7a356422ab 100644
--- a/drivers/gpu/drm/i915/display/intel_dvo.h
+++ b/drivers/gpu/drm/i915/display/intel_dvo.h
@@ -8,6 +8,12 @@
 
 struct drm_i915_private;
 
+#ifdef I915
 void intel_dvo_init(struct drm_i915_private *dev_priv);
+#else
+static inline void intel_dvo_init(struct drm_i915_private *dev_priv)
+{
+}
+#endif
 
 #endif /* __INTEL_DVO_H__ */
-- 
2.39.2


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

* [PATCH 17/19] drm/i915/display: add I915 conditional build to intel_sdvo.h
  2023-09-12 11:06 [PATCH 00/19] drm/i915: prepare for xe driver display integration Jani Nikula
                   ` (15 preceding siblings ...)
  2023-09-12 11:06 ` [PATCH 16/19] drm/i915/display: add I915 conditional build to intel_dvo.h Jani Nikula
@ 2023-09-12 11:06 ` Jani Nikula
  2023-09-12 11:06 ` [PATCH 18/19] drm/i915/display: add I915 conditional build to intel_tv.h Jani Nikula
                   ` (2 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Jani Nikula @ 2023-09-12 11:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, dri-devel

Add stubs for !I915.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_sdvo.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.h b/drivers/gpu/drm/i915/display/intel_sdvo.h
index 2868852c85f2..d1815b4103d4 100644
--- a/drivers/gpu/drm/i915/display/intel_sdvo.h
+++ b/drivers/gpu/drm/i915/display/intel_sdvo.h
@@ -14,9 +14,22 @@ struct drm_i915_private;
 enum pipe;
 enum port;
 
+#ifdef I915
 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);
+#else
+static inline bool intel_sdvo_port_enabled(struct drm_i915_private *dev_priv,
+					   i915_reg_t sdvo_reg, enum pipe *pipe)
+{
+	return false;
+}
+static inline bool intel_sdvo_init(struct drm_i915_private *dev_priv,
+				   i915_reg_t reg, enum port port)
+{
+	return false;
+}
+#endif
 
 #endif /* __INTEL_SDVO_H__ */
-- 
2.39.2


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

* [PATCH 18/19] drm/i915/display: add I915 conditional build to intel_tv.h
  2023-09-12 11:06 [PATCH 00/19] drm/i915: prepare for xe driver display integration Jani Nikula
                   ` (16 preceding siblings ...)
  2023-09-12 11:06 ` [PATCH 17/19] drm/i915/display: add I915 conditional build to intel_sdvo.h Jani Nikula
@ 2023-09-12 11:06 ` Jani Nikula
  2023-09-12 11:06 ` [PATCH 19/19] drm/i915/display: add I915 conditional build to vlv_dsi_pll.h Jani Nikula
  2023-09-14 14:53 ` [PATCH 00/19] drm/i915: prepare for xe driver display integration Rodrigo Vivi
  19 siblings, 0 replies; 22+ messages in thread
From: Jani Nikula @ 2023-09-12 11:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, dri-devel

Add stubs for !I915.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_tv.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_tv.h b/drivers/gpu/drm/i915/display/intel_tv.h
index 44518575ec5c..f08827b8bf2b 100644
--- a/drivers/gpu/drm/i915/display/intel_tv.h
+++ b/drivers/gpu/drm/i915/display/intel_tv.h
@@ -8,6 +8,12 @@
 
 struct drm_i915_private;
 
+#ifdef I915
 void intel_tv_init(struct drm_i915_private *dev_priv);
+#else
+static inline void intel_tv_init(struct drm_i915_private *dev_priv)
+{
+}
+#endif
 
 #endif /* __INTEL_TV_H__ */
-- 
2.39.2


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

* [PATCH 19/19] drm/i915/display: add I915 conditional build to vlv_dsi_pll.h
  2023-09-12 11:06 [PATCH 00/19] drm/i915: prepare for xe driver display integration Jani Nikula
                   ` (17 preceding siblings ...)
  2023-09-12 11:06 ` [PATCH 18/19] drm/i915/display: add I915 conditional build to intel_tv.h Jani Nikula
@ 2023-09-12 11:06 ` Jani Nikula
  2023-09-14 14:53 ` [PATCH 00/19] drm/i915: prepare for xe driver display integration Rodrigo Vivi
  19 siblings, 0 replies; 22+ messages in thread
From: Jani Nikula @ 2023-09-12 11:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, dri-devel

Add stubs for !I915. Not all the functions need to be stubbed.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/vlv_dsi_pll.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/vlv_dsi_pll.h b/drivers/gpu/drm/i915/display/vlv_dsi_pll.h
index ab9291ad1e79..fbe5113dbeb9 100644
--- a/drivers/gpu/drm/i915/display/vlv_dsi_pll.h
+++ b/drivers/gpu/drm/i915/display/vlv_dsi_pll.h
@@ -32,7 +32,16 @@ u32 bxt_dsi_get_pclk(struct intel_encoder *encoder,
 		     struct intel_crtc_state *config);
 void bxt_dsi_reset_clocks(struct intel_encoder *encoder, enum port port);
 
+#ifdef I915
 void assert_dsi_pll_enabled(struct drm_i915_private *i915);
 void assert_dsi_pll_disabled(struct drm_i915_private *i915);
+#else
+static inline void assert_dsi_pll_enabled(struct drm_i915_private *i915)
+{
+}
+static inline void assert_dsi_pll_disabled(struct drm_i915_private *i915)
+{
+}
+#endif
 
 #endif /* __VLV_DSI_PLL_H__ */
-- 
2.39.2


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

* Re: [PATCH 00/19] drm/i915: prepare for xe driver display integration
  2023-09-12 11:06 [PATCH 00/19] drm/i915: prepare for xe driver display integration Jani Nikula
                   ` (18 preceding siblings ...)
  2023-09-12 11:06 ` [PATCH 19/19] drm/i915/display: add I915 conditional build to vlv_dsi_pll.h Jani Nikula
@ 2023-09-14 14:53 ` Rodrigo Vivi
  2023-09-29 11:03   ` Jani Nikula
  19 siblings, 1 reply; 22+ messages in thread
From: Rodrigo Vivi @ 2023-09-14 14:53 UTC (permalink / raw)
  To: Jani Nikula; +Cc: Tvrtko Ursulin, intel-gfx, Lucas De Marchi, dri-devel

On Tue, Sep 12, 2023 at 02:06:27PM +0300, Jani Nikula wrote:
> The upcoming drm/xe driver [1][2] will reuse the drm/i915 display code,
> initially by compiling the relevant compilation units separately as part
> of the xe driver. This series prepares for that in i915 side.
> 
> The first patch defines I915 during the i915 driver build, to allow
> conditional compilation based on the driver the code is being built for.
> 
> The rest of the patches add stubs for functions in files that aren't
> used in xe. The idea is that this is the least intrusive way of skipping
> that code in xe, and is quite similar to the common kconfig stubs.
> 
> While this is arguably unused code for the time being, or only used in
> an out-of-tree driver yet to be upstreamed, the upstreaming has to start
> somewhere.

I see other benefits on adding this right now through drm-intel-next:

1. Separate the good&ready patches from the other patches that are in
   drm-xe-next, that would require more work.
2. Minimize the non-xe patches in the xe pull-request. Cleaner and with
   reduced risk of conflicts.

> 
> 
> BR,
> Jani.
> 
> 
> [1] https://gitlab.freedesktop.org/drm/xe/kernel/-/tree/drm-xe-next
> [2] https://patchwork.freedesktop.org/series/112188/
> 
> Cc: David Airlie <airlied@gmail.com>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>

Yeap, let's for sure get input from other maintainers, but meanwhile I'd
like to state that I have once more reviewed these patches and that
you can put my rv-b tag in all of them when we get the proper acks.

> 
> Jani Nikula (19):
>   drm/i915: define I915 during i915 driver build
>   drm/i915/display: add I915 conditional build to intel_lvds.h
>   drm/i915/display: add I915 conditional build to hsw_ips.h
>   drm/i915/display: add I915 conditional build to i9xx_plane.h
>   drm/i915/display: add I915 conditional build to intel_lpe_audio.h
>   drm/i915/display: add I915 conditional build to intel_pch_refclk.h
>   drm/i915/display: add I915 conditional build to intel_pch_display.h
>   drm/i915/display: add I915 conditional build to intel_sprite.h
>   drm/i915/display: add I915 conditional build to intel_overlay.h
>   drm/i915/display: add I915 conditional build to g4x_dp.h
>   drm/i915/display: add I915 conditional build to intel_dpio_phy.h
>   drm/i915/display: add I915 conditional build to intel_crt.h
>   drm/i915/display: add I915 conditional build to vlv_dsi.h
>   drm/i915/display: add I915 conditional build to i9xx_wm.h
>   drm/i915/display: add I915 conditional build to g4x_hdmi.h
>   drm/i915/display: add I915 conditional build to intel_dvo.h
>   drm/i915/display: add I915 conditional build to intel_sdvo.h
>   drm/i915/display: add I915 conditional build to intel_tv.h
>   drm/i915/display: add I915 conditional build to vlv_dsi_pll.h
> 
>  drivers/gpu/drm/i915/Makefile                 |  4 +
>  drivers/gpu/drm/i915/display/g4x_dp.h         | 26 +++++
>  drivers/gpu/drm/i915/display/g4x_hdmi.h       | 12 +++
>  drivers/gpu/drm/i915/display/hsw_ips.h        | 35 +++++++
>  drivers/gpu/drm/i915/display/i9xx_plane.h     | 23 +++++
>  drivers/gpu/drm/i915/display/i9xx_wm.h        | 17 ++++
>  drivers/gpu/drm/i915/display/intel_crt.h      | 14 +++
>  drivers/gpu/drm/i915/display/intel_dpio_phy.h | 96 +++++++++++++++++++
>  drivers/gpu/drm/i915/display/intel_dvo.h      |  6 ++
>  .../gpu/drm/i915/display/intel_lpe_audio.h    | 18 ++++
>  drivers/gpu/drm/i915/display/intel_lvds.h     | 19 ++++
>  drivers/gpu/drm/i915/display/intel_overlay.h  | 35 +++++++
>  .../gpu/drm/i915/display/intel_pch_display.h  | 53 ++++++++++
>  .../gpu/drm/i915/display/intel_pch_refclk.h   | 23 +++++
>  drivers/gpu/drm/i915/display/intel_sdvo.h     | 13 +++
>  drivers/gpu/drm/i915/display/intel_sprite.h   |  8 ++
>  drivers/gpu/drm/i915/display/intel_tv.h       |  6 ++
>  drivers/gpu/drm/i915/display/vlv_dsi.h        | 13 +++
>  drivers/gpu/drm/i915/display/vlv_dsi_pll.h    |  9 ++
>  19 files changed, 430 insertions(+)
> 
> -- 
> 2.39.2
> 

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

* Re: [PATCH 00/19] drm/i915: prepare for xe driver display integration
  2023-09-14 14:53 ` [PATCH 00/19] drm/i915: prepare for xe driver display integration Rodrigo Vivi
@ 2023-09-29 11:03   ` Jani Nikula
  0 siblings, 0 replies; 22+ messages in thread
From: Jani Nikula @ 2023-09-29 11:03 UTC (permalink / raw)
  To: Rodrigo Vivi; +Cc: Tvrtko Ursulin, intel-gfx, Lucas De Marchi, dri-devel

On Thu, 14 Sep 2023, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> On Tue, Sep 12, 2023 at 02:06:27PM +0300, Jani Nikula wrote:
>> The upcoming drm/xe driver [1][2] will reuse the drm/i915 display code,
>> initially by compiling the relevant compilation units separately as part
>> of the xe driver. This series prepares for that in i915 side.
>> 
>> The first patch defines I915 during the i915 driver build, to allow
>> conditional compilation based on the driver the code is being built for.
>> 
>> The rest of the patches add stubs for functions in files that aren't
>> used in xe. The idea is that this is the least intrusive way of skipping
>> that code in xe, and is quite similar to the common kconfig stubs.
>> 
>> While this is arguably unused code for the time being, or only used in
>> an out-of-tree driver yet to be upstreamed, the upstreaming has to start
>> somewhere.
>
> I see other benefits on adding this right now through drm-intel-next:
>
> 1. Separate the good&ready patches from the other patches that are in
>    drm-xe-next, that would require more work.
> 2. Minimize the non-xe patches in the xe pull-request. Cleaner and with
>    reduced risk of conflicts.
>
>> 
>> 
>> BR,
>> Jani.
>> 
>> 
>> [1] https://gitlab.freedesktop.org/drm/xe/kernel/-/tree/drm-xe-next
>> [2] https://patchwork.freedesktop.org/series/112188/
>> 
>> Cc: David Airlie <airlied@gmail.com>
>> Cc: Daniel Vetter <daniel@ffwll.ch>
>> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
>> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
>
> Yeap, let's for sure get input from other maintainers, but meanwhile I'd
> like to state that I have once more reviewed these patches and that
> you can put my rv-b tag in all of them when we get the proper acks.

Thanks. Pushed to drm-intel-next with Dave's IRC ack.

BR,
Jani.


>
>> 
>> Jani Nikula (19):
>>   drm/i915: define I915 during i915 driver build
>>   drm/i915/display: add I915 conditional build to intel_lvds.h
>>   drm/i915/display: add I915 conditional build to hsw_ips.h
>>   drm/i915/display: add I915 conditional build to i9xx_plane.h
>>   drm/i915/display: add I915 conditional build to intel_lpe_audio.h
>>   drm/i915/display: add I915 conditional build to intel_pch_refclk.h
>>   drm/i915/display: add I915 conditional build to intel_pch_display.h
>>   drm/i915/display: add I915 conditional build to intel_sprite.h
>>   drm/i915/display: add I915 conditional build to intel_overlay.h
>>   drm/i915/display: add I915 conditional build to g4x_dp.h
>>   drm/i915/display: add I915 conditional build to intel_dpio_phy.h
>>   drm/i915/display: add I915 conditional build to intel_crt.h
>>   drm/i915/display: add I915 conditional build to vlv_dsi.h
>>   drm/i915/display: add I915 conditional build to i9xx_wm.h
>>   drm/i915/display: add I915 conditional build to g4x_hdmi.h
>>   drm/i915/display: add I915 conditional build to intel_dvo.h
>>   drm/i915/display: add I915 conditional build to intel_sdvo.h
>>   drm/i915/display: add I915 conditional build to intel_tv.h
>>   drm/i915/display: add I915 conditional build to vlv_dsi_pll.h
>> 
>>  drivers/gpu/drm/i915/Makefile                 |  4 +
>>  drivers/gpu/drm/i915/display/g4x_dp.h         | 26 +++++
>>  drivers/gpu/drm/i915/display/g4x_hdmi.h       | 12 +++
>>  drivers/gpu/drm/i915/display/hsw_ips.h        | 35 +++++++
>>  drivers/gpu/drm/i915/display/i9xx_plane.h     | 23 +++++
>>  drivers/gpu/drm/i915/display/i9xx_wm.h        | 17 ++++
>>  drivers/gpu/drm/i915/display/intel_crt.h      | 14 +++
>>  drivers/gpu/drm/i915/display/intel_dpio_phy.h | 96 +++++++++++++++++++
>>  drivers/gpu/drm/i915/display/intel_dvo.h      |  6 ++
>>  .../gpu/drm/i915/display/intel_lpe_audio.h    | 18 ++++
>>  drivers/gpu/drm/i915/display/intel_lvds.h     | 19 ++++
>>  drivers/gpu/drm/i915/display/intel_overlay.h  | 35 +++++++
>>  .../gpu/drm/i915/display/intel_pch_display.h  | 53 ++++++++++
>>  .../gpu/drm/i915/display/intel_pch_refclk.h   | 23 +++++
>>  drivers/gpu/drm/i915/display/intel_sdvo.h     | 13 +++
>>  drivers/gpu/drm/i915/display/intel_sprite.h   |  8 ++
>>  drivers/gpu/drm/i915/display/intel_tv.h       |  6 ++
>>  drivers/gpu/drm/i915/display/vlv_dsi.h        | 13 +++
>>  drivers/gpu/drm/i915/display/vlv_dsi_pll.h    |  9 ++
>>  19 files changed, 430 insertions(+)
>> 
>> -- 
>> 2.39.2
>> 

-- 
Jani Nikula, Intel

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

end of thread, other threads:[~2023-09-29 11:03 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-12 11:06 [PATCH 00/19] drm/i915: prepare for xe driver display integration Jani Nikula
2023-09-12 11:06 ` [PATCH 01/19] drm/i915: define I915 during i915 driver build Jani Nikula
2023-09-12 11:06 ` [PATCH 02/19] drm/i915/display: add I915 conditional build to intel_lvds.h Jani Nikula
2023-09-12 11:06 ` [PATCH 03/19] drm/i915/display: add I915 conditional build to hsw_ips.h Jani Nikula
2023-09-12 11:06 ` [PATCH 04/19] drm/i915/display: add I915 conditional build to i9xx_plane.h Jani Nikula
2023-09-12 11:06 ` [PATCH 05/19] drm/i915/display: add I915 conditional build to intel_lpe_audio.h Jani Nikula
2023-09-12 11:06 ` [PATCH 06/19] drm/i915/display: add I915 conditional build to intel_pch_refclk.h Jani Nikula
2023-09-12 11:06 ` [PATCH 07/19] drm/i915/display: add I915 conditional build to intel_pch_display.h Jani Nikula
2023-09-12 11:06 ` [PATCH 08/19] drm/i915/display: add I915 conditional build to intel_sprite.h Jani Nikula
2023-09-12 11:06 ` [PATCH 09/19] drm/i915/display: add I915 conditional build to intel_overlay.h Jani Nikula
2023-09-12 11:06 ` [PATCH 10/19] drm/i915/display: add I915 conditional build to g4x_dp.h Jani Nikula
2023-09-12 11:06 ` [PATCH 11/19] drm/i915/display: add I915 conditional build to intel_dpio_phy.h Jani Nikula
2023-09-12 11:06 ` [PATCH 12/19] drm/i915/display: add I915 conditional build to intel_crt.h Jani Nikula
2023-09-12 11:06 ` [PATCH 13/19] drm/i915/display: add I915 conditional build to vlv_dsi.h Jani Nikula
2023-09-12 11:06 ` [PATCH 14/19] drm/i915/display: add I915 conditional build to i9xx_wm.h Jani Nikula
2023-09-12 11:06 ` [PATCH 15/19] drm/i915/display: add I915 conditional build to g4x_hdmi.h Jani Nikula
2023-09-12 11:06 ` [PATCH 16/19] drm/i915/display: add I915 conditional build to intel_dvo.h Jani Nikula
2023-09-12 11:06 ` [PATCH 17/19] drm/i915/display: add I915 conditional build to intel_sdvo.h Jani Nikula
2023-09-12 11:06 ` [PATCH 18/19] drm/i915/display: add I915 conditional build to intel_tv.h Jani Nikula
2023-09-12 11:06 ` [PATCH 19/19] drm/i915/display: add I915 conditional build to vlv_dsi_pll.h Jani Nikula
2023-09-14 14:53 ` [PATCH 00/19] drm/i915: prepare for xe driver display integration Rodrigo Vivi
2023-09-29 11:03   ` Jani Nikula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).