Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3552264pxb; Mon, 25 Jan 2021 21:06:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzC4sluB+JiQ8RawyjbD1G8uX+64QAxpQGm2iMJLIzmTLzN7z3eVuzWdYSrYE3LPA1CLsfX X-Received: by 2002:a05:6402:13c8:: with SMTP id a8mr3112046edx.191.1611637608879; Mon, 25 Jan 2021 21:06:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611637608; cv=none; d=google.com; s=arc-20160816; b=LlRfcSE784r6Ij/MXSJzcu9Esjkqebwc0xlXb9lOh+Co1MVrIF2kmVYYWicsu6XyS2 aGvLoQL/v5O4+cPqN5KBxJDgj/CY6JIchRlUL0YnWftGCrkjlhF9TQCDmVnDJ/dxYSRW 4AWbFKpPUwtYxU5gZS0K4IJ5eAK3f1Bn2yR8iD7fK1cG4SqZmikhSIMczwuEaPvqK3Ai V9pLFuVTlkirhBfuV1q2Zn/fhkPYyU/DLdx7Jwd0RAdVqCF16MtMKYUWPapdqLvzAq+3 L0FmarCa7MI2TJQwpXY59EYRLaPCzykKAiuKeZBA5mW05cETJU94S3Z9vpky6kPEOAfk kR0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=Y7QSAI4exnMwTSIl2D/guBzjw3QSq7D2XfoHWDkim0M=; b=cuZWYKbvzwHUuMgm6VULeY+2JVT/GEiN4TNTMQ/cO0io5BrEJKIDY0iO4mgh8HJciB YIiN6kgHXoGDuMcXvNLKUmE+O2d/gpoY0YPBKopDEw6d9jZBniZNvMqWVVv0/DB1C3Zp ncgsJTBi+h3gqZRVTf5uzWGEmfGINPomLO/t8d+QGLw8bNzz8d306KP354iumf8m6uYJ uqD7d6fhbjc5fxCOLp2fUFAcWvH53ZJb1lbTxIYqUK029F9lOstxfHVKAU+hmc5Mfh5d 5TIwgwiVLXXLtNafRpYHCou/iZV1RCohb4VXEM0go13R1hs3syQa+L2EVNXv4Grh6BXc DHDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kz5X1h6D; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p26si6788538eji.9.2021.01.25.21.06.25; Mon, 25 Jan 2021 21:06:48 -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=@gmail.com header.s=20161025 header.b=kz5X1h6D; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729551AbhAZE4Z (ORCPT + 99 others); Mon, 25 Jan 2021 23:56:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726327AbhAYJUO (ORCPT ); Mon, 25 Jan 2021 04:20:14 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C118C061786 for ; Mon, 25 Jan 2021 00:18:10 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id a9so11257260wrt.5 for ; Mon, 25 Jan 2021 00:18:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Y7QSAI4exnMwTSIl2D/guBzjw3QSq7D2XfoHWDkim0M=; b=kz5X1h6DqSqeV6eliWhiDPYDhC/5Vb+VoxkBn2I420H7P49skPLRYqgfpy4f78qbr/ c5yj6Fk29J7lf+Fjnowbz8gNGIkVBkt8/Wuery3OFtJI2sfmIr94lMufUrC1aCG999U7 UOgZNCFrpeMAFMOF6GY93vEi8n7J0GPb+MQ8ADVe6SKgJzhydqAA1WaTIq5UXXR1v0pq EZmu2x/+3cCej4t0CYQoyblwOT1n76QH2ggxx8SM6LphJ3e6hObPgfl2pkVo/zBGynon kovYuruRtDQ5tEugsYLd1Bo1gxPQId/F2EuJMOCc0m4kt5ZtWPhpjRmbkdfS6JvVvMfq 9yAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Y7QSAI4exnMwTSIl2D/guBzjw3QSq7D2XfoHWDkim0M=; b=rvhODeid46G21O0bGTRrU6Mqk34ie6uRr2HvByFnbwiTEG0Kt43hXUqKTsirZhoH+c SAIEpy4BJm0L35J4Zh3Zo36t538PazSFt7Gyy3IB0JoWCZELgzeLqaZ0f+pfXz9AjUwb cA6Ih/IK+FnM0DmAQdu4lCIw0GKrQxRVuaFBlvtjoZk67NOLsf4g8kJJ0dKTP7o1qbrc GeFofQ5SQSRWXNS3HPttAmLpEM5pePL57TTJ83pQBu9RG2Fnf5M75zUb1YmIiWQ13ssX 8J7WrHJfRMuZgpz2gi1nFw/m+MAC0TlmeuBhdh9gQYkdSxdAKNQ2OK/G3ceZRkon8vpJ UD6g== X-Gm-Message-State: AOAM533MwxSy0ZKcPb9tjDqvzMxIhR8/uSefAPg6X/JEv27uR/ICdSKv UdyuKJughdlk0WoNvNeVYUM= X-Received: by 2002:a5d:5913:: with SMTP id v19mr10731wrd.207.1611562689269; Mon, 25 Jan 2021 00:18:09 -0800 (PST) Received: from localhost.localdomain ([87.200.95.144]) by smtp.gmail.com with ESMTPSA id m12sm20286798wmc.10.2021.01.25.00.18.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jan 2021 00:18:08 -0800 (PST) From: Christian Hewitt To: Qiang Yu , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Christian Hewitt , Lukasz Luba , Steven Price Subject: [PATCH] drm/lima: add governor data with pre-defined thresholds Date: Mon, 25 Jan 2021 08:18:04 +0000 Message-Id: <20210125081804.13016-1-christianshewitt@gmail.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- I have been using Kodi as my test application. If you scroll in library views with hundreds of list items and the panfrost values the slow GPU ramp up is quite noticeable and the GUI feels sluggish. As everything lima runs on is inherently slower than panfrost using devices I believe it's better to ramp up to max freq quicker. 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 = 20; + 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; -- 2.17.1