linux/drivers/gpu/drm/i915/display
Maxime Ripard eca22edb37
drm: Pass the full state to connectors atomic functions
The current atomic helpers have either their object state being passed as
an argument or the full atomic state.

The former is the pattern that was done at first, before switching to the
latter for new hooks or when it was needed.

Now that the CRTCs have been converted, let's move forward with the
connectors to provide a consistent interface.

The conversion was done using the coccinelle script below, and built tested
on all the drivers.

@@
identifier connector, connector_state;
@@

 struct drm_connector_helper_funcs {
	...
	struct drm_encoder* (*atomic_best_encoder)(struct drm_connector *connector,
-						   struct drm_connector_state *connector_state);
+						   struct drm_atomic_state *state);
	...
}

@@
identifier connector, connector_state;
@@

 struct drm_connector_helper_funcs {
	...
	void (*atomic_commit)(struct drm_connector *connector,
-			      struct drm_connector_state *connector_state);
+			      struct drm_atomic_state *state);
	...
}

@@
struct drm_connector_helper_funcs *FUNCS;
identifier state;
identifier connector, connector_state;
identifier f;
@@

 f(..., struct drm_atomic_state *state, ...)
 {
	<+...
-	FUNCS->atomic_commit(connector, connector_state);
+	FUNCS->atomic_commit(connector, state);
	...+>
 }

@@
struct drm_connector_helper_funcs *FUNCS;
identifier state;
identifier connector, connector_state;
identifier var, f;
@@

 f(struct drm_atomic_state *state, ...)
 {
	<+...
-	var = FUNCS->atomic_best_encoder(connector, connector_state);
+	var = FUNCS->atomic_best_encoder(connector, state);
	...+>
 }

@ connector_atomic_func @
identifier helpers;
identifier func;
@@

(
static struct drm_connector_helper_funcs helpers = {
	...,
	.atomic_best_encoder = func,
	...,
};
|
static struct drm_connector_helper_funcs helpers = {
	...,
	.atomic_commit = func,
	...,
};
)

@@
identifier connector_atomic_func.func;
identifier connector;
symbol state;
@@

 func(struct drm_connector *connector,
-      struct drm_connector_state *state
+      struct drm_connector_state *connector_state
      )
 {
	...
-	state
+	connector_state
 	...
 }

@ ignores_state @
identifier connector_atomic_func.func;
identifier connector, connector_state;
@@

 func(struct drm_connector *connector,
      struct drm_connector_state *connector_state)
{
	... when != connector_state
}

@ adds_state depends on connector_atomic_func && !ignores_state @
identifier connector_atomic_func.func;
identifier connector, connector_state;
@@

 func(struct drm_connector *connector, struct drm_connector_state *connector_state)
 {
+	struct drm_connector_state *connector_state = drm_atomic_get_new_connector_state(state, connector);
	...
 }

@ depends on connector_atomic_func @
identifier connector_atomic_func.func;
identifier connector_state;
identifier connector;
@@

 func(struct drm_connector *connector,
-     struct drm_connector_state *connector_state
+     struct drm_atomic_state *state
	   )
 { ... }

@ include depends on adds_state @
@@

 #include <drm/drm_atomic.h>

@ no_include depends on !include && adds_state @
@@

