mirror_ubuntu-kernels/drivers/gpu/drm/i915/display
Ville Syrjälä 0425662fdf drm: Nuke mode->vrefresh
Get rid of mode->vrefresh and just calculate it on demand. Saves
a bit of space and avoids the cached value getting out of sync
with reality.

Mostly done with cocci, with the following manual fixups:
- Remove the now empty loop in drm_helper_probe_single_connector_modes()
- Fix __MODE() macro in ch7006_mode.c
- Fix DRM_MODE_ARG() macro in drm_modes.h
- Remove leftover comment from samsung_s6d16d0_mode
- Drop the TODO

@@
@@
struct drm_display_mode {
	...
-	int vrefresh;
	...
};

@@
identifier N;
expression E;
@@
struct drm_display_mode N = {
-	.vrefresh = E
};

@@
identifier N;
expression E;
@@
struct drm_display_mode N[...] = {
...,
{
-	.vrefresh = E
}
,...
};

@@
expression E;
@@
{
	DRM_MODE(...),
-	.vrefresh = E,
}

@@
identifier M, R;
@@
int drm_mode_vrefresh(const struct drm_display_mode *M)
{
  ...
- if (M->vrefresh > 0)
- 	R = M->vrefresh;
- else
  if (...) {
  ...
  }
  ...
}

@@
struct drm_display_mode *p;
expression E;
@@
(
- p->vrefresh = E;
|
- p->vrefresh
+ drm_mode_vrefresh(p)
)

@@
struct drm_display_mode s;
expression E;
@@
(
- s.vrefresh = E;
|
- s.vrefresh
+ drm_mode_vrefresh(&s)
)

@@
expression E;
@@
- drm_mode_vrefresh(E) ? drm_mode_vrefresh(E) : drm_mode_vrefresh(E)
+ drm_mode_vrefresh(E)

@find_substruct@
identifier X;
identifier S;
@@
struct X {
...
	struct drm_display_mode S;
...
};

@@
identifier find_substruct.S;
expression E;
identifier I;
@@
{
.S = {
-	.vrefresh = E
}
}

@@
identifier find_substruct.S;
identifier find_substruct.X;
expression E;
identifier I;
@@
struct X I[...] = {
...,
.S = {
-	.vrefresh = E
}
,...
};

