linux_dsm_epyc7002/drivers/gpu/drm/exynos
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
..
exynos7_drm_decon.c Linux 5.6 2020-03-31 15:15:47 +10:00
exynos5433_drm_decon.c drm/exynos: Fix cleanup of IOMMU related objects 2020-03-10 13:25:18 +09:00
exynos_dp.c Merge drm/drm-next into drm-misc-next 2020-04-17 08:12:22 +02:00
exynos_drm_crtc.c drm/exynos: change callback names 2020-01-21 09:09:42 +09:00
exynos_drm_crtc.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
exynos_drm_dma.c drm/exynos: Fix cleanup of IOMMU related objects 2020-03-10 13:25:18 +09:00
exynos_drm_dpi.c drm/exynos: Use simple encoder 2020-04-02 14:16:44 +02:00
exynos_drm_drv.c drm/exynos: Use drm_encoder_mask() 2020-03-18 12:11:41 +09:00
exynos_drm_drv.h drm/exynos: Fix cleanup of IOMMU related objects 2020-03-10 13:25:18 +09:00
exynos_drm_dsi.c drm/exynos: Use simple encoder 2020-04-02 14:16:44 +02:00
exynos_drm_fb.c drm/exynos: drop drmP.h usage 2019-06-27 19:56:09 +09:00
exynos_drm_fb.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
exynos_drm_fbdev.c drm: Remove drm_fb_helper add, add all and remove connector calls 2020-03-06 14:19:58 +01:00
exynos_drm_fbdev.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
exynos_drm_fimc.c drm/exynos: Fix cleanup of IOMMU related objects 2020-03-10 13:25:18 +09:00
exynos_drm_fimd.c drm/exynos: Fix cleanup of IOMMU related objects 2020-03-10 13:25:18 +09:00
exynos_drm_g2d.c drm/exynos: Fix cleanup of IOMMU related objects 2020-03-10 13:25:18 +09:00
exynos_drm_g2d.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 423 2019-06-05 17:37:15 +02:00
exynos_drm_gem.c drm/exynos: remove _unlocked suffix in drm_gem_object_put_unlocked 2020-05-19 22:31:32 +01:00
exynos_drm_gem.h drm/exynos: remove _unlocked suffix in drm_gem_object_put_unlocked 2020-05-19 22:31:32 +01:00
exynos_drm_gsc.c drm/exynos: Fix cleanup of IOMMU related objects 2020-03-10 13:25:18 +09:00
exynos_drm_ipp.c drm/exynos: drop use of drmP.h 2019-09-01 20:55:12 +09:00
exynos_drm_ipp.h drm/exynos: drop use of drmP.h 2019-09-01 20:55:12 +09:00
exynos_drm_mic.c drm: Stop including drm_bridge.h from drm_crtc.h 2019-08-28 22:11:03 +02:00
exynos_drm_plane.c drm/exynos: drop drmP.h usage 2019-06-27 19:56:09 +09:00
exynos_drm_plane.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
exynos_drm_rotator.c drm/exynos: Fix cleanup of IOMMU related objects 2020-03-10 13:25:18 +09:00
exynos_drm_scaler.c drm/exynos: Fix cleanup of IOMMU related objects 2020-03-10 13:25:18 +09:00
exynos_drm_vidi.c drm/exynos: Use simple encoder 2020-04-02 14:16:44 +02:00
exynos_drm_vidi.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
exynos_hdmi.c drm: Nuke mode->vrefresh 2020-05-27 14:31:42 +03:00
exynos_mixer.c drm: Nuke mode->vrefresh 2020-05-27 14:31:42 +03:00
Kconfig drm/exynos: Rename Exynos to lowercase 2020-01-21 09:09:42 +09:00
Makefile drm/exynos/iommu: merge IOMMU and DMA code 2018-12-04 13:23:17 +09:00
regs-decon7.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
regs-decon5433.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 423 2019-06-05 17:37:15 +02:00
regs-fimc.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
regs-gsc.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
regs-hdmi.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
regs-mixer.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
regs-rotator.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
regs-scaler.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
regs-vp.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00