From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFA98352FFA; Tue, 26 Aug 2025 14:40:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756219250; cv=none; b=JSRf7YVNgIarq2g+oRu6UeePQrWajGFGAraWFudPjoFL3AoKNd6w+Mz60yQvbo6wVN2u5BDE80vS/JefsRaxNrCFVoVWeNgafO/AgZqan00kJ0/sT3NurRb0aKO/+LiRjln33locphiusDECiaI+4s8OGOdbAASHZLsKhHNCpqA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756219250; c=relaxed/simple; bh=vgh9YIG3os+hu450ms3ZcZVZq4gS0zxwOOoqpOohh/A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=eOMqsCsI52aCVCm0JarrRsks34F7+naeYqdtiedFyw34bc7r3LKswwmmkhw9U6MiwK9ojaqrvToHikUrBIcm3tnZkFO1TAEctE6pmYEo7/JqObDnB8C0bsyRyaJC2WHFD37qDDilwVuHqeLL3j4EhR1EUSlBX+3Xddkw0vhpJAA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=II7pyUej; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="II7pyUej" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 460E7C113CF; Tue, 26 Aug 2025 14:40:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756219250; bh=vgh9YIG3os+hu450ms3ZcZVZq4gS0zxwOOoqpOohh/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=II7pyUejc7x5l7Wjt+mAdDEmmqxIU4on5KNWrlQ4FT/SLGnzIYHZ3/YbMUE3k3KNG AK+elR/8fO1egFDjwIhOxTud0P4ojG3hHGQex7m+iDf+Krkdt8+Nal6YUO5QYGiakm qHBT2KQ9I6y0lf2dRQaNB8yxXMZoSJOgO94detpg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Timur=20Krist=C3=B3f?= , Alex Deucher , Rodrigo Siqueira , Alex Hung Subject: [PATCH 5.4 310/403] drm/amd/display: Fix fractional fb divider in set_pixel_clock_v3 Date: Tue, 26 Aug 2025 13:10:36 +0200 Message-ID: <20250826110915.374789910@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110905.607690791@linuxfoundation.org> References: <20250826110905.607690791@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Timur Kristóf commit 10507478468f165ea681605d133991ed05cdff62 upstream. For later VBIOS versions, the fractional feedback divider is calculated as the remainder of dividing the feedback divider by a factor, which is set to 1000000. For reference, see: - calculate_fb_and_fractional_fb_divider - calc_pll_max_vco_construct However, in case of old VBIOS versions that have set_pixel_clock_v3, they only have 1 byte available for the fractional feedback divider, and it's expected to be set to the remainder from dividing the feedback divider by 10. For reference see the legacy display code: - amdgpu_pll_compute - amdgpu_atombios_crtc_program_pll This commit fixes set_pixel_clock_v3 by dividing the fractional feedback divider passed to the function by 100000. Fixes: 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)") Signed-off-by: Timur Kristóf Acked-by: Alex Deucher Reviewed-by: Rodrigo Siqueira Reviewed-by: Alex Hung Signed-off-by: Alex Deucher (cherry picked from commit 027e7acc7e17802ebf28e1edb88a404836ad50d6) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/display/dc/bios/command_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/amd/display/dc/bios/command_table.c +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table.c @@ -992,7 +992,7 @@ static enum bp_result set_pixel_clock_v3 allocation.sPCLKInput.usFbDiv = cpu_to_le16((uint16_t)bp_params->feedback_divider); allocation.sPCLKInput.ucFracFbDiv = - (uint8_t)bp_params->fractional_feedback_divider; + (uint8_t)(bp_params->fractional_feedback_divider / 100000); allocation.sPCLKInput.ucPostDiv = (uint8_t)bp_params->pixel_clock_post_divider;