Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2930340rwb; Mon, 15 Aug 2022 14:16:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR7QX2pyXLGva9lle0b+6OdA85XfDPdqqq3fd+Ix1TioaYcgIbD4f6uiMBhHCwKdlAlIr8Yn X-Received: by 2002:a17:90b:1e4a:b0:1f5:4f69:d6b4 with SMTP id pi10-20020a17090b1e4a00b001f54f69d6b4mr20779320pjb.164.1660598064451; Mon, 15 Aug 2022 14:14:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660598064; cv=none; d=google.com; s=arc-20160816; b=rRmBlKfPK2b4QM28aYBA0+6PL8k6nFld84xmM0FWprxQT0W2ikHQTxqvyGRM0qKEsW BxvtrFED5ei9OwxQ7IJxrpk0wTMhTVwsnvcf05mM9LobIF56fG9dLaGWfJeBZtKgUGeF LVWAhrE9OMNHJdb8qf48y4q5DUeOw5XehW4KpW8pZayfokmViW+68rbaV4Qo5fd6pL3A zTkcaz3ZR7GmssxuumwzBpr+kM2MyLupUshQ/d+ada9y4DXvGNGDmzxiPU5EaCCjIbg5 02qyaPAjWR5z8tlcZp2OBXL5KqOS9YKVpj0pS8bwaM8vlFpynQg/QoMQqQA77FwmZ8OX 8/HA== 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=qe1mVQOKoqDTcF1djv9i4pSB0ue0g8DOOod4NpPMkGY=; b=BRWBctzVFy9oT0KWo+eSAQ0A7a3GbSXOSGC+f96ciw+IEWJBnJ35aHQOfhDFHvVNXE s0K1xQwPmsNrVvyG98NK7evsQQjP/37OCbXM+7Rh/fPa3K6cA8NYjC5K66b12kstjM1B Uekw74Hn644KV1vr8R9jWnK/NLO5bU3KsQqkYm8rIuWkjchQ64pyqEgJvnyoOydvU/K4 GvYgSbBO98GP9d7dC0OHIjWSjAoFdLguCxwwiI0xOQFnVBM3JbrDKaqFEuq81t+Z8Ahh 87fUUicfh3JhL64nxLm9Axd+QcXnVjCVD200cjM4olKcT08HMbNdNpUSzhbQXYauuure o46A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="C0Wb6/Aq"; 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 x5-20020aa78f05000000b005251a2f06bbsi11393356pfr.59.2022.08.15.14.14.13; Mon, 15 Aug 2022 14:14:24 -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="C0Wb6/Aq"; 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 S239747AbiHOVEH (ORCPT + 99 others); Mon, 15 Aug 2022 17:04:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347390AbiHOVB4 (ORCPT ); Mon, 15 Aug 2022 17:01:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C0AF51A06; Mon, 15 Aug 2022 12:13:48 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 24DF760ACE; Mon, 15 Aug 2022 19:13:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13E39C433D7; Mon, 15 Aug 2022 19:13:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660590826; bh=gfwa/U5aTt/Oj2XOulh95h2ISx/w91u6PWTvRX/iS1g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C0Wb6/AqiUnsh4tGszy9MkrbiQEEcgD/iyjDA0gx66sn1ZUxKPzpLwdD1yL8KkPWe nRfUzWembMQX+jJxarRUvQc1B8Xn9X8Rah7bT2vci3dUuGiVxlyOWjH9pVzsjJQzNf ykYU470HJUlxe2l6zRfjkU3bkCj3AHde0O1mVvfk= 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.18 0383/1095] drm/vc4: kms: Use maximum FIFO load for the HVS clock rate Date: Mon, 15 Aug 2022 19:56:22 +0200 Message-Id: <20220815180445.529134312@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 992d6a240002..dba23ae2e65e 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -890,7 +890,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