Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp865139pxb; Thu, 28 Jan 2021 02:06:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJwIMT50BWwE4kWemkR1mIvad2JedDMiRzixpUUdr97edRjm9ps49w/x9iAm2aSX/LvGfAQj X-Received: by 2002:aa7:c9c9:: with SMTP id i9mr13163677edt.160.1611828415576; Thu, 28 Jan 2021 02:06:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611828415; cv=none; d=google.com; s=arc-20160816; b=a0i095Z1o5Ey9Ss4W6dSleWtOewQQ72I8jS/ti42GfJEKk3jqTbo4Vm0K8vYznwUWv QACTYk8ySSd9PriYxCVZPt6jROcCOh2cftypyDRVI3F1AR1hpukw6Y1UH4BaxHc8/TDb xSLGAEeLEbVvLJQZvRpbcM6WwBvmSQJxStT8Xgv/BSA3uVht+Ts3jz5l6O32CvsYPA1b Poz/f6ycXAykCwKvRVKCiFkeT+3bFVzapu29PTsltSxXC+YnOI8dDW3CmeQZzSggT/VH 45w8G8Ds1jujsVQHMcjtNhz374bcvZXNo08PQCOTHNTBimAY8LlwN4Kablzj7BIVwyEF y3RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=pHnjtrVOut4HFLr+p1pWhauIEj1k451iDC3yfJJeBgg=; b=Bx9VSa+ccfu6DByKrxdRU5V/MkbfWF5fURtgTHF3wrAbb5G0WJ3ByVEva1lWuPHpaC p2gaNeRgG/5ml1XvLJZWYI3OZ4dVY9NaOao5sJ1ZpSm67wz5l9tbm0jIwnksp+qCMwfk tg+MHHf/R4p0bxL3vPOV0RD8CEl3/lIn/honVSiMm+lE+Mr2YGdkMJiMcwIn2o1bnyIl N1HkoQAHlOa6XZoHTlsvia/3Q+bHVKpqPX5ZTBYNosr9pOguBAmffOHSwFves86MSmpB zq7B50K50IbW+da7EvKw/bwJTtf942915pCpVmsRV3NobpFw1X9c/1hfMd3Nzvr3aKnm iLqA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q21si2474874edt.445.2021.01.28.02.06.31; Thu, 28 Jan 2021 02:06:55 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231848AbhA1KFm (ORCPT + 99 others); Thu, 28 Jan 2021 05:05:42 -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