mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2025-12-08 02:38:14 +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
|
||
|---|---|---|
| .. | ||
| display | ||
| gem | ||
| gt | ||
| gvt | ||
| oa | ||
| selftests | ||
| .gitignore | ||
| i915_active_types.h | ||
| i915_active.c | ||
| i915_active.h | ||
| i915_buddy.c | ||
| i915_buddy.h | ||
| i915_cmd_parser.c | ||
| i915_debugfs_params.c | ||
| i915_debugfs_params.h | ||
| i915_debugfs.c | ||
| i915_debugfs.h | ||
| i915_drv.c | ||
| i915_drv.h | ||
| i915_fixed.h | ||
| i915_gem_evict.c | ||
| i915_gem_fence_reg.c | ||
| i915_gem_fence_reg.h | ||
| i915_gem_gtt.c | ||
| i915_gem_gtt.h | ||
| i915_gem.c | ||
| i915_gem.h | ||
| i915_getparam.c | ||
| i915_globals.c | ||
| i915_globals.h | ||
| i915_gpu_error.c | ||
| i915_gpu_error.h | ||
| i915_ioc32.c | ||
| i915_ioc32.h | ||
| i915_irq.c | ||
| i915_irq.h | ||
| i915_memcpy.c | ||
| i915_memcpy.h | ||
| i915_mm.c | ||
| i915_params.c | ||
| i915_params.h | ||
| i915_pci.c | ||
| i915_perf_types.h | ||
| i915_perf.c | ||
| i915_perf.h | ||
| i915_pmu.c | ||
| i915_pmu.h | ||
| i915_priolist_types.h | ||
| i915_pvinfo.h | ||
| i915_query.c | ||
| i915_query.h | ||
| i915_reg.h | ||
| i915_request.c | ||
| i915_request.h | ||
| i915_scatterlist.c | ||
| i915_scatterlist.h | ||
| i915_scheduler_types.h | ||
| i915_scheduler.c | ||
| i915_scheduler.h | ||
| i915_selftest.h | ||
| i915_suspend.c | ||
| i915_suspend.h | ||
| i915_sw_fence_work.c | ||
| i915_sw_fence_work.h | ||
| i915_sw_fence.c | ||
| i915_sw_fence.h | ||
| i915_switcheroo.c | ||
| i915_switcheroo.h | ||
| i915_syncmap.c | ||
| i915_syncmap.h | ||
| i915_sysfs.c | ||
| i915_sysfs.h | ||
| i915_trace_points.c | ||
| i915_trace.h | ||
| i915_user_extensions.c | ||
| i915_user_extensions.h | ||
| i915_utils.c | ||
| i915_utils.h | ||
| i915_vgpu.c | ||
| i915_vgpu.h | ||
| i915_vma_types.h | ||
| i915_vma.c | ||
| i915_vma.h | ||
| intel_device_info.c | ||
| intel_device_info.h | ||
| intel_dram.c | ||
| intel_dram.h | ||
| intel_gvt.c | ||
| intel_gvt.h | ||
| intel_memory_region.c | ||
| intel_memory_region.h | ||
| intel_pch.c | ||
| intel_pch.h | ||
| intel_pm.c | ||
| intel_pm.h | ||
| intel_region_lmem.c | ||
| intel_region_lmem.h | ||
| intel_runtime_pm.c | ||
| intel_runtime_pm.h | ||
| intel_sideband.c | ||
| intel_sideband.h | ||
| intel_uncore.c | ||
| intel_uncore.h | ||
| intel_wakeref.c | ||
| intel_wakeref.h | ||
| intel_wopcm.c | ||
| intel_wopcm.h | ||
| Kconfig | ||
| Kconfig.debug | ||
| Kconfig.profile | ||
| Kconfig.unstable | ||
| Makefile | ||
| vlv_suspend.c | ||
| vlv_suspend.h | ||