linux_dsm_epyc7002/drivers/gpu/drm/nouveau
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
..
dispnv04 drm/nouveau: remove _unlocked suffix in drm_gem_object_put_unlocked 2020-05-19 22:31:33 +01:00
dispnv50 drm/nouveau/kms/nv50-: wait for FIFO space on PIO channels 2020-04-07 14:37:50 +10:00
include drm/nouveau/nvif: protect waits against GPU falling off the bus 2020-04-07 14:37:50 +10:00
nvif drm/nouveau/nvif: protect waits against GPU falling off the bus 2020-04-07 14:37:50 +10:00
nvkm Merge drm/drm-next into drm-misc-next 2020-04-17 08:12:22 +02:00
Kbuild
Kconfig drm/nouveau: Add HD-audio component notifier support 2020-01-29 15:49:46 +10:00
nouveau_abi16.c drm/nouveau: remove _unlocked suffix in drm_gem_object_put_unlocked 2020-05-19 22:31:33 +01:00
nouveau_abi16.h
nouveau_acpi.c
nouveau_acpi.h
nouveau_backlight.c
nouveau_bios.c
nouveau_bios.h
nouveau_bo.c drm/nouveau/ttm: evict other IO mappings when running out of BAR1 space 2020-04-07 14:37:49 +10:00
nouveau_bo.h drm/nouveau: Fix fallout from reservation object rework 2019-09-17 14:50:15 +10:00
nouveau_chan.c drm/nouveau: signal pending fences when channel has been killed 2020-01-29 15:49:47 +10:00
nouveau_chan.h
nouveau_connector.c drm: Nuke mode->vrefresh 2020-05-27 14:31:42 +03:00
nouveau_connector.h drm/nouveau: Fix drm-core using atomic code-paths on pre-nv50 hardware 2019-12-10 21:34:52 +10:00
nouveau_crtc.h
nouveau_debugfs.c drm/nouveau: remove checks for return value of debugfs functions 2020-04-07 14:37:49 +10:00
nouveau_debugfs.h drm: convert .debugfs_init() hook to return void. 2020-03-18 17:53:28 +01:00
nouveau_display.c drm/nouveau: remove _unlocked suffix in drm_gem_object_put_unlocked 2020-05-19 22:31:33 +01:00
nouveau_display.h drm/nouveau: Convert to CRTC VBLANK callbacks 2020-02-13 13:08:13 +01:00
nouveau_dma.c
nouveau_dma.h
nouveau_dmem.c mm/hmm: check the device private page owner in hmm_range_fault() 2020-03-26 14:33:38 -03:00
nouveau_dmem.h
nouveau_dp.c
nouveau_drm.c drm/nouveau: workaround runpm fail by disabling PCI power management on certain intel bridges 2020-04-07 14:37:50 +10:00
nouveau_drv.h drm/nouveau: workaround runpm fail by disabling PCI power management on certain intel bridges 2020-04-07 14:37:50 +10:00
nouveau_encoder.h
nouveau_fbcon.c drm: Remove drm_fb_helper add, add all and remove connector calls 2020-03-06 14:19:58 +01:00
nouveau_fbcon.h
nouveau_fence.c drm/nouveau: signal pending fences when channel has been killed 2020-01-29 15:49:47 +10:00
nouveau_fence.h drm/nouveau: signal pending fences when channel has been killed 2020-01-29 15:49:47 +10:00
nouveau_gem.c drm/nouveau: remove _unlocked suffix in drm_gem_object_put_unlocked 2020-05-19 22:31:33 +01:00
nouveau_gem.h
nouveau_hwmon.c drm/nouveau: use NULL for pointer assignment. 2020-01-15 10:49:59 +10:00
nouveau_hwmon.h
nouveau_ioc32.c
nouveau_ioctl.h
nouveau_led.c
nouveau_led.h
nouveau_mem.c
nouveau_mem.h
nouveau_nvif.c
nouveau_platform.c
nouveau_platform.h
nouveau_prime.c drm/nouveau/prime: Extend DMA reservation object lock 2019-09-17 14:50:15 +10:00
nouveau_reg.h
nouveau_sgdma.c
nouveau_svm.c drm fixes for 5.7-rc1 2020-04-07 20:24:34 -07:00
nouveau_svm.h
nouveau_ttm.c drm/nouveau/drm/ttm: Remove set but not used variable 'mem' 2020-01-15 10:50:25 +10:00
nouveau_ttm.h
nouveau_usif.c
nouveau_usif.h
nouveau_vga.c drm: Avoid drm_global_mutex for simple inc/dec of dev->open_count 2020-01-24 17:41:34 +00:00
nouveau_vga.h
nouveau_vmm.c drm/nouveau: zero vma pointer even if we only unreference it rather than free 2020-01-29 15:49:46 +10:00
nouveau_vmm.h
nv04_fbcon.c
nv04_fence.c
nv10_fence.c
nv10_fence.h
nv17_fence.c
nv50_display.h
nv50_fbcon.c
nv50_fence.c
nv84_fence.c
nvc0_fbcon.c
nvc0_fence.c