v2: Drop TODO
v3: Rebase
v4: Rebase

Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: Jonas Karlman <jonas@kwiboo.se>
Cc: Jernej Skrabec <jernej.skrabec@siol.net>
Cc: Inki Dae <inki.dae@samsung.com>
Cc: Joonyoung Shim <jy0922.shim@samsung.com>
Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: CK Hu <ck.hu@mediatek.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Jerry Han <hanxu5@huaqin.corp-partner.google.com>
Cc: Icenowy Zheng <icenowy@aosc.io>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Stefan Mavrodiev <stefan@olimex.com>
Cc: Robert Chiras <robert.chiras@nxp.com>
Cc: "Guido Günther" <agx@sigxcpu.org>
Cc: Purism Kernel Team <kernel@puri.sm>
Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: Vincent Abriou <vincent.abriou@st.com>
Cc: VMware Graphics <linux-graphics-maintainer@vmware.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Cc: linux-amlogic@lists.infradead.org
Cc: nouveau@lists.freedesktop.org
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200428171940.19552-4-ville.syrjala@linux.intel.com
2020-05-27 14:31:42 +03:00
..
dvo_ch7xxx.c
dvo_ch7017.c
dvo_ivch.c
dvo_ns2501.c
dvo_sil164.c
dvo_tfp410.c
icl_dsi.c drm/i915/skl, cnl: Split out the WRPLL/LCPLL frequency calculation 2020-03-02 19:36:21 +02:00
intel_acpi.c drm/i915/acpi: Move the code to populate ACPI device ID into intel_acpi 2020-01-24 12:58:39 +02:00
intel_acpi.h drm/i915/acpi: Move the code to populate ACPI device ID into intel_acpi 2020-01-24 12:58:39 +02:00
intel_atomic_plane.c drm/i915: Use intel_plane_data_rate for min_cdclk calculation 2020-03-02 19:27:25 +02:00
intel_atomic_plane.h drm/i915: Use intel_plane_data_rate for min_cdclk calculation 2020-03-02 19:27:25 +02:00
intel_atomic.c drm/i915/atomic: conversion to drm_device based logging macros. 2020-02-11 15:11:50 +02:00
intel_atomic.h drm/i915: Introduce better global state handling 2020-01-31 17:00:44 +02:00
intel_audio.c drm/i915: Add missing HDMI audio pixel clocks for gen12 2020-03-11 20:28:11 +02:00
intel_audio.h
intel_bios.c drm/i915: significantly reduce the use of <drm/i915_drm.h> 2020-02-27 08:35:09 +02:00
intel_bios.h drm/i915: significantly reduce the use of <drm/i915_drm.h> 2020-02-27 08:35:09 +02:00
intel_bw.c drm/i915/display: Make WARN* drm specific where drm_device ptr is available 2020-02-04 11:00:04 +02:00
intel_bw.h drm/i915: Convert bandwidth state to global state 2020-01-31 17:00:44 +02:00
intel_cdclk.c drm/i915: Lock gmbus/aux mutexes while changing cdclk 2020-03-09 22:28:33 +02:00
intel_cdclk.h drm/i915: Read rawclk_freq earlier 2020-02-19 14:09:18 +00:00
intel_color.c drm/i915: Pass the crtc to the low level read_lut() funcs 2020-03-09 22:13:23 +02:00
intel_color.h
intel_combo_phy.c drm/i915/combo_phy: convert to struct drm_device logging macros. 2020-02-11 15:23:33 +02:00
intel_combo_phy.h
intel_connector.c drm/i915/display: Make WARN* drm specific where drm_device ptr is available 2020-02-04 11:00:04 +02:00
intel_connector.h
intel_crt.c drm/i915: significantly reduce the use of <drm/i915_drm.h> 2020-02-27 08:35:09 +02:00
intel_crt.h
intel_csr.c drm/i915/dmc: Use firmware v2.06 for TGL 2020-03-03 11:28:12 +02:00
intel_csr.h drm/i915: move intel_csr.[ch] under display/ 2020-02-14 08:48:12 +02:00
intel_ddi.c drm/i915/dp: Return the right vswing tables 2020-04-06 10:31:16 -07:00
intel_ddi.h drm/i915: Move DPLL frequency calculation to intel_dpll_mgr.c 2020-03-02 19:36:21 +02:00
intel_de.h drm/i915: add display engine uncore helpers 2020-01-23 11:07:00 +02:00
intel_display_debugfs.c drm: Nuke mode->vrefresh 2020-05-27 14:31:42 +03:00
intel_display_debugfs.h drm/i915: have *_debugfs_init() functions return void. 2020-03-18 16:27:22 +01:00
intel_display_power.c drm/i915/tgl: Add Wa_22010178259:tgl 2020-03-02 10:48:56 +02:00
intel_display_power.h drm/i915/tgl: Allow DC5/DC6 entry while PG2 is active 2020-02-26 15:07:42 -08:00
intel_display_types.h Topic pull request for topic/phy-compliance: 2020-04-17 08:52:39 +02:00
intel_display.c drm: Nuke mode->vrefresh 2020-05-27 14:31:42 +03:00
intel_display.h drm/i915: significantly reduce the use of <drm/i915_drm.h> 2020-02-27 08:35:09 +02:00
intel_dp_aux_backlight.c drm/i915: Force DPCD backlight mode on X1 Extreme 2nd Gen 4K AMOLED panel 2020-03-03 20:34:32 -05:00
intel_dp_aux_backlight.h
intel_dp_link_training.c drm/i915/dp: Made intel_dp_adjust_train() non-static 2020-04-08 14:40:48 +02:00
intel_dp_link_training.h drm/i915/dp: Made intel_dp_adjust_train() non-static 2020-04-08 14:40:48 +02:00
intel_dp_mst.c drm/dp_mst: Remove drm_dp_mst_has_audio() 2020-04-07 14:30:13 -04:00
intel_dp_mst.h drm/i915/tgl: Select master transcoder for MST stream 2019-12-23 09:26:41 -08:00
intel_dp.c drm: Nuke mode->vrefresh 2020-05-27 14:31:42 +03:00
intel_dp.h drm/i915/dp: Program vswing, pre-emphasis, test-pattern 2020-04-08 14:41:09 +02:00
intel_dpio_phy.c drm/i915/dpio_phy: convert to drm_device based logging macros. 2020-02-11 15:28:52 +02:00
intel_dpio_phy.h
intel_dpll_mgr.c drm/i915: Fix documentation for intel_dpll_get_freq() 2020-03-09 12:37:23 +02:00
intel_dpll_mgr.h drm/i915: Fix documentation for intel_dpll_get_freq() 2020-03-09 12:37:23 +02:00
intel_dsb.c drm/i915/dsb: convert to drm_device based logging macros. 2020-03-11 12:20:43 +02:00
intel_dsb.h
intel_dsi_dcs_backlight.c drm/i915/display: Make WARN* drm specific where drm_device ptr is available 2020-02-04 11:00:04 +02:00
intel_dsi_dcs_backlight.h
intel_dsi_vbt.c drm/i915: significantly reduce the use of <drm/i915_drm.h> 2020-02-27 08:35:09 +02:00
intel_dsi.c
intel_dsi.h drm/i915: Pass intel_encoder to enc_to_*() 2020-01-13 20:10:51 +02:00
intel_dvo_dev.h
intel_dvo.c drm/i915: significantly reduce the use of <drm/i915_drm.h> 2020-02-27 08:35:09 +02:00
intel_dvo.h
intel_fbc.c drm/i915/display: Do not write in removed FBC fence registers 2020-03-10 13:43:18 -07:00
intel_fbc.h drm/i915/fbc: Move the plane state check into the fbc functions 2020-01-15 17:16:32 +02:00
intel_fbdev.c UAPI Changes: 2020-03-19 10:40:27 +10:00
intel_fbdev.h
intel_fifo_underrun.c drm/i915/fifo_underrun: convert to drm_device based logging. 2020-03-11 12:20:43 +02:00
intel_fifo_underrun.h
intel_frontbuffer.c
intel_frontbuffer.h
intel_global_state.c drm/i915: Introduce better global state handling 2020-01-31 17:00:44 +02:00
intel_global_state.h drm/i915: Introduce better global state handling 2020-01-31 17:00:44 +02:00
intel_gmbus.c drm/i915/gmbus: convert to drm_device based logging, 2020-03-11 12:20:43 +02:00
intel_gmbus.h
intel_hdcp.c drm/i915/hdcp: Mandate (seq_num_V==0) at first RecvId msg 2020-03-04 06:58:36 +05:30
intel_hdcp.h drm/i915: significantly reduce the use of <drm/i915_drm.h> 2020-02-27 08:35:09 +02:00
intel_hdmi.c drm/i915: Limit display Wa_1405510057 to gen11 2020-02-28 20:28:31 +02:00
intel_hdmi.h drm/i915: significantly reduce the use of <drm/i915_drm.h> 2020-02-27 08:35:09 +02:00
intel_hotplug.c drm/i915/hotplug: convert to drm_device based logging. 2020-03-11 12:20:43 +02:00
intel_hotplug.h drm/i915: significantly reduce the use of <drm/i915_drm.h> 2020-02-27 08:35:09 +02:00
intel_lpe_audio.c drm/i915/lpe_audio: convert to drm_device based logging macros. 2020-03-11 12:20:43 +02:00
intel_lpe_audio.h
intel_lspcon.c drm/i915: Pass intel_encoder to enc_to_*() 2020-01-13 20:10:51 +02:00
intel_lspcon.h
intel_lvds.c drm/i915/lvds: convert to drm_device based logging macros. 2020-03-11 12:20:44 +02:00
intel_lvds.h
intel_opregion.c drm/i915: significantly reduce the use of <drm/i915_drm.h> 2020-02-27 08:35:09 +02:00
intel_opregion.h
intel_overlay.c drm/i915/overlay: convert to drm_device based logging. 2020-03-11 12:20:44 +02:00
intel_overlay.h
intel_panel.c drm/i915: panel: Use intel_panel_compute_brightness() from pwm_setup_backlight() 2020-03-04 16:52:21 +01:00
intel_panel.h
intel_pipe_crc.c drm/i915/crc: move pipe_crc from drm_i915_private to intel_crtc 2020-03-02 12:58:26 +02:00
intel_pipe_crc.h drm/i915/crc: move pipe_crc from drm_i915_private to intel_crtc 2020-03-02 12:58:26 +02:00
intel_psr.c drm/dp: Introduce EDID-based quirks 2020-03-03 20:34:31 -05:00
intel_psr.h drm/i915/psr: Force PSR probe only after full initialization 2020-03-02 10:46:25 +02:00
intel_quirks.c drm/i915: Add invert-brightness quirk for Thundersoft TST178 tablet 2020-03-04 16:54:36 +01:00
intel_quirks.h
intel_sdvo_regs.h
intel_sdvo.c drm/i915: significantly reduce the use of <drm/i915_drm.h> 2020-02-27 08:35:09 +02:00
intel_sdvo.h drm/i915: significantly reduce the use of <drm/i915_drm.h> 2020-02-27 08:35:09 +02:00
intel_sprite.c drm/i915/vgpu: improve vgpu abstractions 2020-03-03 17:46:54 +02:00
intel_sprite.h
intel_tc.c drm/i915/tc: automatic conversion to drm_device based logging macros. 2020-02-04 11:13:31 +02:00
intel_tc.h
intel_tv.c drm: Nuke mode->vrefresh 2020-05-27 14:31:42 +03:00
intel_tv.h
intel_vbt_defs.h drm/i915/vbt: Rename BDB_LVDS_POWER to BDB_LFP_POWER 2020-01-14 12:38:59 -08:00
intel_vdsc.c drm/i915: significantly reduce the use of <drm/i915_drm.h> 2020-02-27 08:35:09 +02:00
intel_vdsc.h
intel_vga.c drm/i915/vga: conversion to drm_device based logging macros. 2020-02-04 11:13:20 +02:00
intel_vga.h
vlv_dsi_pll.c drm/i915/vlv_dsi_pll: conversion to struct drm_device logging macros. 2020-02-04 11:13:15 +02:00
vlv_dsi.c drm/i915/dsi: Remove readback of panel orientation on BYT / CHT 2020-03-02 14:01:42 +01:00