From patchwork Tue Oct 15 03:47:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 3041681 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 34D6EBF924 for ; Tue, 15 Oct 2013 03:51:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 43157201E4 for ; Tue, 15 Oct 2013 03:51:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0C5A520165 for ; Tue, 15 Oct 2013 03:51:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DE4A3E6E9A for ; Mon, 14 Oct 2013 20:51:20 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTP id 2265BE7843 for ; Mon, 14 Oct 2013 20:47:46 -0700 (PDT) Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MUO00HPUYJDNMA0@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Tue, 15 Oct 2013 12:47:44 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.113]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id D5.68.28363.0EABC525; Tue, 15 Oct 2013 12:47:44 +0900 (KST) X-AuditID: cbfee68f-b7fc96d000006ecb-60-525cbae02f43 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 63.6F.05832.0EABC525; Tue, 15 Oct 2013 12:47:44 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.252.75.62]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MUO003V9YJK4V30@mmp1.samsung.com>; Tue, 15 Oct 2013 12:47:44 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH v2] drm/exynos: fimd: clean up pm suspend/resume Date: Tue, 15 Oct 2013 12:47:43 +0900 Message-id: <1381808863-9689-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1381234414-23362-1-git-send-email-inki.dae@samsung.com> References: <1381234414-23362-1-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOLMWRmVeSWpSXmKPExsWyRsSkUPfBrpgggwVnNS16z51ksrjy9T2b xaT7E1gcmD22f3vA6nG/+ziTR9+WVYwBzFFcNimpOZllqUX6dglcGXNf3WIu2CJWcerSYbYG xj6hLkZODgkBE4kl8+8wQthiEhfurWfrYuTiEBJYyijx9d47VpiiyWeWMUMkFjFKrH07iwXC 6WaS+LnoElg7m4CqxMQV99lAbBEBU4mOSUtZQGxmAWWJi/1Lgbo5OIQFHCSOvo8HCbMAlbfs XwtWwivgLPF30w52kBIJAQWJOZNsQMKcAq4S206eYgexhQRcJDq2TIG65zObxMOlAhBjBCS+ TT7EAtEqK7HpADNEiaTEwRU3WCYwCi9gZFjFKJpakFxQnJReZKxXnJhbXJqXrpecn7uJERio p/8969/BePeA9SHGZKBxE5mlRJPzgYGeVxJvaGxmZGFqYmpsZG5pRpqwkjivWot1oJBAemJJ anZqakFqUXxRaU5q8SFGJg5OqQbGzKqnZ9t3Wx89JFKvlqRefkCVLfjCHTEFpnvaN1YGH3qn 1dtxV4bvSDXLHN9Za766a/5c3pvYVRm+d715/981t6f+F3ScsTflh5rvw3aNTdcDYupnzd/n Je763ONcRJKB+PI1U1k7b3tOvnJnoWQzYyvjgWmWbDz9EQEmTO383wPjXvz47t+uxFKckWio xVxUnAgAf8XvMmoCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrKIsWRmVeSWpSXmKPExsVy+t9jAd0Hu2KCDDp+KFn0njvJZHHl63s2 i0n3J7A4MHts//aA1eN+93Emj74tqxgDmKMaGG0yUhNTUosUUvOS81My89JtlbyD453jTc0M DHUNLS3MlRTyEnNTbZVcfAJ03TJzgFYpKZQl5pQChQISi4uV9O0wTQgNcdO1gGmM0PUNCYLr MTJAAwlrGDPmvrrFXLBFrOLUpcNsDYx9Ql2MnBwSAiYSk88sY4awxSQu3FvP1sXIxSEksIhR Yu3bWSwQTjeTxM9FlxhBqtgEVCUmrrjPBmKLCJhKdExaygJiMwsoS1zsXwo0iYNDWMBB4uj7 eJAwC1B5y/61YCW8As4SfzftYAcpkRBQkJgzyQYkzCngKrHt5Cl2EFtIwEWiY8sU1gmMvAsY GVYxiqYWJBcUJ6XnGukVJ+YWl+al6yXn525iBEfCM+kdjKsaLA4xCnAwKvHw/uCNCRJiTSwr rsw9xCjBwawkwptTDRTiTUmsrEotyo8vKs1JLT7EmAx01ERmKdHkfGCU5pXEGxqbmBlZGpkb WhgZm5MmrCTOe7DVOlBIID2xJDU7NbUgtQhmCxMHp1QDo7sza9f9cwHbH85eWD6TU/X3HXNp 95cdrPuPLYw6ZmalEl7OtLLLVzqSLSzW95X54h1zzBUP+iy+y5CwNecvj4d9zk2una0vzkg9 9lyzcQGLmbGnutqUCw1SmS7Xrf1iNIWWhrz+8NRnzpLL018Ld0hkPureVlB3NeuOxuaen/Xm ExsMYu9bKrEUZyQaajEXFScCADCd67nIAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch removes unnecessary runtime pm related function calls from fimd_suspend and fimd_resume functions. Changelog v2: - use UNIVERSAL_DEV_PM_OPS macro instead. Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 59 ++++++------------------------ 1 file changed, 12 insertions(+), 47 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 5d5b97d..35f2c97 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -1003,66 +1003,31 @@ static int fimd_suspend(struct device *dev) { struct fimd_context *ctx = get_fimd_context(dev); - /* - * do not use pm_runtime_suspend(). if pm_runtime_suspend() is - * called here, an error would be returned by that interface - * because the usage_count of pm runtime is more than 1. - */ - if (!pm_runtime_suspended(dev)) - return fimd_activate(ctx, false); - - return 0; + return fimd_activate(ctx, false); } static int fimd_resume(struct device *dev) { struct fimd_context *ctx = get_fimd_context(dev); + int ret; + + ret = fimd_activate(ctx, true); + if (ret < 0) + return ret; /* - * if entered to sleep when lcd panel was on, the usage_count - * of pm runtime would still be 1 so in this case, fimd driver - * should be on directly not drawing on pm runtime interface. + * in case of dpms on(standby), fimd_apply function will + * be called by encoder's dpms callback to update fimd's + * registers but in case of sleep wakeup, it's not. + * so fimd_apply function should be called at here. */ - if (!pm_runtime_suspended(dev)) { - int ret; - - ret = fimd_activate(ctx, true); - if (ret < 0) - return ret; - - /* - * in case of dpms on(standby), fimd_apply function will - * be called by encoder's dpms callback to update fimd's - * registers but in case of sleep wakeup, it's not. - * so fimd_apply function should be called at here. - */ - fimd_apply(dev); - } + fimd_apply(dev); return 0; } #endif -#ifdef CONFIG_PM_RUNTIME -static int fimd_runtime_suspend(struct device *dev) -{ - struct fimd_context *ctx = get_fimd_context(dev); - - return fimd_activate(ctx, false); -} - -static int fimd_runtime_resume(struct device *dev) -{ - struct fimd_context *ctx = get_fimd_context(dev); - - return fimd_activate(ctx, true); -} -#endif - -static const struct dev_pm_ops fimd_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(fimd_suspend, fimd_resume) - SET_RUNTIME_PM_OPS(fimd_runtime_suspend, fimd_runtime_resume, NULL) -}; +UNIVERSAL_DEV_PM_OPS(fimd_pm_ops, fimd_suspend, fimd_resume, NULL); struct platform_driver fimd_driver = { .probe = fimd_probe,