OpenCloudOS-Kernel/drivers/gpu/drm/vmwgfx
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
..
device_include drm/vmwgfx: Sync virtual device headers for new feature 2020-03-23 22:39:34 +01:00
Kconfig drm/vmwgfx: Implement an infrastructure for write-coherent resources 2019-11-06 13:04:54 +01:00
Makefile Merge branch 'ttm-transhuge' of git://people.freedesktop.org/~thomash/linux into drm-next 2020-04-03 09:07:49 +10:00
ttm_lock.c drm/vmwgfx: Kill unneeded legacy security features 2019-08-15 08:39:27 +02:00
ttm_lock.h drm/vmwgfx: drop use of drmP.h in header files 2019-08-15 08:40:04 +02:00
ttm_object.c drm/vmwgfx: Fix user space handle equal to zero 2019-05-21 10:23:09 +02:00
ttm_object.h drm/vmwgfx: drop use of drmP.h in header files 2019-08-15 08:40:04 +02:00
vmwgfx_binding.c drm/vmwgfx: Add support for streamoutput with mob commands 2020-03-23 22:39:35 +01:00
vmwgfx_binding.h drm/vmwgfx: Add support for streamoutput with mob commands 2020-03-23 22:39:35 +01:00
vmwgfx_blit.c dma-buf: rename reservation_object to dma_resv 2019-08-13 09:09:30 +02:00
vmwgfx_bo.c drm/vmwgfx: Use an RBtree instead of linked list for MOB resources 2019-11-06 13:30:27 +01:00
vmwgfx_cmdbuf.c drm/vmwgfx: Fix the refuse_dma mode when using guest-backed objects 2020-03-12 12:00:07 +01:00
vmwgfx_cmdbuf_res.c drm/vmwgfx: prevent memory leak in vmw_cmdbuf_res_add 2020-01-15 11:46:59 +01:00
vmwgfx_context.c drm/vmwgfx: Add support for UA view commands 2020-03-23 22:39:34 +01:00
vmwgfx_cotable.c drm/vmwgfx: Add support for streamoutput with mob commands 2020-03-23 22:39:35 +01:00
vmwgfx_drv.c Merge branch 'ttm-transhuge' of git://people.freedesktop.org/~thomash/linux into drm-next 2020-04-03 09:07:49 +10:00
vmwgfx_drv.h Merge branch 'ttm-transhuge' of git://people.freedesktop.org/~thomash/linux into drm-next 2020-04-03 09:07:49 +10:00
vmwgfx_execbuf.c drm/vmwgfx: Add support for streamoutput with mob commands 2020-03-23 22:39:35 +01:00
vmwgfx_fb.c drm: constify fb ops across all drivers 2019-12-05 10:57:42 +02:00
vmwgfx_fence.c drm-misc-next for 5.4: 2019-08-21 16:44:41 +10:00
vmwgfx_fence.h drm/vmwgfx: drop use of drmP.h in header files 2019-08-15 08:40:04 +02:00
vmwgfx_fifo.c drm/vmwgfx: Drop preempt_disable() in vmw_fifo_ping_host() 2020-03-12 15:29:38 +01:00
vmwgfx_gmr.c drm/vmwgfx: drop reminaing users of drmP.h 2019-08-15 08:40:04 +02:00
vmwgfx_gmrid_manager.c drm/vmwgfx: Return 0 when gmrid::get_node runs out of ID's 2019-03-20 07:53:29 +01:00
vmwgfx_ioctl.c drm/vmwgfx: Add SM5 param for userspace 2020-03-23 22:48:57 +01:00
vmwgfx_irq.c drm/vmwgfx: drop reminaing users of drmP.h 2019-08-15 08:40:04 +02:00
vmwgfx_kms.c drm: Nuke mode->vrefresh 2020-05-27 14:31:42 +03:00
vmwgfx_kms.h drm/vmwgfx: drop use of drmP.h in header files 2019-08-15 08:40:04 +02:00
vmwgfx_ldu.c drm/vmwgfx: Convert to CRTC VBLANK callbacks 2020-02-13 13:10:10 +01:00
vmwgfx_marker.c drm/vmwgfx: add SPDX idenitifier and clarify license 2018-06-29 15:28:48 -05:00
vmwgfx_mob.c drm/vmwgfx: Use enum to represent graphics context capabilities 2020-03-23 22:39:34 +01:00
vmwgfx_msg.c drm/vmwgfx: add ioctl for messaging from/to guest userspace to/from host 2020-01-15 11:54:16 +01:00
vmwgfx_msg.h drm/vmwgfx: Update the backdoor call with support for new instructions 2019-08-28 13:36:46 +02:00
vmwgfx_overlay.c drm/vmwgfx: Remove a few unused functions 2020-03-12 15:31:12 +01:00
vmwgfx_page_dirty.c drm/vmwgfx: Support huge page faults 2020-03-24 18:48:55 +01:00
vmwgfx_prime.c drm/vmwgfx: Delete mmaping functions 2019-11-25 22:36:14 +01:00
vmwgfx_reg.h drm/vmwgfx: add SPDX idenitifier and clarify license 2018-06-29 15:28:48 -05:00
vmwgfx_resource.c drm/vmwgfx: Implement an infrastructure for read-coherent resources 2019-11-06 13:30:27 +01:00
vmwgfx_resource_priv.h drm/vmwgfx: Implement an infrastructure for read-coherent resources 2019-11-06 13:30:27 +01:00
vmwgfx_scrn.c drm/vmwgfx: Convert to CRTC VBLANK callbacks 2020-02-13 13:10:10 +01:00
vmwgfx_shader.c drm/vmwgfx: Assign eviction priorities to resources 2019-08-15 08:40:05 +02:00
vmwgfx_simple_resource.c drm/vmwgfx: Add a new define for vmwgfx user-space debugging 2019-04-08 10:29:04 -07:00
vmwgfx_so.c drm/vmwgfx: Add support for UA view commands 2020-03-23 22:39:34 +01:00
vmwgfx_so.h drm/vmwgfx: Add support for streamoutput with mob commands 2020-03-23 22:39:35 +01:00
vmwgfx_stdu.c drm/vmwgfx: Refactor surface_define to use vmw_surface_metadata 2020-03-23 22:48:56 +01:00
vmwgfx_streamoutput.c drm/vmwgfx: Add support for streamoutput with mob commands 2020-03-23 22:39:35 +01:00
vmwgfx_surface.c drm/vmwgfx: Add surface define v4 command 2020-03-23 22:48:57 +01:00
vmwgfx_thp.c drm/vmwgfx: Introduce a huge page aligning TTM range manager 2020-03-24 18:50:12 +01:00
vmwgfx_ttm_buffer.c drm/vmwgfx: Hook up the helpers to align buffer objects 2020-03-24 18:50:35 +01:00
vmwgfx_ttm_glue.c drm/vmwgfx: Support huge page faults 2020-03-24 18:48:55 +01:00
vmwgfx_va.c drm/vmwgfx: add SPDX idenitifier and clarify license 2018-06-29 15:28:48 -05:00
vmwgfx_validation.c drm/vmwgfx: Implement an infrastructure for read-coherent resources 2019-11-06 13:30:27 +01:00
vmwgfx_validation.h drm/vmwgfx: Implement an infrastructure for write-coherent resources 2019-11-06 13:04:54 +01:00