From patchwork Mon Jun 11 12:24:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 138230 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3990845lji; Mon, 11 Jun 2018 05:25:15 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLZ4l/Eaav2pxDV8232IWT/aNr339P/Ihg/a7WnhC3iqqiPzB4CoO8+0LEixRxJrhgaJIlZ X-Received: by 2002:a62:86c3:: with SMTP id x186-v6mr17383976pfd.4.1528719915715; Mon, 11 Jun 2018 05:25:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528719915; cv=none; d=google.com; s=arc-20160816; b=0KY7+q8dRwzjR+s0MZ8x+I0yNocNoWIjoeKNmTj30lmhUIvIqLIXz+wkWA7KwyQoAE mnrgap2xZuveajc+Ky6mIWY3gbrWRrgwwsInMRmBvTpYHMXdLLN15TQOH9k49ue+Y6Zm kxvl9r8fOl56zSgj+8Llm8o3kQyqyjbcZychk70ip9Q1mSfy9LEtfi2V8TYpQ9fff85A iI1wKXq9dCbc2JXQ0NpGbnESabu9eBPi4b1VwnlIpGwsPT0gi66ma7onv1q2mMhHvsWI G+JxBQt+K8A6fvLpB0+ADydP3xpAOFrSCppbn4tW3PezOq8CEMAaeG1LscMwPq9Zc5Qc KVrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=RNb+2C4KfiqsZ/QKrwJO+fD1YYEI60dVdhv5fj3FH7Q=; b=LvVhmXWr6Ro/Z/gy2g/M48kihbfCUusIfqnmJrVNWNZt81XppMQwHqPqlq27yK948Q /28t4fMawnIZunFwk1C6pce48aIZc/a5YF1NYE3w+LRFR3GHnoG8ryXrl66NEikO/brX GzwCowstxwPBuSGLtuCJm3OYywuqJO2Ufc/ZDzcbQHuu0nPmPqyykUMC0ml3LjrDP3x7 gsJ3t69RCyPjnzYQhXkMwcuJ4GZzdovMc9aSrWKkbATWsGYCl77/Lx0mpnFWll3IxqH4 kG672ebcwAVXCIGoOT/t+BbD28q8sGYGvXDPnXjj0tVKWCt7TffH1AEZwvAceVvPRjGh zp4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=U5elwYAn; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y15-v6si14596657pgv.452.2018.06.11.05.25.15; Mon, 11 Jun 2018 05:25:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=U5elwYAn; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932913AbeFKMZO (ORCPT + 3 others); Mon, 11 Jun 2018 08:25:14 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:41773 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932910AbeFKMZO (ORCPT ); Mon, 11 Jun 2018 08:25:14 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180611122512euoutp017681f4f49ec27af3e48603ec43e7fc8d~3Gqkpn4Rd0601206012euoutp01Z; Mon, 11 Jun 2018 12:25:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180611122512euoutp017681f4f49ec27af3e48603ec43e7fc8d~3Gqkpn4Rd0601206012euoutp01Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1528719912; bh=0D7xSowVUQJJd3aZN4x/nzTF51xFDT8uJOBd/tgBBsA=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=U5elwYAnJ1kwTNZhrIw0KPosJyXro6DiHLo9AL/3/CxnoiiZDinvlEhg9Au32uqo3 8kJpE5XFfYNg7wmK4D6RVewJO+agrCFptibW/l6IsXVjlnICU9l2wEnNhzfpJEJHH0 uhnxukdT/OQ6pUw58mNKsZrLUKGdGsrMofSFXvyw= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180611122511eucas1p1b46b6ed5804678afaef76e6ecd043a9e~3Gqj8eoMa0826408264eucas1p1_; Mon, 11 Jun 2018 12:25:11 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id EF.0E.17380.72A6E1B5; Mon, 11 Jun 2018 13:25:11 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180611122510eucas1p113bca5fb6c23a5e6a3357dc1efb362e2~3GqjK6VTb3174631746eucas1p16; Mon, 11 Jun 2018 12:25:10 +0000 (GMT) X-AuditID: cbfec7f4-6f9ff700000043e4-eb-5b1e6a2710f4 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 30.64.04178.62A6E1B5; Mon, 11 Jun 2018 13:25:10 +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 <0PA500JG3RTSPN30@eusync1.samsung.com>; Mon, 11 Jun 2018 13:25:10 +0100 (BST) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Inki Dae , Seung-Woo Kim , Andrzej Hajda , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski Subject: [PATCH 2/3] drm/exynos: Suspend/resume display pipeline as early/late as possible Date: Mon, 11 Jun 2018 14:24:59 +0200 Message-id: <20180611122500.11587-3-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20180611122500.11587-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrJIsWRmVeSWpSXmKPExsWy7djPc7rqWXLRBp+XClvcWneO1WLjjPWs Fle+vmezmHR/AovF+fMb2C1mnN/HZLH2yF0ga/JLNgcOj02rOtk87ncfZ/Lo27KK0ePzJrkA ligum5TUnMyy1CJ9uwSujAdLVjMXLBeqePW+h7WBcRN/FyMHh4SAicSHjT5djFwcQgIrGCVm X+hjhXA+M0p8f3WPqYuRE6zoz8MvLBCJZYwSb6/NY4dwGpgkJq7pZASpYhMwlOh628UGYosI uEk0HZ4JNooZrKhlATvIPmGBGIkFv1NBalgEVCWetU4C28ArYCuxe8ccdoht8hKrNxxgBinn FLCT2NUnBDJGQqCRTWLRg+PMEDUuEltmTGeDsIUlXh3fAtUrI9HZcZAJoqGZUaJ9xix2CKeH UWLrnB1QHdYSh49fZAWxmQX4JCZtm84MCQxeiY42IYgSD4nfC1dBvTwR6OX9+xgnMEouYGRY xSieWlqcm55abJSXWq5XnJhbXJqXrpecn7uJERiBp/8d/7KDcdefpEOMAhyMSjy8Cumy0UKs iWXFlbmHGCU4mJVEeL0U5KKFeFMSK6tSi/Lji0pzUosPMUpzsCiJ88Zp1EUJCaQnlqRmp6YW pBbBZJk4OKUaGOPk3yl5vF6jzd0cJjfNL3PDtd7uh18K/hQH1MlMumL3JfxQ1WR/88vzJNwV js3ruG0oxbd/Ubd5B4vgg7nP7/u7H7378fG3OVkhduEq6lGs/CvLXO7+3H2h57ZNn92rX4EP Y9UU5+f1dr7qyhWN4bnf/t5vw6SGwIbY+bK/lS/8M2FYsvJ1gxJLcUaioRZzUXEiAEiBxGC8 AgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpnluLIzCtJLcpLzFFi42I5/e/4ZV21LLlog3+/NC1urTvHarFxxnpW iytf37NZTLo/gcXi/PkN7BYzzu9jslh75C6QNfklmwOHx6ZVnWwe97uPM3n0bVnF6PF5k1wA SxSXTUpqTmZZapG+XQJXxoMlq5kLlgtVvHrfw9rAuIm/i5GTQ0LAROLPwy8sXYxcHEICSxgl bvS3MEE4TUwSq3b9ZwOpYhMwlOh62wVmiwi4STQdnskKUsQMUnSlbSc7SEJYIEZi0eM9zCA2 i4CqxLPWSUwgNq+ArcTuHXPYIdbJS6zecACohoODU8BOYlefEEhYCKhky4rJ7BMYeRYwMqxi FEktLc5Nzy021CtOzC0uzUvXS87P3cQIDJ5tx35u3sF4aWPwIUYBDkYlHl6FdNloIdbEsuLK 3EOMEhzMSiK8Xgpy0UK8KYmVValF+fFFpTmpxYcYpTlYlMR5zxtURgkJpCeWpGanphakFsFk mTg4pRoYjWzunVB0sX4YkN70QUXIOCDpzZyFn+XuVmi0sV1XVJy5YmGLT1188r1li6e/sLBs yl38wvT91rSbchfcpjIHFuxT1PL227JplceEv0HzZ17tWX3r2fs5z2tm37+btCzpw8tPZ2Jv GLl2duv7XV++c9aUi03b1ohUC4S+8Z1tMp33mkr46/USu5RYijMSDbWYi4oTAddJDqsaAgAA X-CMS-MailID: 20180611122510eucas1p113bca5fb6c23a5e6a3357dc1efb362e2 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180611122510eucas1p113bca5fb6c23a5e6a3357dc1efb362e2 References: <20180611122500.11587-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org In the current code, exynos_drm_suspend() function is called after all real devices (CRTCs, Encoders, etc) are suspended, because Exynos DRM virtual platform device is created as last device in the system (as a part of DRM registration). None of the devices for real hardware modules has its own system suspend/resume callbacks, so it doesn't change any order of the executed code, but it has a side-effect: runtime PM callbacks for real devices are not executed, because those devices are considered by PM core as already suspended. This might cause issues on boards with complex pipelines, where something depends on the runtime PM state of the given device. To ensure that exynos_drm_suspend() is called before any suspend callback from the real devices, assign it to .prepare callback. Same for exynos_drm_resume(), using .complete callback ensures that all real devices have been resumed when calling it. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) -- 2.17.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index c0b4a03ae1b6..d98bc15d490d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -147,7 +147,6 @@ static struct drm_driver exynos_drm_driver = { .minor = DRIVER_MINOR, }; -#ifdef CONFIG_PM_SLEEP static int exynos_drm_suspend(struct device *dev) { struct drm_device *drm_dev = dev_get_drvdata(dev); @@ -170,7 +169,7 @@ static int exynos_drm_suspend(struct device *dev) return 0; } -static int exynos_drm_resume(struct device *dev) +static void exynos_drm_resume(struct device *dev) { struct drm_device *drm_dev = dev_get_drvdata(dev); struct exynos_drm_private *private; @@ -182,13 +181,11 @@ static int exynos_drm_resume(struct device *dev) drm_atomic_helper_resume(drm_dev, private->suspend_state); exynos_drm_fbdev_resume(drm_dev); drm_kms_helper_poll_enable(drm_dev); - - return 0; } -#endif static const struct dev_pm_ops exynos_drm_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(exynos_drm_suspend, exynos_drm_resume) + .prepare = exynos_drm_suspend, + .complete = exynos_drm_resume, }; /* forward declaration */