Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4184294pxk; Tue, 8 Sep 2020 12:54:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/MmlPl0jK0BsgOMjDTBno6HiyqVTMCpAYJHI+wbfQxug8PxH4FkVnpBX36ijs8QZpJLDd X-Received: by 2002:aa7:d1ce:: with SMTP id g14mr678068edp.153.1599594876246; Tue, 08 Sep 2020 12:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599594876; cv=none; d=google.com; s=arc-20160816; b=C9pGq5cu/wslVAJvLsUAcQ8EwEmrJePeMoUe0PFu8IzQEtTwYf2EPOu4RsLsbeP3zL 2BYj99t+uQCgI5WM2KTiIY/0xhQYkGP9k75BgI5ftMp0rkZUr9BaP3EBtyJX5vtFu7Ek HOdLOIUzzJ0ChiSUlLFVxKNWhnRFGpGKD/0s2ng22fOCvBylsGgDth1DFtSh8r4FdfGr hS6QR5oehcCjzdqlEcNFfxyNuoZKYIrCPElIZ+sP7CZPW1hZ9l7x2BsPmiCUiFxwEe0Z ihRamP1jmMN6acOT+lpdUgr4FCjX92Bi7YhlCn6/8AIIRPYyCIBL1WFo0fNhuaQPO3JR BT9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ufm4whmSFUUvnn3ZZVO10wE1iVSBY3Vlimzxl+j6cW0=; b=i35zfuUrblf8mu8p8Smp6Uqp9OLR9kTXT478gNRFz9JQ4TxOkt+th+kX0/kG7g/zJ4 OLVrZL18i0+diGSZF4+HqhNw3ANFgYMSOZCm0em4dth0nUVfiVBAt++0h3yu9ScRke0p t77rkgTMPADqTZe+nYxAniOIfn4RJmepmMtaIyVxYHEBom237FILnSfVVSJYXBMzFe/i G5dzY2Bn45QydPAA0UYTL+56gspMVULD4unGi2sB845X7dcNfugT4wYHN2Q/8nL2E32/ PexM0Lx4IAN015/9i88jjXZE4fUnJH+oPOyLho+WxyvzUEvLD21nKzmZk9fcqsEtHLDG Fn3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rXM6Ytaz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f9si15867ejl.32.2020.09.08.12.54.14; Tue, 08 Sep 2020 12:54:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rXM6Ytaz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730980AbgIHTxD (ORCPT + 99 others); Tue, 8 Sep 2020 15:53:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:38038 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730678AbgIHPsF (ORCPT ); Tue, 8 Sep 2020 11:48:05 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D735024824; Tue, 8 Sep 2020 15:44:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599579855; bh=g+Y6OJgjtiO5LtwGG8TxanGgSG6X9uTXvfM7dtbP7T4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rXM6YtazehkDsYIp9Sp/nLSZBtHxgV7rvovVcJCGiUME7BotACMbA5KPfZ4W8io7N RDDgVYz3ydgAyF85YD+U2Er/XPKpGwZ9BJ6Y9cKbDH/W2BOy98l+LgEgR+ZqXWZEG5 zbCso3bcOuLu5iIEd/tPGuXzs/xUYXKaothnu2WA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Christian=20K=C3=B6nig?= , Kai-Heng Feng , Alex Deucher , Sasha Levin Subject: [PATCH 5.4 061/129] drm/radeon: Prefer lower feedback dividers Date: Tue, 8 Sep 2020 17:25:02 +0200 Message-Id: <20200908152232.749853677@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200908152229.689878733@linuxfoundation.org> References: <20200908152229.689878733@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kai-Heng Feng [ Upstream commit fc8c70526bd30733ea8667adb8b8ffebea30a8ed ] Commit 2e26ccb119bd ("drm/radeon: prefer lower reference dividers") fixed screen flicker for HP Compaq nx9420 but breaks other laptops like Asus X50SL. Turns out we also need to favor lower feedback dividers. Users confirmed this change fixes the regression and doesn't regress the original fix. Fixes: 2e26ccb119bd ("drm/radeon: prefer lower reference dividers") BugLink: https://bugs.launchpad.net/bugs/1791312 BugLink: https://bugs.launchpad.net/bugs/1861554 Reviewed-by: Christian König Signed-off-by: Kai-Heng Feng Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/radeon/radeon_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index f9f74150d0d73..e7c4e06bc7d4f 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -932,7 +932,7 @@ static void avivo_get_fb_ref_div(unsigned nom, unsigned den, unsigned post_div, /* get matching reference and feedback divider */ *ref_div = min(max(den/post_div, 1u), ref_div_max); - *fb_div = DIV_ROUND_CLOSEST(nom * *ref_div * post_div, den); + *fb_div = max(nom * *ref_div * post_div / den, 1u); /* limit fb divider to its maximum */ if (*fb_div > fb_div_max) { -- 2.25.1