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 DF270606A323 for ; Wed, 2 Dec 2026 12:53:20 +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=LLMkNy+b Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7B0B510E4F6; Wed, 2 Dec 2026 12:53:15 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id A03B210E56C for ; Wed, 2 Dec 2026 12:53:09 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 0E703416FC; Wed, 2 Dec 2026 12:53:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CAF741F00896; Wed, 2 Dec 2026 12:53:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796215988; bh=kIWXeRuQWIct9yu6cA3P/yydvy+n8hAGaw24hkj1gsw=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=LLMkNy+bRL4xm0lc3sXxHQqu7TEmTJM4oNpucm8eh38yRYlVNoPTsy8qaiQYns8// VL+DsWApWwgslTCTVEPwaFQmz6OVWtYU45rJolxXSvswpZeMGaHUxq4fvetLoGLwl/ zwVyWwu+N8gk+zLJM8FmKlhIK/VpW0iR6dcZSKGDNQauq+TEJn3+g7t+kXdDnm9Loa 3rZe6mEWH65QvJHaK9O65ocxi/de3FJ8jM5oXoOeCTjVnj/Mu+2l4E6sxlGH2IOsho MQ+dh9TYM3sHD7Xb0WDIj9S6Lsfo8jM6Mrl0lMMk1gRTw8mf1nqfhtKu58hqANnk4O PHccn7D4zdktg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] drm/i915/panel: anchor to highest vrefresh fixed mode without a VRR reference To: cengjianeng , intel-gfx@lists.freedesktop.org In-Reply-To: <20261202123523.1181723-1-cengjianeng@huaqin.corp-partner.google.com> References: <20261202123523.1181723-1-cengjianeng@huaqin.corp-partner.google.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 12:53:08 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "Intel-gfx" X-Spam-Status: No, score=-10.8 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: - [High] drm/i915/panel: resolution check in intel_panel_fixed_mode_vrr() breaks pfit - [Medium] drm/i915/panel: highest-vrefresh pick in intel_panel_fixed_mode_vrr() issues -- commit d8dd1559a8bbd09428dc3a244bd9e5fd5dc86f8d Author: Jianeng Ceng drm/i915/panel: anchor to highest vrefresh fixed mode without a VRR referen= ce This commit updates intel_panel_fixed_mode_vrr() to select the highest vrefresh fixed mode of the requested resolution when vrr_ref_mode is NULL. > diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm= /i915/display/intel_panel.c > index 81e638d0c7b33..3a6ed5c5a8d8a 100644 > --- a/drivers/gpu/drm/i915/display/intel_panel.c > +++ b/drivers/gpu/drm/i915/display/intel_panel.c > @@ -115,6 +115,27 @@ intel_panel_fixed_mode_vrr(struct intel_connector *c= onnector, > !is_vrr_compatible(fixed_mode, vrr_ref_mode)) > continue; > =20 > + /* > + * Without a vrr_ref_mode (pipe newly enabled, or a seamless > + * update without a compatible reference) always anchor at the > + * highest vrefresh mode of the requested resolution. VRR can > + * only stretch the vblank down, so picking the closest mode > + * would anchor the pipe to a lower clock family, and a > + * subsequent seamless switch to a higher vrefresh would need a > + * full modeset and blink the panel. > + */ > + if (!vrr_ref_mode) { > + if (fixed_mode->hdisplay !=3D mode->hdisplay || > + fixed_mode->vdisplay !=3D mode->vdisplay) > + continue; [Severity: High] Won't comparing fixed_mode against mode->hdisplay and mode->vdisplay reject every entry in connector->panel.fixed_modes when userspace requests a non-native resolution to be scaled by the panel fitter? is_alt_fixed_mode() only adds fixed modes matching the preferred mode's native hdisplay and vdisplay, and intel_panel_compute_config() runs before intel_pfit_compute_config() to replace the requested mode in adjusted_mode with a native panel fixed mode. With this check, any non-native scaled mode causes intel_panel_fixed_mode_vrr() to return NULL and fall back to intel_panel_compute_config_fixed_rr(), which fails with -EINVAL whenever the requested refresh rate is more than 1 Hz away from a fixed mode (and otherwise picks the closest-vrefresh fixed mode without VRR vtotal adjustment). > + > + if (!best_mode || fixed_mode_vrefresh > > + drm_mode_vrefresh(best_mode)) > + best_mode =3D fixed_mode; > + > + continue; > + } [Severity: Medium] In intel_panel_compute_config_vrr(), vrr_ref_mode is NULL on every commit with state->base.allow_modeset =3D=3D true as well as on the !allow_modeset fallback. Does unconditionally picking the highest-vrefresh fixed mode whenever vrr_ref_mode is NULL cause several unintended regressions? First, commit 4a2bdf0c87c7 ("drm/i915/panel: Attempt VRR based refresh rate change for !allow_modeset") kept closest-vrefresh selection when allow_modeset is true so lower-clock fixed modes can be used to save power; always anchoring to the highest-vrefresh mode makes lower-clock fixed modes in the VRR range unreachable, and breaks fastboot takeover if BIOS booted the panel in a lower-clock fixed mode. Second, on panels with VRR-compatible fixed modes sharing the same clock, an allow_modeset=3Dtrue commit at a lower refresh rate will synthesize vtot= al from the integer vrefresh of the highest-vrefresh mode, whereas a later allow_modeset=3Dfalse commit (where vrr_ref_mode is non-NULL) picks the exa= ct lower-vrefresh EDID fixed mode via is_best_fixed_mode(). When a !allow_modeset commit has no compatible reference and falls back to vrr_ref_mode =3D=3D NULL, switching to a different clock family still fails intel_pipe_config_compare() and returns -EINVAL. Third, intel_panel_mode_valid() validates target_clock against intel_panel_fixed_mode() (closest vrefresh), so intel_panel_fixed_mode_vrr() can now pick a highest-vrefresh fixed mode whose clock was not validated for the requested mode and exceeds link or dotclock limits. Finally, because intel_vrr_compute_guardband() clamps vrr.guardband to intel_vrr_max_guardband() (which shrinks with a shorter vblank at the highest refresh rate) and intel_pipe_config_compare() checks vrr.guardband on fastset, anchoring at the highest-vrefresh fixed mode still requires a full modeset when switching to the highest refresh rate whenever vrr.guardband changes. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202123523.1181= 723-1-cengjianeng@huaqin.corp-partner.google.com?part=3D1