From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796382359; b=MoVaobsZ+HKw7Ik3Kb7JPGbwG6uUWiL4yqIU5pJnfxGvKgmnLKsXrG3OOILRadHYwt8G 9aeKEYUqMtTZzssPRJDUwYfPWrD/XPJKWRVY7f+CxQUUCtxnWLJMw46NcaWxc4dTIv5iF fCYKJyEIycxqooSyVsDU4VCOpI1lrLSFy5tBLt+8bWAtHZUUcUpXsdLDhjBO2VSRsPHmW bMYdQeIVIoyRAkL2MzNtyJQ8TB2I4JS4sjbcXgxFEBlr4DlRvWOIT89ipm4YcLIvg2OiL ty3/q+5fGmV9fOaBzRk0gdKQfy7nj0fAnsDOTV1Fd4oBUbH12HiUinb7FIx/6rt+1Ew== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382359; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=eSj2mpXrFS5MDUJ9yCDfIV1F2PIFemlkhYzN78WGvm8=; b=xRrAvHMrw22i0RH2wPRt0Z5NFUcFTvHc2cI6T2bzVx/oE0kNs7wvl9rB8rTtcVhfkwRw CJGGLAdb/uwRJSvaBgI8YPfvJjyI15MPEwGG11Yld4FzUv9pgMRHBJtmztQYlGci0/AYG qdLhzuoWU9Fi4kiy8j+XsB5LdXa1LghN/y7N/q7i6NpqvenfzKrVSNyygSIzO4cDa1zpq tpyqJNGkk5xBnbzMBky6zTsiQl9BIbiI3nP3NhQ4+Q7LdZFwHuSyEzLK/G7dBSD9brZJm usschKFjoVv3Y2LR+Rc9LZDmeKubRgqolnRU2BGh+fpq5reGLUMBAUBGWbj3QDVoc7w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=f50iIn0X; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 00677606A32D; Fri, 4 Dec 2026 11:05:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=f50iIn0X Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69E2F1F000C2; Fri, 4 Dec 2026 11:05:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382358; bh=eSj2mpXrFS5MDUJ9yCDfIV1F2PIFemlkhYzN78WGvm8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=f50iIn0XO/QomanB/IiFSjmr+NLm1080E5IkPa7Rr4opRI/8V4sODWGJyzzZQCBDx embD+KdiiZBF9meiqADyR8SfRVtrMLlKAJIgWLl41kAl7iFlsmjpcNs0/R5L+wS+pI 1bpAKAq70QFvkmfxKEQg/sK6xkC2TOdppTTHuvBE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tim Douglas , Helge Deller Subject: [PATCH 6.18 420/703] fbdev: macmodes: compare the pixel clock of each candidate mode Date: Fri, 4 Dec 2026 19:05:19 +0900 Message-ID: <20261204100639.000569831@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tim Douglas commit 3e973ab62c86d620b2db9e90eb8fc3b065929e6e upstream. In the second pass through the mode table in mac_var_to_vmode(), the requested pixel clock period was compared with the first mode's period at every step. The last mode at that resolution was therefore returned even when its period was too short. Compare against the current candidate's period. Tested on a Performa 6200CD using a kernel with local platform support. With video=valkyriefb:vmode:10 (800x600 at 60 Hz), the measured refresh rate was about 72 Hz before the fix and 60 Hz afterward. At 640x480, 67 Hz was also selected for a 60 Hz request before the fix. AI assistance was used to investigate the mode-table walk and draft the fix. Signed-off-by: Tim Douglas Fixes: d876c11a0fd4 ("fbdev: mac_var_to_mode() fix") Cc: stable@vger.kernel.org Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman --- drivers/video/fbdev/macmodes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/video/fbdev/macmodes.c +++ b/drivers/video/fbdev/macmodes.c @@ -342,7 +342,7 @@ int mac_var_to_vmode(const struct fb_var if (mode->xres != clk_mode->xres || mode->yres != clk_mode->yres) break; - if (var->pixclock > mode->pixclock) + if (var->pixclock > clk_mode->pixclock) break; if (mode->vmode != clk_mode->vmode) continue;