Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3090302rwb; Mon, 15 Aug 2022 17:53:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR4UPX1cDLj+qum5WJxqi3obida/JejFZXj7FNGA/mjwLzfgs83E37h72gmwG0rSEsMRFxF6 X-Received: by 2002:a17:907:e89:b0:730:af06:e345 with SMTP id ho9-20020a1709070e8900b00730af06e345mr12209047ejc.665.1660611202947; Mon, 15 Aug 2022 17:53:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611202; cv=none; d=google.com; s=arc-20160816; b=k9jhOjel8mTZyKb6nPYK9vB6T4FgI5m8wkwCsieeYF3VqIKdCBbo1r1xPeYRxFd1eD 4pAO3dl2hT2VrU10i0j+wHTXs5l5nqZtIUg2jvlUT36NxUlghFwtfpoYnSiBxyMJllqx NeZ7qq01DKAcpvZzcL7VBIgoxZdOWM3V2Eg4mVD5t47JRfSDtQNJGknoCeHXglinJgeN b4G4SEBOQJixPdjAsV8+zwoTNoHdmg2e0uIGj69VpXkRxu6a+AK86u733kNm/WAbNpry M71taHZtOCoCL/9CWa/iySZejkVUsqjTPsG25QYU/feH/4OcPRQXuSUENos7iOjdt5es Gw/Q== 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=jut5YHRI4xIUthO+Lw3+TGEEW+zeAji0zbLqDHjowZY=; b=h1oPfjMF05GNvQVc9SqB/gh9smoXSSy2bCizx6E/8od1RjNfs/CK6iJnWj7iq0wbmU 0ehZ5MUHGuoOnGCMGr/IzrxJmP6oMvBuWw+Tn8uKy8LXksHaBKX1qymYSH9No2MN1gnR RkhIx+tCsEGTBjJ7+k7vkI8BEdRWlLsyJ3Vdgq2nIaASX4xdOjUWMJxJonWgdjGxpGP9 zxM8+7u3Fe60dqrlSDffHWp3dy3TGdkWmmm0+TGXe2P1kR2Sj8RsSl/7aNnaU/noIR+2 iW3dy/nNubjtJzY9mxqrKTi1FIcu+m8zu2YBx098VmKbNB+l2WUpYGwTcl0prc6ek5kh 74rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RMUgFb9j; 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 i19-20020a1709064fd300b0073155b21c49si9172692ejw.965.2022.08.15.17.52.57; Mon, 15 Aug 2022 17:53:22 -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=RMUgFb9j; 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 S1355265AbiHOXrV (ORCPT + 99 others); Mon, 15 Aug 2022 19:47:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354354AbiHOXl6 (ORCPT ); Mon, 15 Aug 2022 19:41:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCDA3326CD; Mon, 15 Aug 2022 13:13:13 -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 75949B80EA8; Mon, 15 Aug 2022 20:13:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9FC26C433D6; Mon, 15 Aug 2022 20:13:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594391; bh=gvF9vfJBn1E/u+Vk2cnTqk824szUc7KavKwz//HsATE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RMUgFb9jogQUfpWJzZ/5SMEdPzk4BHA2fiY8knFPGYMr/n56Bg4MiqRVdTS1CYPC+ FVrMt2Fe4wcLcz8gVFkfJOEaJv4Ibhh03D1im8S8duQrz1Az+jaqbBr7hj4IxiEtqX hCEMLpUF1OmingnXL3x/iF9M5jnpJ3A2TyY6fJJ4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maxime Ripard , Dave Stevenson , Sasha Levin Subject: [PATCH 5.19 0406/1157] drm/vc4: kms: Use maximum FIFO load for the HVS clock rate Date: Mon, 15 Aug 2022 19:56:02 +0200 Message-Id: <20220815180455.904644417@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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: Maxime Ripard [ Upstream commit 1701a23a4ef0993964ccc2f2d5d13f83a5ff4c70 ] The core clock computation takes into account both the load due to the input (ie, planes) and its output (ie, encoders). However, while the input load needs to consider all the planes, and thus sum all of their associated loads, the output happens mostly in parallel. Therefore, we need to consider only the maximum of all the output loads, and not the sum like we were doing. This resulted in a clock rate way too high which could be discarded for being too high by the clock framework. Since recent changes, the clock framework will even downright reject it, leading to a core clock being too low for its current needs. Fixes: 16e101051f32 ("drm/vc4: Increase the core clock based on HVS load") Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson Link: https://lore.kernel.org/r/20220613144800.326124-4-maxime@cerno.tech Signed-off-by: Sasha Levin --- drivers/gpu/drm/vc4/vc4_kms.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index 893d831b24aa..b7353d4c0811 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -950,7 +950,9 @@ vc4_core_clock_atomic_check(struct drm_atomic_state *state) continue; num_outputs++; - cob_rate += hvs_new_state->fifo_state[i].fifo_load; + cob_rate = max_t(unsigned long, + hvs_new_state->fifo_state[i].fifo_load, + cob_rate); } pixel_rate = load_state->hvs_load; -- 2.35.1