All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Lyude Paul" <lyude@redhat.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 4/4] drm/nouveau/kms/nv50-: Enable atomic modesetting by default
Date: Thu, 30 Jul 2026 01:21:25 +0000	[thread overview]
Message-ID: <20260730012126.0653C1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260730010828.1056397-5-lyude@redhat.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

Pre-existing issues:
- [High] Dynamic mutation of the shared global `driver_pci` struct during device probe causes a data race, ignores the passed `drm_driver` parameter, and fails to enable atomic modesetting on non-PCI (e.g., Tegra platform) devices.
- [High] Comparing the `chipset` field to the `NV_DEVICE_INFO_V0_TESLA` family enum incorrectly enables atomic modesetting on unsupported pre-nv50 hardware.
--

--- Patch [4]: [PATCH 4/4] drm/nouveau/kms/nv50-: Enable atomic modesetting by default ---
commit 2db79d2947cdc47fc30e7b1b87de35e2d70fb39d
Author: Lyude Paul <lyude@redhat.com>

drm/nouveau/kms/nv50-: Enable atomic modesetting by default

Nouveau is one of the very few modern hardware drivers in the kernel that
doesn't have atomic modesetting enabled by default, in part because when it
was originally written by Ben there wasn't much in the way of good atomic
modesetting clients to actually test things out with.

[ ... ]

> diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
> index b959d79f7e1c7..5580ac9c782ba 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_drm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
[ ... ]
> @@ -770,10 +771,10 @@ nouveau_drm_device_new(struct drm_driver *drm_driver, struct device *parent,
>  		goto done;
>  	}
>  
> -	if (nouveau_atomic) {
> +	if (nouveau_atomic != 0) {
>  		if (drm->device.info.chipset >= NV_DEVICE_INFO_V0_TESLA)

[Severity: High]
This isn't a bug introduced by this patch, but changing the default of
nouveau_atomic to auto makes it active by default. In nouveau_drm_device_new()
in drivers/gpu/drm/nouveau/nouveau_drm.c, does this compare a chipset hex
identifier (e.g., 0x40 for NV40) against a family enum (0x06 for TESLA)?

Because 0x40 is greater than 0x06, this evaluates to true for unsupported older
hardware, forcing atomic modesetting on pre-nv50 hardware and breaking display
support. Should this check use device.info.family instead of chipset?

>  			driver_pci.driver_features |= DRIVER_ATOMIC;

[Severity: High]
This is a pre-existing issue, but with nouveau_atomic active by default,
does dynamically mutating the shared global driver_pci struct during device
probe in nouveau_drm_device_new() cause a data race?

Modifying driver_pci pollutes the template for all subsequent PCI devices,
even if they do not meet the chipset requirements. Additionally, does this
ignore the passed drm_driver parameter, preventing atomic modesetting from
being enabled on Tegra platform devices (which use driver_platform)?

> -		else
> +		else if (nouveau_atomic == 1)
>  			NV_WARN(drm, "Atomic modesetting not supported (needs nv50+)\n");
>  	}
>

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260730010828.1056397-1-lyude@redhat.com?part=4

      reply	other threads:[~2026-07-30  1:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30  0:56 [PATCH 0/4] drm/nouveau: Enable atomic modesetting by default Lyude Paul
2026-07-30  0:56 ` Lyude Paul
2026-07-30  0:56 ` [PATCH 1/4] drm/nouveau: Print the nouveau.atomic parameter in nouveau_display_options() Lyude Paul
2026-07-30  0:56   ` Lyude Paul
2026-07-30  0:56 ` [PATCH 2/4] drm/nouveau/kms: Check nouveau.atomic parameter after nvif_device_ctor() Lyude Paul
2026-07-30  0:56   ` Lyude Paul
2026-07-30  1:18   ` sashiko-bot
2026-07-30  0:56 ` [PATCH 3/4] drm/nouveau/kms: Only allow enabling atomic modesetting on nv50+ Lyude Paul
2026-07-30  0:56   ` Lyude Paul
2026-07-30  1:24   ` sashiko-bot
2026-07-30  0:56 ` [PATCH 4/4] drm/nouveau/kms/nv50-: Enable atomic modesetting by default Lyude Paul
2026-07-30  0:56   ` Lyude Paul
2026-07-30  1:21   ` sashiko-bot [this message]

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=20260730012126.0653C1F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lyude@redhat.com \
    --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.