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
..
2020-04-10 15:36:22 -07:00
2020-03-02 12:57:03 -07:00
2020-04-12 10:13:14 -07:00
2020-02-19 02:42:21 -07:00
2020-03-31 10:05:01 -07:00
2020-03-12 07:47:22 -06:00
2020-03-30 01:35:12 +02:00
2019-07-15 11:03:03 -03:00
2020-04-02 09:35:29 -07:00
2020-03-06 00:01:02 +01:00
2019-12-20 14:58:35 +08:00
2020-04-01 16:11:40 -07:00
2020-05-18 19:58:04 +02:00
2020-02-05 10:30:03 -07:00
2020-04-21 14:37:51 +02:00
2019-07-15 11:03:03 -03:00
2020-01-03 14:27:40 +01:00
2020-02-19 02:41:01 -07:00
2020-04-10 17:53:43 -07:00
2020-04-08 14:27:48 +02:00
2019-10-16 19:18:26 -07:00
2020-05-27 14:31:42 +03:00
2019-07-15 11:03:02 -03:00
2020-03-22 16:42:54 -07:00
2020-03-10 12:19:52 +01:00
2019-07-15 11:03:03 -03:00
2019-07-15 11:03:03 -03:00
2019-07-15 11:03:02 -03:00
2019-09-13 16:55:55 -03:00
2019-08-06 11:24:49 -06:00
2019-12-11 09:12:38 +01:00
2020-04-09 03:18:21 +09:00
2020-03-20 17:16:24 -06:00
2019-07-25 20:07:52 +02:00
2019-11-01 13:08:24 +01:00
2020-03-28 12:47:34 +01:00
2019-07-31 13:30:10 -06:00
2020-01-24 09:48:39 -07:00
2020-03-30 13:42:05 -07:00
2020-03-19 07:41:04 +01:00
2020-03-24 15:53:48 +01:00
2020-04-01 14:47:40 -07:00
2019-07-15 11:03:03 -03:00
2020-03-31 17:29:33 -07:00
2019-07-31 13:31:51 -06:00
2020-01-24 09:54:42 -07:00
2020-01-31 22:10:58 +09:00
2019-07-31 13:30:15 -06:00
2020-04-03 14:25:02 -07:00
2019-07-15 11:03:03 -03:00
2020-03-30 14:46:58 +02:00
2020-04-05 11:12:59 -07:00
2020-04-09 00:02:00 +09:00
2020-02-27 07:03:14 -08:00
2020-01-29 15:27:31 -08:00
2019-08-21 12:41:43 +02:00
2019-10-29 04:35:41 -06:00
2020-04-02 17:03:53 -07:00
2020-03-20 17:01:29 -06:00
2019-07-17 06:57:52 -03:00
2020-03-31 10:54:06 +02:00
2019-07-15 11:03:01 -03:00
2020-02-25 03:11:04 -07:00
2019-10-02 10:03:06 -06:00
2019-07-31 14:13:13 -06:00
2020-03-20 17:01:29 -06:00
2019-07-15 11:03:03 -03:00
2020-04-05 10:36:18 -07:00
2020-03-30 13:42:05 -07:00
2020-03-15 11:34:48 +02:00
2020-02-13 11:42:02 -07:00
2020-04-02 15:13:15 -07:00
2020-04-07 10:43:41 -07:00
2019-12-30 11:58:02 -07:00
2019-09-27 11:17:38 -07:00
2020-03-31 11:04:05 -07:00
2019-07-15 11:03:01 -03:00
2020-03-25 11:50:48 +01:00
2020-01-16 12:53:16 -07:00
2019-07-08 16:12:03 -07:00
2020-03-20 17:01:34 -06:00
2019-07-15 09:20:27 -03:00
2019-07-15 09:20:24 -03:00
2019-09-04 11:13:19 +02:00
2019-11-14 12:01:54 -04:00
2019-11-11 20:10:01 +09:00
2019-06-29 21:08:14 -07:00
2020-04-03 13:22:40 -07:00
2020-02-25 03:39:10 -07:00
2020-03-31 16:03:39 -07:00
2020-02-27 07:03:14 -08:00
2019-07-15 08:53:27 -03:00
2019-07-15 09:20:24 -03:00
2020-03-25 22:29:40 -07:00
2020-03-21 17:48:13 +01:00
2020-01-04 13:49:51 +08:00