Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2289683pxb; Fri, 5 Feb 2021 14:01:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzSpeEWNYG6FXK8ZZtGIiUmQbbE4cenbV6bcTbz33p4wzPCatMw7GvHlgBe9+/eiTecr6SP X-Received: by 2002:adf:ee09:: with SMTP id y9mr7181480wrn.74.1612562465336; Fri, 05 Feb 2021 14:01:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612562465; cv=none; d=google.com; s=arc-20160816; b=FmX+I4Ihyc+Rf72+KDCsteWdAR3+XDmBp904GPS/TnNE0SxMTlNBKOU3skSX/SJNK2 ldflKyC5RRI7fi3nX4IK+DNClAGqj/Mit+oovTYOgZaa+CeiyIFnxOB1j1EWvH4Lv/TL 8MerYTE6mNnALlnmNiAFZtkzHV/tTi3wO9ZnWZzWIoYWj9Ew/cPOdO1UF8qGIO4CLMXo /HIc6rtgts78cC+6uU9GUX+vCw0w1G+Hvlw3dqLcMb+bau4UmK1hD8N8ljl5nJyz2NUx oK7KvdEURJCRAmA1TVqEWWGU2kDubtbNEHYNEFdOKAop4bRmlCZ/82rReNzO5N+a1XtK WNRQ== 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=LiH4he03Sn045jIDCCVSTO1eDGvMBfvuYaO3NYnLluw=; b=Nhs/CJcZIy0Ht9lKVJZv8eqUwL0L/OTuTi0+svJUjcKT55ZZrQSkedG+e24BCi7ju0 JUblnoKfR7Dxt1Slv2SM00Ex7oB/Fz5NCyu5Z3wDZ0DQfyg2U3D90TUgOWrKeYAwigZg s37Ot4qXqc89EEpriIUOHRapEPa1WGGcHsRB///Vhrs3SvLzKz1Ci0gOxbAiSU4UmBCD Ou1fGuGWJH97CfCEhE5qceH9wGK8ZLeMRZsxLB2CVNknGVee8uLJLFJ9MBx6nqvaUuEe GawgknEDtQEo67yPmjEoLhTuTjg1UCrpVyHfHAqCCkj2Gv6XouL0MW8Ravk/GRQ0EEhc RmxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jTy5cbxw; 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 li7si458133ejb.615.2021.02.05.14.00.40; Fri, 05 Feb 2021 14:01:05 -0800 (PST) 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=jTy5cbxw; 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 S231749AbhBEV7w (ORCPT + 99 others); Fri, 5 Feb 2021 16:59:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:44982 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232882AbhBEO71 (ORCPT ); Fri, 5 Feb 2021 09:59:27 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3B4186501C; Fri, 5 Feb 2021 14:11:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612534261; bh=hvCJgtiskHqwsFaSnJ8nJEeTGp3QERMQ4m5jFCX8rKw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jTy5cbxwOxNQJGBqcx64vLwGRwNv/55Yj1UVRhKEOXmQLcoXjTq16/ifRKhi+ENON riW9WzOJ7O3Vz4COcc1Hfd1LFW5Rm+rkk8Et7sOhwcwfXbgbn0ii+o5Xx4+2w2mBav BP4iop5qu5kFUVpjuVRZpHFE8n2SejqbREDM64Uw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Wheeler , Aric Cyr , Jun Lei , Anson Jacob , Alex Deucher , Sasha Levin Subject: [PATCH 5.10 47/57] drm/amd/display: Allow PSTATE chnage when no displays are enabled Date: Fri, 5 Feb 2021 15:07:13 +0100 Message-Id: <20210205140657.994940469@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205140655.982616732@linuxfoundation.org> References: <20210205140655.982616732@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 8bc3d461d0a95bbcc2a0a908bbadc87e198a86a8 ] [Why] When no displays are currently enabled, display driver should not disallow PSTATE switching. [How] Allow PSTATE switching if either the active configuration supports it, or there are no active displays. Tested-by: Daniel Wheeler Signed-off-by: Aric Cyr Reviewed-by: Jun Lei Acked-by: Anson Jacob Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- .../gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 b0e9b0509568c..95d883482227e 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 @@ -239,6 +239,7 @@ static void dcn3_update_clocks(struct clk_mgr *clk_mgr_base, struct dmcu *dmcu = clk_mgr_base->ctx->dc->res_pool->dmcu; bool force_reset = false; bool update_uclk = false; + bool p_state_change_support; if (dc->work_arounds.skip_clock_update || !clk_mgr->smu_present) return; @@ -279,8 +280,9 @@ 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; - if (should_update_pstate_support(safe_to_lower, new_clocks->p_state_change_support, clk_mgr_base->clks.p_state_change_support)) { - clk_mgr_base->clks.p_state_change_support = new_clocks->p_state_change_support; + p_state_change_support = new_clocks->p_state_change_support || (display_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; /* to disable P-State switching, set UCLK min = max */ if (!clk_mgr_base->clks.p_state_change_support) -- 2.27.0