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=1796383898; b=Xy9nveadc5A2ujYgE398VdDpIVFT5ZDlkvbOkeDiicFacfxYlxHimmAuCxhUu6YLX7v3 HuiwbmyTA7HSoH0/cuDCCWZ9alCReOzsouSU5oct4YjX/f7pAfRMZBp+cJhMnMMYGrymi QqZCjol44SUXBGN/RtUit94SjdQ4/GGt5yNrV2kt6rNT70Ty+wZeOfVXy0TpCUJmVHw8Y +tMzN5X8s1SN8yy50EOSPj39Op1/tvuygsX6H+DVlZR0juf3Wqdowy9T6ga69EKZhuYZv bP/7UvNp0t+4G6M5t3D3MFRfLN9GEffK12DcmtqficbEzOOPXmqVFfv/ebh7qZcPYRw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383898; 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=yQefnX+S2xXLaxwtKuxzkuTvmlUcE3mRX3hfD2BUKZg=; b=FWufwtY5mWbFh+WGouEyvVDk1UWxiteeO9uW11RVp2YXe+OoS0XISEOt40EKvAAGsSqd TT8Mm41KWCjdsJTcNLq24wtqIQrfcCoMEN09YyWTudtwC6NxwpKeNYuH0bpSakXRcm0+9 jP5jqdF2nFfiG1vqjm9U6lym9n6myMBBroYlTs7rBLgAQQTj28VMUlc6mr9TgftsAsvPH hT3YmkWIb/EjVo/jwg7dohjxqVaRwvFyk2s4OHmxAsDfdoD6epqA5cP8AMqHvrKctHizN NwBOuRB1f8BYYYz4Eq2LUL1khf6r6FicIi7sJefafsF0AGMTbhFkTubTec1uQjteNwA== 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=cWMMSuy8; 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 868AD60A2624; Fri, 4 Dec 2026 11:31:38 +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=cWMMSuy8 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD7F81F00A07; Fri, 4 Dec 2026 11:31:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383898; bh=yQefnX+S2xXLaxwtKuxzkuTvmlUcE3mRX3hfD2BUKZg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cWMMSuy8xovEoAW7YLAL5wMFXpKZZfB4IJBpOfLywrWkvjfQH8yqKeSTxyYJIR6NB YUGJggDRLdL1qbUfvpGsUVkfKQMybaqf9tprwJj2UhMFES90bH2I4qD3nNzt0NP6Gh kYx2ayEOJgF7MsPQ5VgwjuVqKF6k0lYahwQtgjX4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tim Douglas , Helge Deller Subject: [PATCH 6.12 374/555] fbdev: macmodes: compare the pixel clock of each candidate mode Date: Fri, 4 Dec 2026 19:06:57 +0900 Message-ID: <20261204100624.141354751@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-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 @@ -341,7 +341,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;