+ #include <drm/drm_atomic.h>
  #include <drm/...>

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Cc: Leo Li <sunpeng.li@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Cc: Melissa Wen <melissa.srw@gmail.com>
Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201118094758.506730-1-maxime@cerno.tech
2020-11-20 12:23:53 +01:00
..
dvo_ch7xxx.c
dvo_ch7017.c
dvo_ivch.c
dvo_ns2501.c
dvo_sil164.c
dvo_tfp410.c
icl_dsi.c drm/i915/jsl: Split EHL/JSL platform info and PCI ids 2020-10-14 09:31:34 +02:00
intel_acpi.c
intel_acpi.h
intel_atomic_plane.c drm/i915: Enable scaling filter for plane and CRTC 2020-10-21 12:21:04 +03:00
intel_atomic_plane.h
intel_atomic.c drm/i915: Remove the old global state stuff 2020-09-17 20:08:08 +03:00
intel_atomic.h drm/i915: Remove the old global state stuff 2020-09-17 20:08:08 +03:00
intel_audio.c drm/i915: Nuke force_min_cdclk_changed 2020-09-17 20:10:21 +03:00
intel_audio.h
intel_bios.c drm/i915: Use AUX_CH_USBCn for the RKL VBT AUX CH setup 2020-10-30 14:47:52 +02:00
intel_bios.h
intel_bw.c drm/i915: Fix wrong CDCLK adjustment changes 2020-06-04 11:11:56 -07:00
intel_bw.h drm/i915: Fix includes and local vars order 2020-05-22 14:40:35 +01:00
intel_cdclk.c drm/i915/rkl: Add new cdclk table 2020-10-16 08:47:08 -07:00
intel_cdclk.h drm/i915: Nuke force_min_cdclk_changed 2020-09-17 20:10:21 +03:00
intel_color.c drm/i915: Replace some gamma_mode ifs with switches 2020-09-28 18:09:52 +03:00
intel_color.h
intel_combo_phy.c drm/i915/jsl: Split EHL/JSL platform info and PCI ids 2020-10-14 09:31:34 +02:00
intel_combo_phy.h
intel_connector.c drm/i915: Add connector dbgfs for all connectors 2020-04-17 13:12:10 +05:30
intel_connector.h
intel_crt.c drm/i915: Reduce INTEL_DISPLAY_ENABLED to just treat outputs as disconnected 2020-09-15 15:28:21 +03:00
intel_crt.h
intel_csr.c drm/i915/dg1: Load DMC 2020-10-15 14:14:33 -07:00
intel_csr.h
intel_ddi.c drm/i915: Give DDI encoders even better names 2020-10-30 14:47:15 +02:00
intel_ddi.h drm/i915: Eliminate intel_dp.regs.dp_tp_{ctl,status} 2020-10-01 16:45:57 +03:00
intel_de.h
intel_display_debugfs.c drm/i915/dg1: Update DMC_DEBUG register 2020-10-15 15:30:22 -07:00
intel_display_debugfs.h
intel_display_power.c drm/i915: Reorder hpd init vs. display resume 2020-10-20 20:18:32 +03:00
intel_display_power.h drm/i915/dg1: Add DG1 power wells 2020-10-15 14:14:29 -07:00
intel_display_types.h drm/i915: Enable scaling filter for plane and CRTC 2020-10-21 12:21:04 +03:00
intel_display.c Merge tag 'drm-intel-next-queued-2020-11-03' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2020-11-04 12:17:34 +10:00
intel_display.h drm/i915: Introduce AUX_CH_USBCn 2020-10-30 14:47:37 +02:00
intel_dp_aux_backlight.c drm/i915/dp: Tweak initial dpcd backlight.enabled value 2020-10-19 13:29:42 -04:00
intel_dp_aux_backlight.h
intel_dp_hdcp.c drm/i915: Add HDCP 1.4 support for MST connectors 2020-09-01 13:03:05 +05:30
intel_dp_link_training.c drm/i915: Switch to LTTPR non-transparent mode link training 2020-10-12 15:33:03 +03:00
intel_dp_link_training.h drm/i915: Switch to LTTPR non-transparent mode link training 2020-10-12 15:33:03 +03:00
intel_dp_mst.c drm: Pass the full state to connectors atomic functions 2020-11-20 12:23:53 +01:00
intel_dp_mst.h drm/i915/display: prefer dig_port to reference intel_digital_port 2020-07-02 11:26:37 -07:00
intel_dp.c drm/i915: Pimp AUX CH names 2020-10-30 14:47:46 +02:00
intel_dp.h drm/i915: s/intel_dp_sink_dpms/intel_dp_set_power/ 2020-10-20 20:13:03 +03:00
intel_dpio_phy.c drm/i915: Plumb crtc_state to link training 2020-10-01 16:45:57 +03:00
intel_dpio_phy.h drm/i915: Plumb crtc_state to link training 2020-10-01 16:45:57 +03:00
intel_dpll_mgr.c drm: fix some kernel-doc markups 2020-11-16 20:48:20 +01:00
intel_dpll_mgr.h drm/i915/dg1: Add DPLL macros for DG1 2020-10-15 14:14:30 -07:00
intel_dsb.c drm/i915/display: fix missing null check on allocated dsb object 2020-06-30 14:26:51 +03:00
intel_dsb.h drm/i915/dsb: Pre allocate and late cleanup of cmd buffer 2020-05-23 15:42:28 +05:30
intel_dsi_dcs_backlight.c
intel_dsi_dcs_backlight.h
intel_dsi_vbt.c drm/i915: drop a bunch of superfluous inlines 2020-04-21 09:31:37 +03:00
intel_dsi.c
intel_dsi.h drm/i915/dsi: Initiate frame request in cmd mode 2020-09-28 20:02:14 +03:00
intel_dvo_dev.h
intel_dvo.c drm/i915: Reduce INTEL_DISPLAY_ENABLED to just treat outputs as disconnected 2020-09-15 15:28:21 +03:00
intel_dvo.h
intel_fbc.c drm/i915/display/fbc: Implement WA 22010751166 2020-10-19 17:25:55 -07:00
intel_fbc.h
intel_fbdev.c drm/i915: Reduce INTEL_DISPLAY_ENABLED to just removing the outputs 2020-09-15 14:57:13 +03:00
intel_fbdev.h
intel_fifo_underrun.c
intel_fifo_underrun.h
intel_frontbuffer.c drm/i915: Add a couple of missing i915_active_fini() 2020-08-17 16:16:34 -04:00
intel_frontbuffer.h
intel_global_state.c drm/i915: Fix global state use-after-frees with a refcount 2020-06-02 16:35:24 +03:00
intel_global_state.h drm/i915: Fix global state use-after-frees with a refcount 2020-06-02 16:35:24 +03:00
intel_gmbus.c drm/i915/dg1: gmbus pin mapping 2020-10-07 13:51:21 -07:00
intel_gmbus.h
intel_hdcp.c drm/i915: dont retry stream management at seq_num_m roll over 2020-09-24 15:44:57 +05:30
intel_hdcp.h drm/i915: Plumb port through hdcp init 2020-09-01 13:02:33 +05:30
intel_hdmi.c drm/i915/dg1: gmbus pin mapping 2020-10-07 13:51:21 -07:00
intel_hdmi.h drm/i915: Do YCbCr 444->420 conversion via DP protocol converters 2020-09-17 18:43:09 +03:00
intel_hotplug.c drm/i915: Refactor .hpd_irq_setup() calls a bit 2020-10-20 20:18:53 +03:00
intel_hotplug.h drm/i915: Reorder hpd init vs. display resume 2020-10-20 20:18:32 +03:00
intel_lpe_audio.c
intel_lpe_audio.h
intel_lspcon.c drm/i915: Nuke lspcon_ycbcr420_config() 2020-10-16 19:44:45 +03:00
intel_lspcon.h drm/i915: Nuke lspcon_ycbcr420_config() 2020-10-16 19:44:45 +03:00
intel_lvds.c drm/i915: Wait for LVDS panel power cycle delay on reboot 2020-10-09 21:12:13 +03:00
intel_lvds.h
intel_opregion.c drm/i915/display: remove debug message from error path 2020-10-28 00:33:46 -07:00
intel_opregion.h
intel_overlay.c drm/i915: Protect overlay colorkey macro arguments 2020-05-15 20:12:56 +03:00
intel_overlay.h
intel_panel.c drm/i915: Reduce INTEL_DISPLAY_ENABLED to just treat outputs as disconnected 2020-09-15 15:28:21 +03:00
intel_panel.h drm/i915: Reduce INTEL_DISPLAY_ENABLED to just treat outputs as disconnected 2020-09-15 15:28:21 +03:00
intel_pipe_crc.c
intel_pipe_crc.h
intel_psr.c drm/i915: Fix encoder lookup during PSR atomic check 2020-10-28 19:15:30 +02:00
intel_psr.h drm/i915/display: Program PSR2 selective fetch registers 2020-10-09 15:07:39 -07:00
intel_quirks.c
intel_quirks.h
intel_sdvo_regs.h drm/i915/sdvo: Fix SDVO colorimetry bit defines 2020-07-09 16:14:47 +03:00
intel_sdvo.c drm/i915: Reduce INTEL_DISPLAY_ENABLED to just treat outputs as disconnected 2020-09-15 15:28:21 +03:00
intel_sdvo.h
intel_sprite.c drm/i915: Enable scaling filter for plane and CRTC 2020-10-21 12:21:04 +03:00
intel_sprite.h drm/i915/rkl: Limit number of universal planes to 5 2020-05-20 08:35:22 -07:00
intel_tc.c drm/i915: Reduce severity for fixing up mistaken VBT tc->legacy_port 2020-10-30 19:10:28 +00:00
intel_tc.h drm/i915: Turn intel_digital_port_connected() in a vfunc 2020-05-11 16:25:15 +03:00
intel_tv.c drm/i915: Reduce INTEL_DISPLAY_ENABLED to just treat outputs as disconnected 2020-09-15 15:28:21 +03:00
intel_tv.h
intel_vbt_defs.h drm/i915/vbt: Add VRR VBT toggle 2020-10-09 14:09:54 -07:00
intel_vdsc.c drm/i915/display: prefer dig_port to reference intel_digital_port 2020-07-02 11:26:37 -07:00
intel_vdsc.h
intel_vga.c
intel_vga.h
vlv_dsi_pll.c drm/i915/vlv_dsi_pll: fix spelling mistake "Cant" -> "Can't" 2020-08-27 16:28:21 +03:00
vlv_dsi.c drm/i915: Wait for VLV/CHV/BXT/GLK DSI panel power cycle delay on reboot 2020-10-09 21:12:13 +03:00