Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2483315pxj; Mon, 10 May 2021 04:11:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBJ7aeH4h/pd10an2GTX1C8RT+z2KFAl9WSnC6464vHvwW7sO6/Squib0BpaS6Bei4IkYA X-Received: by 2002:aa7:c4d0:: with SMTP id p16mr29664882edr.102.1620645074986; Mon, 10 May 2021 04:11:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645074; cv=none; d=google.com; s=arc-20160816; b=scSGSc91VPtnuzmW8jpg7MxDi9ONHs2VkZE9nMqqSYbAvO+BAwQRA+DC29FTMp9MY3 ltVf5xGcRE+E5GC8fqL3/gkPEFEZDaqLO/lBzmq7TbVWi6FNSPiF1VMrEq1vOVh0jtwW Bqc+a7Nv9n5wXSEX6gFbPURl7k3JigxSnGXBYaY3ngXNPK70EV+5NPkH8TsWE13zbdG3 ny0CeeVq3RljNYJCwup3RlGxE52p8op1zEk4MDRsSknxRXIv2FZa5XM8XJ7daGnfpv2s jTFpdgwXbdDoVGGCUYgTzj1/tV/J6KOmUxWWBgwaH4ruj5TEKkMybeW9XgWw3ESXumse SIWg== 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=UwowXCn//Ii8SAGkV65bYEfPqd4eSqtSiD7KmTrdRH4=; b=tuEnyASn4X60Cv3NU7wy59hDUn7DpjSrYYdKyGbL9Doy9Nr8YQxBQhlKc6LiMhcCyc VXa0h04czNLtdq3OScLnETD2vjaKZ1PZcNdAuUfxrgtrndEV2rGIufTr7GMo6xaiJmwp zY0it6YMNEKsAKswK//YTh1CFgeJfSsxHvbWu9rV9m1Y2EQAeW0kMFx2ma0EmKtQo8av +5CVg46GQv7F8xz0VC9hiSH0qcCv7zRQSdWFa0i1767WSF2SR4mtuRqi9yRl3GvlugRI XNEQ/yFuWTJEqC+KeBNSbKMlsGFLl3pMRTmR4keQUNxyYbeb1sSfpaZZtQTRs4G0ISm5 Z65w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PrQv4JZs; 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=pass (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 gx12si7597704ejb.555.2021.05.10.04.10.51; Mon, 10 May 2021 04:11:14 -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=@linuxfoundation.org header.s=korg header.b=PrQv4JZs; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235905AbhEJLGz (ORCPT + 99 others); Mon, 10 May 2021 07:06:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:57152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231822AbhEJKp7 (ORCPT ); Mon, 10 May 2021 06:45:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 99143619AB; Mon, 10 May 2021 10:37:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643023; bh=9SaHmlyN759saoLkHGSXLWPljVMs7EBk8+FWa8g4ins=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PrQv4JZsETtyh3VJXd9MRjrLUpUiVKsue1TLPpINi+G3pO06AD/I0WdO7MK0utJjz eY3Jfzbr6TU9NcKWFAtWo5C9pHVMw6gf7FwljE0e48BZfCIj6rU3aw/inGUjqbaQWH QD9WDxA93fPaa5XBLATlaMJWZBuJGAi0Eed6QjMk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Wheeler , Aric Cyr , Solomon Chiu , Alex Deucher , Sasha Levin Subject: [PATCH 5.10 146/299] drm/amd/display: DCHUB underflow counter increasing in some scenarios Date: Mon, 10 May 2021 12:19:03 +0200 Message-Id: <20210510102009.787357134@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aric Cyr [ Upstream commit 4710430a779e6077d81218ac768787545bff8c49 ] [Why] When unplugging a display, the underflow counter can be seen to increase because PSTATE switch is allowed even when some planes are not blanked. [How] Check that all planes are not active instead of all streams before allowing PSTATE change. Tested-by: Daniel Wheeler Signed-off-by: Aric Cyr Acked-by: Solomon Chiu Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c index 95d883482227..cab47bb21172 100644 --- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c +++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c @@ -240,6 +240,7 @@ static void dcn3_update_clocks(struct clk_mgr *clk_mgr_base, bool force_reset = false; bool update_uclk = false; bool p_state_change_support; + int total_plane_count; if (dc->work_arounds.skip_clock_update || !clk_mgr->smu_present) return; @@ -280,7 +281,8 @@ static void dcn3_update_clocks(struct clk_mgr *clk_mgr_base, clk_mgr_base->clks.socclk_khz = new_clocks->socclk_khz; clk_mgr_base->clks.prev_p_state_change_support = clk_mgr_base->clks.p_state_change_support; - p_state_change_support = new_clocks->p_state_change_support || (display_count == 0); + total_plane_count = clk_mgr_helper_get_active_plane_cnt(dc, context); + p_state_change_support = new_clocks->p_state_change_support || (total_plane_count == 0); if (should_update_pstate_support(safe_to_lower, p_state_change_support, clk_mgr_base->clks.p_state_change_support)) { clk_mgr_base->clks.p_state_change_support = p_state_change_support; -- 2.30.2