From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2ADC606A322 for ; Sat, 5 Dec 2026 14:31:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=IPgo9yS5 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E282410E02A; Sat, 5 Dec 2026 14:31:29 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id F287C10E02A for ; Sat, 5 Dec 2026 14:31:22 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id F235660AA6; Sat, 5 Dec 2026 14:31:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 996671F0092B; Sat, 5 Dec 2026 14:31:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796481081; bh=etvcsKmsZTnj3f/qhRnzDQw1AeAgOk4cbrzQXVQBZhM=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=IPgo9yS5kPgWSQwyCpI21WVFuRK66X/SguePAXZGRr4xonmwg4N+gNeI+t2i13jkC X6n156bE4x1Sqfxc1V4ZzbRUR3LBBZvW4QdA3jg2TsUrtIzcsdiXdOb+W9MHPPdTrN IFJhD7Q7flrmYgC2hRrIBZrj4R2XV3hrpEGkc1jtAsTlCc0SQmyrQp8g11O19agcys wE3zCCC/SkbhDAvUuKBUBjWED8DWWuUjhDYlz8EGmsLYZwFr2G4XS+TrLZvNnvQWdS 5sPqKgQqA7U5oOtXcxmOxFW1rw6q7KFOfRSHpjQtLNkbnxH67vkkzqaR8kJWI0/Kum PVHGVxP0GVtNA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] drm/fb-helper: Keep blanked outputs off across restore and hotplug To: "Anush Veeranala" Cc: dri-devel@lists.freedesktop.org In-Reply-To: <875wx7rfwp.fsf@gnu.org> References: <875wx7rfwp.fsf@gnu.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 14:31:21 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" X-Spam-Status: No, score=-11.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] drm/fb-helper: drm_fb_helper_dpms() latches dpms_mode despite -EBUSY failure - [Medium] drm/fb-helper: forced restore leaves dpms_mode stale across delayed hotplug -- commit 5438bb76521b1ee953b8205afd87e275ec4f45c5 Author: Anush Veeranala drm/fb-helper: Keep blanked outputs off across restore and hotplug This commit caches the last DPMS blank mode in struct drm_fb_helper and uses drm_client_modeset_dpms() on unforced atomic restores so blanked outputs st= ay off across drm_lastclose() and hotplug events. > diff --git a/drivers/gpu/drm/clients/drm_fbdev_helper.c b/drivers/gpu/drm= /clients/drm_fbdev_helper.c > index 415764ee086a8..592b1f23cee63 100644 > --- a/drivers/gpu/drm/clients/drm_fbdev_helper.c > +++ b/drivers/gpu/drm/clients/drm_fbdev_helper.c > @@ -105,6 +105,17 @@ __drm_fb_helper_restore_fbdev_mode_unlocked(struct d= rm_fb_helper *fb_helper, > * racing here, see drm_fb_helper_set_par(). > */ > ret =3D drm_client_modeset_commit_locked(&fb_helper->client); > + } else if (fb_helper->dpms_mode !=3D DRM_MODE_DPMS_ON && > + drm_drv_uses_atomic_modeset(fb_helper->dev)) { > + /* > + * Keep blanked outputs off. Forced restores still light them: > + * fbcon forces one when switching back to text mode and then > + * unblanks, and sysrq forces one to show the console. Legacy > + * DPMS doesn't commit the configuration, so legacy drivers > + * keep committing it with the outputs on. > + */ > + ret =3D drm_client_modeset_dpms(&fb_helper->client, > + fb_helper->dpms_mode); > } else { > ret =3D drm_client_modeset_commit(&fb_helper->client); > } [Severity: Medium] Should the forced restore branch reset fb_helper->dpms_mode to DRM_MODE_DPMS_ON on success? If the console is blanked and fb_helper->delayed_hotplug was set while a DRM master was active, a SysRq-v forced restore lights the outputs via drm_client_modeset_commit_locked() and then immediately runs drm_fb_helper_hotplug_event() -> drm_fb_helper_set_par(). That calls __drm_fb_helper_restore_fbdev_mode_unlocked() with force unset, so the stale fb_helper->dpms_mode commits the CRTCs back off before SysRq-v finishes, defeating the emergency restore. [ ... ] > @@ -146,6 +158,7 @@ static void drm_fb_helper_dpms(struct fb_info *info, = int dpms_mode) > struct drm_fb_helper *fb_helper =3D info->par; > =20 > mutex_lock(&fb_helper->lock); > + fb_helper->dpms_mode =3D dpms_mode; > drm_client_modeset_dpms(&fb_helper->client, dpms_mode); > mutex_unlock(&fb_helper->lock); > } [Severity: Medium] Can drm_fb_helper_dpms() latch fb_helper->dpms_mode even when drm_client_modeset_dpms() fails with -EBUSY? If userspace issues FBIOBLANK while a compositor holds DRM master in KD_GRAPHICS, drm_client_modeset_dpms() returns -EBUSY without changing the display. fbcon_fb_blanked() ignores the notification in KD_GRAPHICS, so par->blank_state stays FB_BLANK_UNBLANK while fb_helper->dpms_mode is stale. When the compositor exits to KD_TEXT, fbcon_unblank() clears console_blanked and skips fb_blank(info, FB_BLANK_UNBLANK) because par->blank_state is already unblanked. drm_lastclose() then runs an unforced restore and turns all CRTCs off on a console that keypresses cannot wake. Updating fb_helper->dpms_mode only when drm_client_modeset_dpms() returns 0 would avoid latching a failed blank request. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/875wx7rfwp.fsf@gnu.= org?part=3D1