mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2025-12-10 00:17:18 +00:00
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
|
||
|---|---|---|
| .. | ||
| dvo_ch7xxx.c | ||
| dvo_ch7017.c | ||
| dvo_ivch.c | ||
| dvo_ns2501.c | ||
| dvo_sil164.c | ||
| dvo_tfp410.c | ||
| icl_dsi.c | ||
| intel_acpi.c | ||
| intel_acpi.h | ||
| intel_atomic_plane.c | ||
| intel_atomic_plane.h | ||
| intel_atomic.c | ||
| intel_atomic.h | ||
| intel_audio.c | ||
| intel_audio.h | ||
| intel_bios.c | ||
| intel_bios.h | ||
| intel_bw.c | ||
| intel_bw.h | ||
| intel_cdclk.c | ||
| intel_cdclk.h | ||
| intel_color.c | ||
| intel_color.h | ||
| intel_combo_phy.c | ||
| intel_combo_phy.h | ||
| intel_connector.c | ||
| intel_connector.h | ||
| intel_crt.c | ||
| intel_crt.h | ||
| intel_csr.c | ||
| intel_csr.h | ||
| intel_ddi.c | ||
| intel_ddi.h | ||
| intel_de.h | ||
| intel_display_debugfs.c | ||
| intel_display_debugfs.h | ||
| intel_display_power.c | ||
| intel_display_power.h | ||
| intel_display_types.h | ||
| intel_display.c | ||
| intel_display.h | ||
| intel_dp_aux_backlight.c | ||
| intel_dp_aux_backlight.h | ||
| intel_dp_link_training.c | ||
| intel_dp_link_training.h | ||
| intel_dp_mst.c | ||
| intel_dp_mst.h | ||
| intel_dp.c | ||
| intel_dp.h | ||
| intel_dpio_phy.c | ||
| intel_dpio_phy.h | ||
| intel_dpll_mgr.c | ||
| intel_dpll_mgr.h | ||
| intel_dsb.c | ||
| intel_dsb.h | ||
| intel_dsi_dcs_backlight.c | ||
| intel_dsi_dcs_backlight.h | ||
| intel_dsi_vbt.c | ||
| intel_dsi.c | ||
| intel_dsi.h | ||
| intel_dvo_dev.h | ||
| intel_dvo.c | ||
| intel_dvo.h | ||
| intel_fbc.c | ||
| intel_fbc.h | ||
| intel_fbdev.c | ||
| intel_fbdev.h | ||
| intel_fifo_underrun.c | ||
| intel_fifo_underrun.h | ||
| intel_frontbuffer.c | ||
| intel_frontbuffer.h | ||
| intel_global_state.c | ||
| intel_global_state.h | ||
| intel_gmbus.c | ||
| intel_gmbus.h | ||
| intel_hdcp.c | ||
| intel_hdcp.h | ||
| intel_hdmi.c | ||
| intel_hdmi.h | ||
| intel_hotplug.c | ||
| intel_hotplug.h | ||
| intel_lpe_audio.c | ||
| intel_lpe_audio.h | ||
| intel_lspcon.c | ||
| intel_lspcon.h | ||
| intel_lvds.c | ||
| intel_lvds.h | ||
| intel_opregion.c | ||
| intel_opregion.h | ||
| intel_overlay.c | ||
| intel_overlay.h | ||
| intel_panel.c | ||
| intel_panel.h | ||
| intel_pipe_crc.c | ||
| intel_pipe_crc.h | ||
| intel_psr.c | ||
| intel_psr.h | ||
| intel_quirks.c | ||
| intel_quirks.h | ||
| intel_sdvo_regs.h | ||
| intel_sdvo.c | ||
| intel_sdvo.h | ||
| intel_sprite.c | ||
| intel_sprite.h | ||
| intel_tc.c | ||
| intel_tc.h | ||
| intel_tv.c | ||
| intel_tv.h | ||
| intel_vbt_defs.h | ||
| intel_vdsc.c | ||
| intel_vdsc.h | ||
| intel_vga.c | ||
| intel_vga.h | ||
| vlv_dsi_pll.c | ||
| vlv_dsi.c | ||