From: sashiko-bot@kernel.org
To: "Maxime Ripard" <mripard@kernel.org>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH RESEND 81/83] drm/vmwgfx: Switch to drm_mode_config_create_initial_state
Date: Thu, 05 Nov 2026 22:27:18 +0000 [thread overview]
Message-ID: <sashiko-outbox-200305@kernel.org> (raw)
In-Reply-To: <20261105-drm-no-more-config-reset-v1-81-1f58d1e33380@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] drm/vmwgfx: state creation error in display init triggers broken fallback
--
commit 4961d66508852dc07ab5238728474ad461cb6c65
Author: Maxime Ripard <mripard@kernel.org>
drm/vmwgfx: Switch to drm_mode_config_create_initial_state
This commit replaces calls to drm_mode_config_reset() with
drm_mode_config_create_initial_state() during KMS display unit
initialization in vmwgfx_ldu.c, vmwgfx_scrn.c, and vmwgfx_stdu.c.
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c
> index 39d58fc392bf4..82fe7db266335 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c
> @@ -939,9 +939,7 @@ int vmw_kms_sou_init_display(struct vmw_private *dev_priv)
>
> dev_priv->active_display_unit = vmw_du_screen_object;
>
> - drm_mode_config_reset(dev);
> -
> - return 0;
> + return drm_mode_config_create_initial_state(dev);
> }
>
> static int do_bo_define_gmrfb(struct vmw_private *dev_priv,
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
> index b505f8ba3e834..80defd7358135 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
> @@ -1708,7 +1708,5 @@ int vmw_kms_stdu_init_display(struct vmw_private *dev_priv)
> }
> }
>
> - drm_mode_config_reset(dev);
> -
> - return 0;
> + return drm_mode_config_create_initial_state(dev);
> }
[Severity: Medium]
What happens in vmw_kms_init() if drm_mode_config_create_initial_state()
fails at the end of vmw_kms_stdu_init_display() or
vmw_kms_sou_init_display()?
Previously, drm_mode_config_reset() returned void, so neither function
returned an error after registering all VMWGFX_NUM_DISPLAY_UNITS (8)
display units on dev->mode_config (and vmw_kms_sou_init_display() only ever
returned -ENOSYS before initializing any display units).
In drivers/gpu/drm/vmwgfx/vmwgfx_kms.c, vmw_kms_init() treats any non-zero
return value as a fallback trigger:
ret = vmw_kms_stdu_init_display(dev_priv);
if (ret) {
ret = vmw_kms_sou_init_display(dev_priv);
if (ret) /* Fallback */
ret = vmw_kms_ldu_init_display(dev_priv);
}
If drm_mode_config_create_initial_state() fails after the display units are
initialized, those 8 CRTCs, planes, encoders, and connectors remain on
dev->mode_config while vmw_kms_init() proceeds to initialize the next
display backend on the same drm_device.
When the fallback backend registers another set of CRTCs,
dev->mode_config.num_crtc grows past VMWGFX_NUM_DISPLAY_UNITS (8). If
dev_priv->vkms_enabled is set, vmw_vkms_init() only allocated dev->vblank
for VMWGFX_NUM_DISPLAY_UNITS CRTCs via drm_vblank_init(), so the subsequent
drm_mode_config_create_initial_state() -> drm_mode_config_crtc_create_state()
-> drm_crtc_vblank_reset() call will index dev->vblank out of bounds. Even
when vkms is disabled, if the fallback succeeds, dev->mode_config is left
with duplicate mixed-backend KMS objects and more than
VMWGFX_NUM_DISPLAY_UNITS CRTCs (which can also overflow fixed-size stack
arrays such as units[VMWGFX_NUM_DISPLAY_UNITS] in vmw_kms_helper_dirty()).
Could drm_mode_config_create_initial_state(dev) be called once in
vmw_kms_init() after the display unit fallback chain succeeds instead of
inside each backend initializer?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261105-drm-no-more-config-reset-v1-0-1f58d1e33380@kernel.org?part=81
next prev parent reply other threads:[~2026-11-05 22:27 UTC|newest]
Thread overview: 128+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 15:29 [PATCH RESEND 00/83] drm: Switch drivers to drm_mode_config_create_initial_state Maxime Ripard
2026-11-05 15:29 ` Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 01/83] drm/adp: Switch " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 02/83] drm/amdgpu: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 03/83] drm/appletbdrm: " Maxime Ripard
2026-11-05 17:41 ` Aditya Garg
2026-11-05 15:29 ` [PATCH RESEND 04/83] drm/komeda: " Maxime Ripard
2026-11-05 15:46 ` Liviu Dudau
2026-11-05 15:29 ` [PATCH RESEND 05/83] drm/hdlcd: " Maxime Ripard
2026-11-05 15:46 ` Liviu Dudau
2026-11-05 16:30 ` sashiko-bot
2026-11-05 15:29 ` [PATCH RESEND 06/83] drm/malidp: " Maxime Ripard
2026-11-05 15:46 ` Liviu Dudau
2026-11-05 15:29 ` [PATCH RESEND 07/83] drm/armada: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 08/83] drm/aspeed: " Maxime Ripard
2026-11-06 5:08 ` Andrew Jeffery
2026-11-05 15:29 ` [PATCH RESEND 09/83] drm/ast: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 10/83] drm/atmel-hlcdc: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 11/83] drm/exynos: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 12/83] drm/fsl-dcu: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 13/83] drm/gud: " Maxime Ripard
2026-11-06 1:13 ` Ruben Wauters
2026-11-05 15:29 ` [PATCH RESEND 14/83] drm/hisilicon/hibmc: " Maxime Ripard
2026-11-05 17:25 ` sashiko-bot
2026-11-05 15:29 ` [PATCH RESEND 15/83] drm/hisilicon/kirin: " Maxime Ripard
2026-11-05 19:35 ` John Stultz
2026-11-05 15:29 ` [PATCH RESEND 16/83] drm/hyperv: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 17/83] drm/imx/dc: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 18/83] drm/imx/dcss: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 19/83] drm/imx/ipuv3: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 20/83] drm/ingenic: " Maxime Ripard
2026-11-05 15:56 ` Paul Cercueil
2026-11-05 18:12 ` sashiko-bot
2026-11-05 15:29 ` [PATCH RESEND 21/83] drm/kmb: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 22/83] drm/logicvc: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 23/83] drm/loongson: " Maxime Ripard
2026-11-05 18:28 ` sashiko-bot
2026-11-05 15:29 ` [PATCH RESEND 24/83] drm/mcde: " Maxime Ripard
2026-11-06 13:15 ` Linus Walleij
2026-11-05 15:29 ` [PATCH RESEND 25/83] drm/mediatek: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 26/83] drm/meson: " Maxime Ripard
2026-11-05 15:29 ` Maxime Ripard
2026-11-05 15:52 ` neil.armstrong
2026-11-05 15:52 ` neil.armstrong
2026-11-05 15:29 ` [PATCH RESEND 27/83] drm/mgag200: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 28/83] drm/msm: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 29/83] drm/lcdif: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 30/83] drm/mxsfb: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 31/83] drm/nouveau: " Maxime Ripard
2026-11-05 15:29 ` Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 32/83] drm/omap: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 33/83] drm/pl111: " Maxime Ripard
2026-11-06 13:15 ` Linus Walleij
2026-11-05 15:29 ` [PATCH RESEND 34/83] drm/qxl: " Maxime Ripard
2026-11-05 19:32 ` sashiko-bot
2026-11-05 15:29 ` [PATCH RESEND 35/83] drm/rcar-du: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 36/83] drm/rz-du: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 37/83] drm/shmobile: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 38/83] drm/rockchip: " Maxime Ripard
2026-11-05 15:29 ` Maxime Ripard
2026-11-05 19:05 ` Heiko Stübner
2026-11-05 19:05 ` Heiko Stübner
2026-11-05 15:29 ` [PATCH RESEND 39/83] drm/st7571: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 40/83] drm/st7586: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 41/83] drm/st7735r: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 42/83] drm/st7920: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 43/83] drm/ssd130x: " Maxime Ripard
2026-11-05 15:53 ` Javier Martinez Canillas
2026-11-05 15:29 ` [PATCH RESEND 44/83] drm/sprd: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 45/83] drm/sti: " Maxime Ripard
2026-11-05 20:07 ` sashiko-bot
2026-11-05 15:29 ` [PATCH RESEND 46/83] drm/stm: " Maxime Ripard
2026-11-05 20:15 ` sashiko-bot
2026-11-05 15:29 ` [PATCH RESEND 47/83] drm/sun4i: " Maxime Ripard
2026-11-05 15:37 ` Chen-Yu Tsai
2026-11-05 20:24 ` sashiko-bot
2026-11-05 15:29 ` [PATCH RESEND 48/83] drm/corebootdrm: " Maxime Ripard
2026-11-05 15:54 ` Javier Martinez Canillas
2026-11-05 15:29 ` [PATCH RESEND 49/83] drm/efidrm: " Maxime Ripard
2026-11-05 15:55 ` Javier Martinez Canillas
2026-11-05 15:29 ` [PATCH RESEND 50/83] drm/ofdrm: " Maxime Ripard
2026-11-05 15:56 ` Javier Martinez Canillas
2026-11-05 15:30 ` [PATCH RESEND 51/83] drm/simpledrm: " Maxime Ripard
2026-11-05 15:56 ` Javier Martinez Canillas
2026-11-05 15:30 ` [PATCH RESEND 52/83] drm/vesadrm: " Maxime Ripard
2026-11-05 15:57 ` Javier Martinez Canillas
2026-11-05 15:30 ` [PATCH RESEND 53/83] drm/tegra: " Maxime Ripard
2026-11-05 15:51 ` Thierry Reding
2026-11-05 15:30 ` [PATCH RESEND 54/83] drm/tests: drm_atomic_state_test: " Maxime Ripard
2026-11-05 20:46 ` sashiko-bot
2026-11-05 15:30 ` [PATCH RESEND 55/83] drm/tests: drm_atomic_test: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 56/83] drm/tests: drm_bridge_test: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 57/83] drm/tests: drm_hdmi_state_helper_test: " Maxime Ripard
2026-11-05 21:01 ` sashiko-bot
2026-11-05 15:30 ` [PATCH RESEND 58/83] drm/tidss: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 59/83] drm/tilcdc: " Maxime Ripard
2026-11-05 21:19 ` sashiko-bot
2026-11-05 15:30 ` [PATCH RESEND 60/83] drm/arcpgu: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 61/83] drm/bochs: " Maxime Ripard
2026-11-05 21:25 ` sashiko-bot
2026-11-05 15:30 ` [PATCH RESEND 62/83] drm/cirrus-qemu: " Maxime Ripard
2026-11-05 21:26 ` sashiko-bot
2026-11-05 15:30 ` [PATCH RESEND 63/83] drm/gm12u320: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 64/83] drm/hx8357d: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 65/83] drm/ili9163: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 66/83] drm/ili9225: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 67/83] drm/ili9341: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 68/83] drm/ili9486: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 69/83] drm/mi0283qt: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 70/83] drm/panel-mipi-dbi: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 71/83] drm/pixpaper: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 72/83] drm/repaper: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 73/83] drm/sharp-memory: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 74/83] drm/tve200: " Maxime Ripard
2026-11-06 13:16 ` Linus Walleij
2026-11-05 15:30 ` [PATCH RESEND 75/83] drm/udl: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 76/83] drm/vboxvideo: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 77/83] drm/vc4: " Maxime Ripard
2026-11-05 16:06 ` Dave Stevenson
2026-11-05 15:30 ` [PATCH RESEND 78/83] drm/verisilicon: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 79/83] drm/virtio: " Maxime Ripard
2026-11-05 22:14 ` sashiko-bot
2026-11-05 15:30 ` [PATCH RESEND 80/83] drm/vkms: " Maxime Ripard
2026-11-06 9:54 ` Oarora Etimis
2026-11-05 15:30 ` [PATCH RESEND 81/83] drm/vmwgfx: " Maxime Ripard
2026-11-05 22:27 ` sashiko-bot [this message]
2026-11-05 15:30 ` [PATCH RESEND 82/83] drm/xen: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 83/83] drm/xlnx: " Maxime Ripard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-200305@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=mripard@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.