From patchwork Thu Nov 9 07:37:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163268 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp274582vqs; Wed, 8 Nov 2023 23:39:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IFkTZLG/58TJruuK+7vI5CgfsFgfsMbJnOX4JggsGltv52PujHrjNYgnTcLD3Dpo//nRHhR X-Received: by 2002:a17:90b:1e46:b0:274:755b:63b8 with SMTP id pi6-20020a17090b1e4600b00274755b63b8mr885472pjb.43.1699515565234; Wed, 08 Nov 2023 23:39:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699515565; cv=none; d=google.com; s=arc-20160816; b=uGac8eTQ86nZ9CiJ+4AsKr9ieHNYT3IABt5jzsB58r4YWwwqO3t9/do2kKTVSvn8y5 2+VnXE/pGp+o3bM3a+wx6J/UlLcmXHgi3SWi4UTs3zgxaiPppCYMUptCm+LM1si/K+E1 Y72WjueKfaYnxfWAsf4iZrsYwWmaiyUlTe1oMTPXMSA0VnoSCM/gIbTF66QQw5l3xRSj NmIVfBBNxPBEtlJLVbv0AWnOYdVIaPf/kbt6uR7H0ArHJnxf+5n8nuLCxQj8os13bb7I vLqTq5CXPiMo1CGH0x8z6VdaPn/uPmceOrjeATUb+23JaN7gEnStyAqGehsoDIBjWFvA 7eLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=nhmBTojk3HIddif6WX3S3K8Ro5F5Rhk2ZogB9yM9GEw=; fh=ar9Kuonru+6un71Fc3+cR+miWSr4t5vPPiuWh6IeKvI=; b=0clzx3GmvMduWq6TRQ8Ph+fHtR4NYxkn71LtPMLesYT+d8ps9+qaw/VQwZKbUDY81f 1zFz7tECaFkBtrR8XpWF8PmqpSvn252TepllJPpgh4BAyhEHmVejviuizrsjXkw6wJu6 ER+UnpRWrTvT7RlvfytmFT5foftEnRDstH1EQhE+Zi/WJnVBrKEaYWjjG2Kc2OdID3NB 1mUE68VORNQbkx+yO5EceRNcuP5tom0xVSmgJVWQPnSQn0k5Vu022mFx4oxv7+WN61BM bSPFlUchyb9iujkmgkNNqcrBmSdBo5C+9/RQGeJdn3N5UEOtGS4tt3kAPmuOOHZoNkoc uCKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=sajfIXcH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id o13-20020a17090a744d00b00280feff8f0fsi1060728pjk.127.2023.11.08.23.39.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 23:39:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=sajfIXcH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 21FF08316EF3; Wed, 8 Nov 2023 23:39:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232875AbjKIHix (ORCPT + 32 others); Thu, 9 Nov 2023 02:38:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232613AbjKIHit (ORCPT ); Thu, 9 Nov 2023 02:38:49 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 548C7173E for ; Wed, 8 Nov 2023 23:38:47 -0800 (PST) Received: from [127.0.1.1] (91-158-149-209.elisa-laajakaista.fi [91.158.149.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BA643E0C; Thu, 9 Nov 2023 08:38:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1699515502; bh=xt5MBUgnI/jgAIonK42bagqQqpKSKcbUYBa+PmKHG8E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=sajfIXcHt8KHj1UJYdggbsMVkUc6GHdsfbn+OLXb9IHJBnAWQVnY6PaJLtcpqKlEG 47lGzk9Hc5c4naZLFuOvXLQNqEfUHHeJm+V77Ae2ex8xhUY8BMzyex+sgAEBrAXt1E tkDEo8g7o1jEhD472nfGt8vg9um6lrTQkb0FZdyU= From: Tomi Valkeinen Date: Thu, 09 Nov 2023 09:37:55 +0200 Subject: [PATCH v2 02/11] drm/tidss: Use PM autosuspend MIME-Version: 1.0 Message-Id: <20231109-tidss-probe-v2-2-ac91b5ea35c0@ideasonboard.com> References: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> In-Reply-To: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> To: Aradhya Bhatia , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Francesco Dolcini , Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1731; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=xt5MBUgnI/jgAIonK42bagqQqpKSKcbUYBa+PmKHG8E=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlTIx+fN+ubO5HJG9gxPYBA5D9PTIkfRNffzkxn gQ0MtheLoeJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUyMfgAKCRD6PaqMvJYe 9f5lD/97VxLqRK0F2PM6yui/5XVHYoti9Upp/CtctMV6KxkJ3rdFISUaPcTNRa6PRxwl1PKqZT0 8NO9huwa0ImfdO4dINDszCfjKOzDl1UpnEpW5zfymJWrBd2dy2Bx5OUdG65UxhVzL0MZ7G0/j57 PR0gocj56G/msXDxhTxars+m8ZY5C9LzM6UZftzETmNoGDJgbz1QhTbj3ne6EkUV8ThJmpxFmkU hBctuObo/1j6qYrBBODTfjb9iStzmkvRgh88psTUzHqe+C6jpZ039HGrTYM5iSrhazWXeV3B5ad ndJctMhkjh6e0sRLozWFxDUzdCC4NdpAk05T6+s/A9ZueVBdyPA1BTdGi1h4WL83zlswLNjoG66 lqPLRlmqkr0r2JJho16EHb4kk12ietXWyIh0oadAmDCwZnyk5OZOgkglwArGTV7/To3wL0RRthg tzgUpOxSVjttychgvCunCnfyFeRwM/YTBZEyk7LpNkajGkxT10sDlaX6Hpi6nNPIOHlVXverLM2 9Zfs7sS7FVG/modDQYXZjsBRPbEtW6zOsk9igZFVKscbVEO4V0W/OVMfIwyAChY8YZ2vnYB/FaO GmWAtAJBZ+G3LGjYRktzVuYLRDTd6HazMu5dTIKpv47RJEloY4nsVqzTaJjqEWYFTsFK/9aUOX2 +1NBEbm4t0KWDqg== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 08 Nov 2023 23:39:14 -0800 (PST) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782071233290277009 X-GMAIL-MSGID: 1782071233290277009 Use runtime PM autosuspend feature, with 1s timeout, to avoid unnecessary suspend-resume cycles when, e.g. the userspace temporarily turns off the crtcs when configuring the outputs. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/tidss/tidss_drv.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tidss/tidss_drv.c b/drivers/gpu/drm/tidss/tidss_drv.c index f403db11b846..f51c87e26e10 100644 --- a/drivers/gpu/drm/tidss/tidss_drv.c +++ b/drivers/gpu/drm/tidss/tidss_drv.c @@ -43,7 +43,9 @@ void tidss_runtime_put(struct tidss_device *tidss) dev_dbg(tidss->dev, "%s\n", __func__); - r = pm_runtime_put_sync(tidss->dev); + pm_runtime_mark_last_busy(tidss->dev); + + r = pm_runtime_put_autosuspend(tidss->dev); WARN_ON(r < 0); } @@ -144,6 +146,9 @@ static int tidss_probe(struct platform_device *pdev) pm_runtime_enable(dev); + pm_runtime_set_autosuspend_delay(dev, 1000); + pm_runtime_use_autosuspend(dev); + #ifndef CONFIG_PM /* If we don't have PM, we need to call resume manually */ dispc_runtime_resume(tidss->dispc); @@ -192,6 +197,7 @@ static int tidss_probe(struct platform_device *pdev) #ifndef CONFIG_PM dispc_runtime_suspend(tidss->dispc); #endif + pm_runtime_dont_use_autosuspend(dev); pm_runtime_disable(dev); return ret; @@ -215,6 +221,7 @@ static void tidss_remove(struct platform_device *pdev) /* If we don't have PM, we need to call suspend manually */ dispc_runtime_suspend(tidss->dispc); #endif + pm_runtime_dont_use_autosuspend(dev); pm_runtime_disable(dev); /* devm allocated dispc goes away with the dev so mark it NULL */