Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2052791rwe; Fri, 2 Sep 2022 07:53:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR5p7Zcsf/g7BOpX+ZkZ4z6TwAnh8iM3F+twWtwqpU8CQlX2m4dswBFu9NCvM9RefxVoA22Q X-Received: by 2002:a17:902:c40f:b0:175:43dd:e9f4 with SMTP id k15-20020a170902c40f00b0017543dde9f4mr12375261plk.21.1662130389254; Fri, 02 Sep 2022 07:53:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662130389; cv=none; d=google.com; s=arc-20160816; b=k/A0J/ReJAVwcRF6CyUWq+bfn86VndojPowcRdEdwSwe7m55LY1PEQHFcZaeim0A1L 76FZmDhDFK2gjtSiKw4IXUirFojhoKozY28Lgu2W330jepqWrqvSStGammg3FqZhLLnD Fvx78cYivfxsZRfwoeUGi9Nb1G4YLFTvPG/J1HvYKCzD8EaWRzT1s3ml+RlmTHP+Loyd Ja4vogl7m9gYv+ohthf7owfxJPPujrw6wecJOcHP+9cz0vDpgBttbmcqsEVx2cTJgRRW h/5j1CYK/TIg0Efc5rxTIyM5SvTlXlteyEQetSVs+Etzz0MkuNCC3PB9vSrujqNpVCdh 3ldA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kJmGw4eX44jA/xqen8xkEQYsOm8LSN7S5+Tr6WDrfLI=; b=AYlzTR2+9cPGDcASJhb2uz+LGBArKJF3V9SYcn4zgkPMSaDTcWCQ3De401KLDnnvS/ sD+WuAhPouXtzOqrnOj5IpCC4MaOU37faJbptGZ4UeQvSDXSDuFXo7eYbxpjAYGRoGPq U4xDmaPGWd3AKEQTB+nH0hr0W+XPU5rYLjn26tFRzQfbn5qhbUf3XG7ceuvJhPe2yeMa QXE4z7XYAWoxG1s5mzQCWonO2VCqxJtChjWt6pSfflyl/WLdZSxzCxk9ESSFNppObiov NDZKsLneZS8pFJpzvoJK+LpiWUqRilpdBxJZpvt8sNxOqmQ7E0P3h7d5Oq7IKHOx69rv CUWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JCOw1pAM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s14-20020a170902ea0e00b0016ce3d67e7csi2357015plg.387.2022.09.02.07.52.57; Fri, 02 Sep 2022 07:53:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JCOw1pAM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237217AbiIBOH1 (ORCPT + 99 others); Fri, 2 Sep 2022 10:07:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238388AbiIBOHK (ORCPT ); Fri, 2 Sep 2022 10:07:10 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E6E6201B8; Fri, 2 Sep 2022 06:35:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 532CEB82AA1; Fri, 2 Sep 2022 12:38:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91D9CC433C1; Fri, 2 Sep 2022 12:38:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662122315; bh=C0kRf5bfCnAeS9Hjj1AXvIeKcZDY5VMANtibcHCCYZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JCOw1pAMEnG/Nb0wKOg+H7CkFVyh130rp/HWJ5hw2dv7hEsxewZ2xBkDqc82jojQz MyKtgK+/M4BoutZCuWaT8C9cBNcZjxfl4jCeshiiM3K3sbMq5asA9Uc2VqAi0q0MVq /oqjh6n9anvhuQO8ZbEZ7h+aljfwiGpFGqrocb0k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aric Cyr , Brian Chang , Ilya Bakoulin , Daniel Wheeler , Alex Deucher , Sasha Levin Subject: [PATCH 5.19 55/72] drm/amd/display: Fix pixel clock programming Date: Fri, 2 Sep 2022 14:19:31 +0200 Message-Id: <20220902121406.569076375@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220902121404.772492078@linuxfoundation.org> References: <20220902121404.772492078@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ilya Bakoulin [ Upstream commit 04fb918bf421b299feaee1006e82921d7d381f18 ] [Why] Some pixel clock values could cause HDMI TMDS SSCPs to be misaligned between different HDMI lanes when using YCbCr420 10-bit pixel format. BIOS functions for transmitter/encoder control take pixel clock in kHz increments, whereas the function for setting the pixel clock is in 100Hz increments. Setting pixel clock to a value that is not on a kHz boundary will cause the issue. [How] Round pixel clock down to nearest kHz in 10/12-bpc cases. Reviewed-by: Aric Cyr Acked-by: Brian Chang Signed-off-by: Ilya Bakoulin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c b/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c index 845aa8a1027d8..c4040adb88b03 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c @@ -545,9 +545,11 @@ static void dce112_get_pix_clk_dividers_helper ( switch (pix_clk_params->color_depth) { case COLOR_DEPTH_101010: actual_pixel_clock_100hz = (actual_pixel_clock_100hz * 5) >> 2; + actual_pixel_clock_100hz -= actual_pixel_clock_100hz % 10; break; case COLOR_DEPTH_121212: actual_pixel_clock_100hz = (actual_pixel_clock_100hz * 6) >> 2; + actual_pixel_clock_100hz -= actual_pixel_clock_100hz % 10; break; case COLOR_DEPTH_161616: actual_pixel_clock_100hz = actual_pixel_clock_100hz * 2; -- 2.35.1