From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02E36C433DB for ; Thu, 28 Jan 2021 10:05:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9F71B64DBD for ; Thu, 28 Jan 2021 10:05:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232090AbhA1KFq (ORCPT ); Thu, 28 Jan 2021 05:05:46 -0500 Received: from foss.arm.com ([217.140.110.172]:55766 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231872AbhA1KFl (ORCPT ); Thu, 28 Jan 2021 05:05:41 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0CA411042; Thu, 28 Jan 2021 02:04:54 -0800 (PST) Received: from [10.57.11.243] (unknown [10.57.11.243]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5127D3F766; Thu, 28 Jan 2021 02:04:52 -0800 (PST) Subject: Re: [PATCH v2] drm/lima: add governor data with pre-defined thresholds To: Christian Hewitt , Qiang Yu , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Steven Price References: <20210127194047.21462-1-christianshewitt@gmail.com> From: Lukasz Luba Message-ID: <3ff0efe3-c57a-369c-863a-955004612bda@arm.com> Date: Thu, 28 Jan 2021 10:04:50 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20210127194047.21462-1-christianshewitt@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/27/21 7:40 PM, Christian Hewitt wrote: > This patch adapts the panfrost pre-defined thresholds change [0] to the > lima driver to improve real-world performance. The upthreshold value has > been set to ramp GPU frequency to max freq faster (compared to panfrost) > to compensate for the lower overall performance of utgard devices. > > [0] https://patchwork.kernel.org/project/dri-devel/patch/20210121170445.19761-1-lukasz.luba@arm.com/ > > Signed-off-by: Christian Hewitt > --- > Change since v1: increased upthreshold from 20 to 30, with a soft > dependency on Lukasz delayed timer patch [0] > > [0] https://lore.kernel.org/lkml/20210127105121.20345-1-lukasz.luba@arm.com/ > > drivers/gpu/drm/lima/lima_devfreq.c | 10 +++++++++- > drivers/gpu/drm/lima/lima_devfreq.h | 2 ++ > 2 files changed, 11 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/lima/lima_devfreq.c b/drivers/gpu/drm/lima/lima_devfreq.c > index 5686ad4aaf7c..c9854315a0b5 100644 > --- a/drivers/gpu/drm/lima/lima_devfreq.c > +++ b/drivers/gpu/drm/lima/lima_devfreq.c > @@ -163,8 +163,16 @@ int lima_devfreq_init(struct lima_device *ldev) > lima_devfreq_profile.initial_freq = cur_freq; > dev_pm_opp_put(opp); > > + /* > + * Setup default thresholds for the simple_ondemand governor. > + * The values are chosen based on experiments. > + */ > + ldevfreq->gov_data.upthreshold = 30; > + ldevfreq->gov_data.downdifferential = 5; > + > devfreq = devm_devfreq_add_device(dev, &lima_devfreq_profile, > - DEVFREQ_GOV_SIMPLE_ONDEMAND, NULL); > + DEVFREQ_GOV_SIMPLE_ONDEMAND, > + &ldevfreq->gov_data); > if (IS_ERR(devfreq)) { > dev_err(dev, "Couldn't initialize GPU devfreq\n"); > ret = PTR_ERR(devfreq); > diff --git a/drivers/gpu/drm/lima/lima_devfreq.h b/drivers/gpu/drm/lima/lima_devfreq.h > index 2d9b3008ce77..b0c7c736e81a 100644 > --- a/drivers/gpu/drm/lima/lima_devfreq.h > +++ b/drivers/gpu/drm/lima/lima_devfreq.h > @@ -4,6 +4,7 @@ > #ifndef __LIMA_DEVFREQ_H__ > #define __LIMA_DEVFREQ_H__ > > +#include > #include > #include > > @@ -18,6 +19,7 @@ struct lima_devfreq { > struct opp_table *clkname_opp_table; > struct opp_table *regulators_opp_table; > struct thermal_cooling_device *cooling; > + struct devfreq_simple_ondemand_data gov_data; > > ktime_t busy_time; > ktime_t idle_time; > It looks good. Reviewed-by: Lukasz Luba Regards, Lukasz