From patchwork Wed Aug 31 12:55:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 75089 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp321501qga; Wed, 31 Aug 2016 05:56:24 -0700 (PDT) X-Received: by 10.98.88.131 with SMTP id m125mr16516456pfb.63.1472648184139; Wed, 31 Aug 2016 05:56:24 -0700 (PDT) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id v7si50829925pal.10.2016.08.31.05.56.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Aug 2016 05:56:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 494CC6E748; Wed, 31 Aug 2016 12:56:20 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.w1.samsung.com (mailout4.w1.samsung.com [210.118.77.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 339106E1C4 for ; Wed, 31 Aug 2016 12:56:16 +0000 (UTC) Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OCR002IYYLO5E00@mailout4.w1.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 31 Aug 2016 13:56:12 +0100 (BST) X-AuditID: cbfec7f4-f79cb6d000001359-33-57c6d3ec9474 Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 08.00.04953.CE3D6C75; Wed, 31 Aug 2016 13:56:12 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OCR00GIKYLJHR40@eusync1.samsung.com>; Wed, 31 Aug 2016 13:56:12 +0100 (BST) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 1/6] drm/exynos: fimc: fix system and runtime pm integration Date: Wed, 31 Aug 2016 14:55:54 +0200 Message-id: <1472648159-9814-2-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1472648159-9814-1-git-send-email-m.szyprowski@samsung.com> References: <1472648159-9814-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHLMWRmVeSWpSXmKPExsVy+t/xy7pvLh8LNzjQJWJxa905VouNM9az Wlz5+p7NYtL9CSwWL+5dZLF4/cLQomfDVlaLGef3MVmsPXKX3eLwm3Ygd/JLNgduj/vdx5k8 +rasYvT4vEkugDmKyyYlNSezLLVI3y6BK2NRx1nWgm7eiu/vm5kbGHu5uxg5OSQETCTm33zG CmGLSVy4t56ti5GLQ0hgKaPE1vUnmCCcJiaJjfcOMoNUsQkYSnS97WIDsUUEUiW6164HK2IW eMwk8WbVfHaQhLCAj8SZZW/BGlgEVCWWbb0IZvMKuEtcurqXBWKdnMTJY5PBVnMKeEisnvUW zBYCqln78DzrBEbeBYwMqxhFU0uTC4qT0nMN9YoTc4tL89L1kvNzNzFCQu3LDsbFx6wOMQpw MCrx8GbMOBouxJpYVlyZe4hRgoNZSYT33KVj4UK8KYmVValF+fFFpTmpxYcYpTlYlMR55+56 HyIkkJ5YkpqdmlqQWgSTZeLglGpgnLJ3zdITK+dO9zQRSgv9eN1Afl30QoPH3od3zY5fuFXo ZevmafseyD/OaHFZ7Kobo/Gtu/yflsTmy9vyNQvbhKR6rsnz97iunPpwktDcX2HxFx+sDnfj XWCWknF+7tm1XNM0n06+kCZnuvj6tCvxG/98XMOhOSP/8SaD68bT0jbNUep7dUnG1VmJpTgj 0VCLuag4EQB9Fd6MMQIAAA== Cc: Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Seung-Woo Kim , Sylwester Nawrocki , Marek Szyprowski X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use generic helpers instead of open-coding usage of runtime pm for system sleep pm, which was potentially broken for some corner cases. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 0525c56145db..147ef0d298cb 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -1753,32 +1753,6 @@ static int fimc_clk_ctrl(struct fimc_context *ctx, bool enable) return 0; } -#ifdef CONFIG_PM_SLEEP -static int fimc_suspend(struct device *dev) -{ - struct fimc_context *ctx = get_fimc_context(dev); - - DRM_DEBUG_KMS("id[%d]\n", ctx->id); - - if (pm_runtime_suspended(dev)) - return 0; - - return fimc_clk_ctrl(ctx, false); -} - -static int fimc_resume(struct device *dev) -{ - struct fimc_context *ctx = get_fimc_context(dev); - - DRM_DEBUG_KMS("id[%d]\n", ctx->id); - - if (!pm_runtime_suspended(dev)) - return fimc_clk_ctrl(ctx, true); - - return 0; -} -#endif - static int fimc_runtime_suspend(struct device *dev) { struct fimc_context *ctx = get_fimc_context(dev); @@ -1799,7 +1773,8 @@ static int fimc_runtime_resume(struct device *dev) #endif static const struct dev_pm_ops fimc_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(fimc_suspend, fimc_resume) + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume) SET_RUNTIME_PM_OPS(fimc_runtime_suspend, fimc_runtime_resume, NULL) };