From patchwork Fri Aug 19 09:36:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 9289901 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 2D78D600CB for ; Fri, 19 Aug 2016 09:37:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DEF429337 for ; Fri, 19 Aug 2016 09:37:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 124D62937E; Fri, 19 Aug 2016 09:37:30 +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=-4.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5652929337 for ; Fri, 19 Aug 2016 09:37:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3527A6EBCB; Fri, 19 Aug 2016 09:37:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0063.outbound.protection.outlook.com [104.47.34.63]) by gabe.freedesktop.org (Postfix) with ESMTPS id 399476EBCB for ; Fri, 19 Aug 2016 09:37:27 +0000 (UTC) Received: from DM2PR03CA0047.namprd03.prod.outlook.com (10.141.96.46) by BN6PR03MB2705.namprd03.prod.outlook.com (10.173.144.12) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.549.15; Fri, 19 Aug 2016 09:37:24 +0000 Received: from BL2FFO11FD033.protection.gbl (2a01:111:f400:7c09::175) by DM2PR03CA0047.outlook.office365.com (2a01:111:e400:2428::46) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.587.9 via Frontend Transport; Fri, 19 Aug 2016 09:37:24 +0000 Authentication-Results: spf=softfail (sender IP is 192.88.168.50) smtp.mailfrom=gmail.com; pengutronix.de; dkim=none (message not signed) header.d=none; pengutronix.de; dmarc=fail action=none header.from=gmail.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning gmail.com discourages use of 192.88.168.50 as permitted sender) Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD033.mail.protection.outlook.com (10.173.161.129) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.577.8 via Frontend Transport; Fri, 19 Aug 2016 09:37:24 +0000 Received: from victor.ap.freescale.net (victor.ap.freescale.net [10.192.241.62]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u7J9bIS4021936; Fri, 19 Aug 2016 02:37:22 -0700 From: Liu Ying To: Subject: [PATCH v3 1/3] drm/atomic-helper: Add atomic_disable CRTC helper callback Date: Fri, 19 Aug 2016 17:36:57 +0800 Message-ID: <1471599419-29009-2-git-send-email-gnuiyl@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1471599419-29009-1-git-send-email-gnuiyl@gmail.com> References: <1471599419-29009-1-git-send-email-gnuiyl@gmail.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131160730451215990; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(199003)(189002)(50466002)(50226002)(81166006)(50986999)(229853001)(81156014)(92566002)(76176999)(47776003)(86362001)(105596002)(11100500001)(48376002)(55446002)(104016004)(73392002)(575784001)(8936002)(76482005)(2351001)(6260500002)(110136002)(77096005)(106466001)(19580405001)(2950100001)(73972006)(2906002)(81442002)(87936001)(97736004)(586003)(33646002)(4326007)(19580395003)(83322999)(68736007)(626004)(305945005)(61266001)(8676002)(5003940100001)(356003)(36756003)(7846002)(82202001)(189998001)(87572001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2705; H:tx30smr01.am.freescale.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD033; 1:5uiP7coIUxXzFQYQAZ4YhCpq0gOIhM6tAYELLCUpzu7wxGd5IPIW1UYd4z99xYIbnMtMvwdtOEkItP6Luo/jwu+MXMsh5ueRETHdjzWLnRdnB+q/BPRnPensmdTVAuk16X1OLTOywMx+WpNpeAzVacAtcpVpr6KKHWdXZn6dQPwvZwtcwOmpauOJF09QeeT17u0B2aIHGyKV8TsUEbni7Zg43a8laZshtHoJR8lFkrKYBEkknUcsBKbGMzYWxTrz/+4Bg/0aeF2nd0AMwHC3xcj1WYU3NWIO4nCHiincriNkiOtYUXLPi/5fONBaUIBerf4MT57lao+xhsr78+ppa6kbCd4G27LEBXb3t67+Wg/7SCFNDnf5mAFZN3Nwr/O93a+g4gcSjGZmsPJ3XrtEMtiqcAtGO3j2+bfuTJAKxhDf8M1LofEAlzeI/2/wOCq69m/pBLHhiADPUTPE2gDI2+yaYWj+xwVZmEoNZUsTtjqcUWea1mp/tJa115Vmxgy3zGggtF5JK/McJCdMfQpVf4KhB7ey3NZU9fRwdjOAL30htQ1BMGwkQwgVO/o8QJPQa+vTC2K26e1Ufz3d6zqrxQ== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 7e6d51cb-a29a-4533-2516-08d3c8146d7b X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2705; 2:Zl1M6iSWiLb6D+uuqiG1CJKQ7DqXF4YYpZC+3vomPYMguz7b5Ps4tg1A1puctFzwjjh7Qpilg4BEbNZNtZC1R7HYkpU34gkstA1be3KshEAr5fn051X8AJkd/FwsgvMyp0ZLfadotAQhQnKiXr4QIIdK1VKnYkxydNi9qyu7wk1fT++ZNDiY2J77TyMyQQnh; 3:jh6gnCNKYB4Gw4rs88BnItGjCL6I+9xCUwHPXM3bBj9JfCxOcthMBvnKSbhCeFl7CY45hMhKHYBJa9qCVtCleObXYiWrm0Ol/B9mB+BW4VhsP37/nLAp7qRcvmaZZzz3iLGmfh2FkqWzBcTn7HkLxqloPhiYvtKM+QyqgfVt3coZ5ix4IIKfu7lETOg4n5EmR9OwsW4/6pIYnGpppngV0WrVTq33pPPDVL9Dqi7gvTA=; 25:yYFX+ZhVdDXcerI43lHSIjVzdwItAD+MiZDQOuuuahP0S2FJEowdqNhhHNZJygJ1nMuqy2UodSgzOb6j+FgM6Cq/ueccjoOLJYkoG+0FoZ39eJjl0Zour/xWGUv+WpR8queZKJYRZwmxDm3AHYB2LqsZqNdKDoKercjSzuwOPn2xA2ZFJznMsepyOPaYhPvzrTvco9Saxyw3EXEl0rtVF9BZR1B5cFmzSEvEpEOG9R/bKYa5Tq2azmJm6qQPfw3Xa2gUA81EAjX3CohIgTLxmXAOE+RCfyprslCuRTdy/+H8SxBuFXtBEUGmc8tWSIQOpGH7buWORtWK3EP9EBqfd3Ewvmv7z0KlYqdGjJ/BI7pJNshHTtg+zSfbMv6eqT8P8dRbbM6SpuggBz8Gf0nfxFAakv51NeZ5uHSw2fLFYJs= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN6PR03MB2705; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2705; 31:5+/Ow6NC8XS7Zwf8PgyknVDot8n20HkiqInntCRXKJmm2+oKunkMRWfH0O8C8x75QYxQWTsAbmgZ2mWL1e5eBWpOBGZ8Hl6xA//cYZztp/WqILUGlaqnch91W6oreP0MHcyeDLjigkjR7Cqk+VqY/Vyy4mXywrV9g3cfunDMn+AkA1clFJP8A7J+CYlW5/bHAEz5Rk8yWsa9GViG+lUQrKoNQMpi0660dQZf61KTGo8=; 4:wuv9IRQlVojj2SwUgb/17oYq6ABJ+jlMiPFh+Kjxbx6fw8Nnl2mxmLTT7mz3D9oOg5jBQc7kcWMELb0Ctef4FuakxeIOr/ExO301JV07InzEcNxzNXr+1im2nd2r+ey/HoNr53vOQvRvVkhO7RvMa+NGtsvMZP+ZnSwKWtXCSp3NU8x39NE062FqsoV1Bb2DZa8VADco9uMWBY7HnPFpLCaOgtxH4le4pGlMBHS8nFT1kSnhjHXphBR/SH8LMSn9sW8MtO8lDZCK2nVIyHoPIq7jCkOOufStu3dcIoo6bikivoDeDCMUg7y7qjESd17lF4MXBT1dnLtA9zEfQ0arP0CijZ5lJAJyd+aGhNcjPStGX3TXwhX27LfqMhoyD2SFckt4+p7sqj6iOsdhFuxMhz/TLFtgWmV1mECMpGFBRa7H3L2UXSCjMLUdYEFUaOa6NhZPVMr/pCnKORL5WXJn9NHkgGnvmDFtfGHSAfTCVUWeB4P+jVoH6XHoqKrYntpw X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13018025)(8121501046)(13017025)(13015025)(13024025)(13023025)(5005006)(10201501046)(3002001)(6055026); SRVR:BN6PR03MB2705; BCL:0; PCL:0; RULEID:(400006); SRVR:BN6PR03MB2705; X-Forefront-PRVS: 0039C6E5C5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2705; 23:YGrA/UdVLjjh1YDbO2oiaeI9ij2aAM5Mv3JqMhi15?= =?us-ascii?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9Z6MMnmmPsCX/IF2QxtMIGEbY7iIbVyNTRDnh6my1G8zO6Vh9YR+yujPKKYpNkQMSgn3qLWIUpLETcciwxfvNjy78fdyIl9hiIoB7DOyJfNfd3DdJzTURspdhlAbPV9TvjJslUe9tO44p4djOIDyiVCvjJ6GwYg244MKF6x5iADi32TCnPf1vv2h1l9aNsCdx1FKuSKFFCsdCiB/59ivUC6MbedM84KhhKqcMSPGDb1+OLqGBNEQ3dA SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Aug 2016 09:37:24.9343 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB2705 Cc: Daniel Vetter , Peter Senna Tschudin , Russell King 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Some display controllers need plane(s) to be disabled together with the relevant CRTC, e.g., the IPUv3 display controller for imx-drm. This patch adds atomic_disable CRTC helper callback so that old_crtc_state(as a parameter of the callback) could be used to get all appropriate active plane(s) of the old CRTC state for disable operation. Suggested-by: Daniel Vetter Cc: Philipp Zabel Cc: David Airlie Cc: Russell King Cc: Daniel Vetter Cc: Peter Senna Tschudin Cc: Lucas Stach Signed-off-by: Liu Ying --- v3: * Newly introduced in v3. drivers/gpu/drm/drm_atomic_helper.c | 2 ++ include/drm/drm_modeset_helper_vtables.h | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 9abe0a2..254bdde 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -749,6 +749,8 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state) /* Right function depends upon target state. */ if (crtc->state->enable && funcs->prepare) funcs->prepare(crtc); + else if (funcs->atomic_disable) + funcs->atomic_disable(crtc, old_crtc_state); else if (funcs->disable) funcs->disable(crtc); else diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h index 686feec..16fd918 100644 --- a/include/drm/drm_modeset_helper_vtables.h +++ b/include/drm/drm_modeset_helper_vtables.h @@ -391,6 +391,20 @@ struct drm_crtc_helper_funcs { */ void (*atomic_flush)(struct drm_crtc *crtc, struct drm_crtc_state *old_crtc_state); + + /** + * @atomic_disable: + * + * This callback should be used to disable the CRTC. It is called + * after all encoders connected to this CRTC have been shut off + * already using their own ->disable hook. + * + * This hook is used only by atomic helpers. Atomic drivers don't + * need to implement it if there's no need to disable anything at the + * CRTC level. + */ + void (*atomic_disable)(struct drm_crtc *crtc, + struct drm_crtc_state *old_crtc_state); }; /**