From patchwork Fri Sep 29 13:24:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Jakobi X-Patchwork-Id: 9978067 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2C7F56034B for ; Fri, 29 Sep 2017 13:24:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17BAD20416 for ; Fri, 29 Sep 2017 13:24:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0BCC5209CE; Fri, 29 Sep 2017 13:24:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BCD520416 for ; Fri, 29 Sep 2017 13:24:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751224AbdI2NYJ (ORCPT ); Fri, 29 Sep 2017 09:24:09 -0400 Received: from smtp.math.uni-bielefeld.de ([129.70.45.10]:37408 "EHLO smtp.math.uni-bielefeld.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750877AbdI2NYJ (ORCPT ); Fri, 29 Sep 2017 09:24:09 -0400 Received: from chidori.dhcp.uni-bielefeld.de (dhcp41-231.math.uni-bielefeld.de [129.70.41.231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by smtp.math.uni-bielefeld.de (Postfix) with ESMTPSA id DEB465F9E5; Fri, 29 Sep 2017 15:24:06 +0200 (CEST) From: Tobias Jakobi To: linux-samsung-soc@vger.kernel.org Cc: dri-devel@lists.freedesktop.org, m.szyprowski@samsung.com, Tobias Jakobi Subject: [PATCH] drm/exynos: fimc: enable autosuspend for runtime PM Date: Fri, 29 Sep 2017 15:24:01 +0200 Message-Id: <20170929132401.3417-1-tjakobi@math.uni-bielefeld.de> X-Mailer: git-send-email 2.13.5 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Tobias Jakobi --- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 1c48c57381f1..bffb4b513453 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -1009,7 +1009,8 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id) struct exynos_drm_ipp_task *task = ctx->task; ctx->task = NULL; - pm_runtime_put(ctx->dev); + pm_runtime_mark_last_busy(ctx->dev); + pm_runtime_put_autosuspend(ctx->dev); exynos_drm_ipp_task_done(task, 0); } @@ -1158,7 +1159,8 @@ static void fimc_abort(struct exynos_drm_ipp *ipp, struct exynos_drm_ipp_task *task = ctx->task; ctx->task = NULL; - pm_runtime_put(ctx->dev); + pm_runtime_mark_last_busy(ctx->dev); + pm_runtime_put_autosuspend(ctx->dev); exynos_drm_ipp_task_done(task, -EIO); } } @@ -1329,6 +1331,8 @@ static int fimc_probe(struct platform_device *pdev) spin_lock_init(&ctx->lock); platform_set_drvdata(pdev, ctx); + pm_runtime_use_autosuspend(dev); + pm_runtime_set_autosuspend_delay(dev, 2000); pm_runtime_enable(dev); ret = component_add(dev, &fimc_component_ops); @@ -1340,6 +1344,7 @@ static int fimc_probe(struct platform_device *pdev) return 0; err_pm_dis: + pm_runtime_dont_use_autosuspend(dev); pm_runtime_disable(dev); fimc_put_clocks(ctx); @@ -1352,6 +1357,7 @@ static int fimc_remove(struct platform_device *pdev) struct fimc_context *ctx = get_fimc_context(dev); component_del(dev, &fimc_component_ops); + pm_runtime_dont_use_autosuspend(dev); pm_runtime_disable(dev); fimc_put_clocks(ctx);