From patchwork Tue May 24 10:10:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 9133373 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 284ED607D5 for ; Tue, 24 May 2016 10:25:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2022F28233 for ; Tue, 24 May 2016 10:25:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 14E9D28258; Tue, 24 May 2016 10:25:57 +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]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A8C028233 for ; Tue, 24 May 2016 10:25:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 20A086E6F8; Tue, 24 May 2016 10:25:54 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0074.outbound.protection.outlook.com [157.56.110.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id 939436E6F6 for ; Tue, 24 May 2016 10:25:51 +0000 (UTC) Received: from BY2PR03CA043.namprd03.prod.outlook.com (10.141.249.16) by DM2PR03MB477.namprd03.prod.outlook.com (10.141.85.19) with Microsoft SMTP Server (TLS) id 15.1.497.12; Tue, 24 May 2016 10:11:39 +0000 Received: from BN1AFFO11FD030.protection.gbl (2a01:111:f400:7c10::166) by BY2PR03CA043.outlook.office365.com (2a01:111:e400:2c5d::16) with Microsoft SMTP Server (TLS) id 15.1.501.7 via Frontend Transport; Tue, 24 May 2016 10:11:39 +0000 Authentication-Results: spf=softfail (sender IP is 192.88.168.50) smtp.mailfrom=gmail.com; arm.linux.org.uk; dkim=none (message not signed) header.d=none; arm.linux.org.uk; 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 BN1AFFO11FD030.mail.protection.outlook.com (10.58.52.168) with Microsoft SMTP Server (TLS) id 15.1.497.8 via Frontend Transport; Tue, 24 May 2016 10:11:39 +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 u4OABCMB024148; Tue, 24 May 2016 03:11:37 -0700 From: Liu Ying To: Subject: [PATCH 12/14] drm/imx: atomic phase 3 step 3: Legacy callback fixups Date: Tue, 24 May 2016 18:10:51 +0800 Message-ID: <1464084653-16684-13-git-send-email-gnuiyl@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1464084653-16684-1-git-send-email-gnuiyl@gmail.com> References: <1464084653-16684-1-git-send-email-gnuiyl@gmail.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131085582992261752; (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)(2980300002)(199003)(189002)(9170700003)(2906002)(50226002)(1220700001)(586003)(104016004)(19580395003)(77096005)(6806005)(19580405001)(2950100001)(5008740100001)(92566002)(4326007)(2351001)(33646002)(8676002)(8936002)(50466002)(229853001)(5003940100001)(189998001)(110136002)(11100500001)(575784001)(76482005)(86362001)(76176999)(105596002)(50986999)(87936001)(106466001)(87572001)(81166006)(83322999)(36756003)(81442002)(73392002)(73972006)(82202001)(48376002)(61266001)(47776003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR03MB477; H:tx30smr01.am.freescale.net; FPR:; SPF:SoftFail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD030; 1:7WUVeCx6zeJarezPxK/1sFAWxqOm4Tfr4wYgDz4Oaa6oR/PJPsK7n3JsRCUKaqVndqrg1QH63WMexwqpxUSb8Vfvvu68l/26YXFOZ5vTMhZqviKRBD4+FfBcywmwoXmTWMep/SZFOvvB2CIWpY5yv1ij3QKV528VMNwbjNORKxi8VnqRcVW1Q1K9f3HoWR60/qukW2O0QM8PJGVKcD33UwA4C8PocUjKPjnA5XthBGit0XhHkNpxpe6zH6XEW7XyQ0DyNlrdOWj2avR+8F1D2i/X2ypfYy6WYpgNj2n7hz078IhB09X4b+LZn2wqKqpvX6M58fW3kDTGjcjoSBJnQ5DuIEbrVJbvhZFecVDOsDObGDOZNFVfPISmZLiiau45/dxVJ0ThrAFyTod2iEtjfJd3qKsuyl951/bCf1+BvpX727wXfWy2XGV5lKEByJWDyCM0xyInLDOEfZ6flRbjZj6NH04DCYHDn1BgPClbIfpYsxQnViypgM6Bf7yntQpUw5w6JXeJOOHkGSXLD6/fMqF8AY2IlV9ZIfRdd29MHH/YE1UtltJ3xiEe7nqS0sCz MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: b7acebde-76e6-46ce-c278-08d383bbcbe4 X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB477; 2:dqmdnJQcsTwFPJtyBhf9ARG+SEAvOSpR7XQsgDalfUMmo0zI6S02b27ocY7jBQS6hyfKu9jYGcwJBUCsSJAfPBYQIJMRQl0tfT+XarHIXkEH5spTDH7F2ihaBc/psHqZAZXe0+TLesHR90Uj8pn8Cs7w9Cy7Qadt7cWERlSWcDuM9GGF3m60CGoCzuhUWv1R; 3:RrScA+xv0KGUaYunCS0jaBEpDVSCy0FiXIEqhCpZA9Ew5fqhPKWmjzFVL4QbGxuU5f0n2U6yRstVOwX1cJN6OzgZWsLETewB2TtOVbzjtZOUDDxvXjIOWysRZGJIJIqh9AcYWs58mMXfxLitaT9tfSvuHAHbGOv1CPaRtaTbzvYdgENUmp5X7Zo8Qd71+lo+cKSRy22qmfjSb8ceewa7BgdXrU7YaZ6WjJHsUmqX2ds=; 25:zQgPUtRPGBZG4HHBrxInwqQeJZ0beUOex7C8CsQZCudGeA8zN3KubNt6o4t7exjixArKJChgupH1wyRxWlVJknrBO3/r6xmKVwxb6+mtuseU5bXe1cMXUUulZiI7wZYH0PKdj7PdaOSTct2p1f1JEHcDYMX3Pj66PBA7zfHl8UGvxhoRNDNOtpb14bClmh3XFG2Xkal7MkeE3xVYRfAcpBRDqfC59wUy15YqV/ZRFcI/STt8qXVoJWoOPcOcScF7ZsVryTPzqpbVnWgkTWDrN04nn+9n3E1Tl7fLzVjdPYjdu1Hxvb3DGt3EzRRAY1lVIuZXcpEYu/Qb226NCkV80iOAi/028OnJrykJTpB0ik5WfmgeXcWXRILUSfBD308g1jpziU8ZJe6qVYmWvjhSTRghCzjiBh1ZAWRGLI/FDko= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB477; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(13015025)(13024025)(13017025)(13023025)(13018025)(10201501046)(3002001)(6055026); SRVR:DM2PR03MB477; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR03MB477; X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB477; 4:qX9G+WQxUVFd39vRp56w7jiQwIBvr69gWdQNOcQ+AXCrMYlxuv2a4h0/iWsTWgDZwHbXn8dZ5zzCmYNw6rQIL64Avs4ixR4udM+NZ/DA2evoes3YnUJCcDHH3HJmSuDjnzo3PHwL34NUg8To7OrEIACSGpAK7UtVjXeSVWlGBH7/1aiOqmPpCYAIJc9rBnnuio+hyAM0y6gg7Jl+popj4AkiLo//7ghaxA0zsyH7SFuvyeF9zGXXwa/he818QirfQROKRZSihM6S0WqG9oNm8xmKrdB/YnOZMHxbrVeaZPbNmZQNjLZsK2QQKyc2bMck+5xAq6jlr0y39PckBVXi+pU+JtrDL1Gow9V3BR/0+KJu4kPy230nnjmLn11e/Mbvg3sc2st2afv4lGASJMEFjeEeSFmwcPfUZzy2cWOX4VZTCQ8KMiyLf+j67RPJSSW4qLDTbFeqMBCA0xGHIowoK6++b/OHkpr7dKm7yxMCt9s= X-Forefront-PRVS: 09525C61DB X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR03MB477; 23:XX1IQx8KthB7wnzH97ny+KfbE448aKdBmQkyNIA8VB?= =?us-ascii?Q?BDoW2uxFUW8pe+alPnHKvtAM4QSTL+eXyboQb+lTxCI3t1/++Y49EjqFcKGo?= =?us-ascii?Q?lcwyqk1A1rMaK09BbcffnXw7ou23wEYJniknuGsg7DLA9xc6hGvc+F9xq0u4?= =?us-ascii?Q?5SkK58KzuYYbrqdp/OON4Fy4tAp0jy4dWP25pu3BKKvDum1/WCNWf09dkNKZ?= =?us-ascii?Q?qhLhHDn5egd4sYKGKA992PTKy5Z1sqlAM1ofOniyK5Eo29BRaExO0ybodcZp?= =?us-ascii?Q?JsvqroDwaeHy3NFyGpAiQ31WmFBb21df10aaJJunGbJNVbuHuwI1+PE7+ehm?= =?us-ascii?Q?M3m63T5VEyHy893QqxHN813viNh9H10DTSSnR0SKJOumCWzB2+5+Y+KAYfXd?= =?us-ascii?Q?XbDpaMDAmum5sLxPUsq8GctG5WGwiSWpvf+kN2918pUlrH5mJitLqUUYxerW?= =?us-ascii?Q?MPrOC7eVtXjaHr34evb7Of8dlI2eb2C9dEaeHGylP6nMBQBPRJ2+s2q1aL1q?= =?us-ascii?Q?OjSBOlSThnMbfQVmM4FZU7g/J0P8+v0Pk+CZ5zMYm1NwNbzTL2JzTxD7fYuH?= =?us-ascii?Q?sWrVKmAfkhfulkgxkf2u5Yr7W0L7+rVvDhVX0tjsv+qvCnXTZQwQogLy4+hs?= =?us-ascii?Q?FauzBlLjfBm5Uh4LGybwPlaY3iYH1mQIVTKACLbXXtmrt+74Qx5mO+9M/+SQ?= =?us-ascii?Q?J30D4yPlYRqjW3TBbVioGvdZ4cKFfyzzSLqR9foLi+BdXuFC5P9mrYt7A4MW?= =?us-ascii?Q?OkDdmzYnFJTBSkRWkgOONb1XmNRWtgb/WvGdwdt4//CdxdFVA/gzI2zN0tMP?= =?us-ascii?Q?UOSF7UKpPOFFiLLsP4TPe+eOB+3kV7FB0rf0sML4UasSBxcG8hFHMKQvTWIW?= =?us-ascii?Q?pNJxWnM/lZMGR+2FxySyOgfDgIe4oVwh/3iWNlPzMZH/S8oDAILT1hh0jdrG?= =?us-ascii?Q?uWgiBO0m4Z+7f/TIsiQ8UUqJafHzSsRMOEdp93VXsPxInw31ItlLNfUwO6vg?= =?us-ascii?Q?JDNfbBxiBAlGokmONjry3WucKVGq7JTGkNBYsBDoEDhUhuKqUDyRaYRKmuxM?= =?us-ascii?Q?hl8fKH6ZAhyKIzeQ/bJpux0U0pnJyhKbxkR0rkVs/QFQ9ZOV7zvGiZEq+hpS?= =?us-ascii?Q?Cbq1H3VVfgUNBGnWJQ7cz6+znunRPbTsUEV0ouRgOKSKB/HgoLb8CGZ1DTag?= =?us-ascii?Q?0pK0vehBkaahP/9IWMaO/Pb9oqG2CvnrbM?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB477; 5:a1tIqma6TuAzPbSZyiLB982MXAzZFOBkIw+QdxG1PmtnF873vlZq9lYAcnpqbuPc8pemNr6WbnZA01SlkmsqVPBTXu555EAeDuyabpZpYvQN3E8W4lFhF8K5OXHMu5R591CsHwL6iDySDTJOwL4O3RWkslxBOvNC3u+XJebRTpU=; 24:vbGwKa1JX39NUYtINtGEgLVeeFk9+lbWJpbuzXoY/PrMIlrwmr/9mb9hS2OK5ZYmPugCHLufdCbWf5rIl76/m80KkIocz2UWlxS0Sz+7jJU=; 7:TOoDIIeKsAIQgcNmHzQYD+p9FG4+BwXpBdlgyR+zNzWdsjX9f3zor31AJWR/EeYFnoj8RLeGbdin89eqJRdHx4dGtmKs1YMUiJIW6xuO1b2ycmL+EJtERSFLiuR4RY2pRCUiCUQhlwfWIlSbgjOCOHNm/uf9OZDVk5X5o3K9KS2x3U2M9iBTe362P5clQnDy SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2016 10:11:39.0545 (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: DM2PR03MB477 Cc: 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 Now that we can use atomic configurations, all the legacy callbacks of CRTCs, encoders and connectors can be switched to the atomic version. For the imx-ldb driver, there is a clock parent setting mismatch bewteen ->enable and ->disable after the switch, so a fixup is added. Signed-off-by: Liu Ying --- drivers/gpu/drm/imx/dw_hdmi-imx.c | 4 ++-- drivers/gpu/drm/imx/imx-ldb.c | 16 ++++++------- drivers/gpu/drm/imx/imx-tve.c | 19 +++------------ drivers/gpu/drm/imx/ipuv3-crtc.c | 43 +++++----------------------------- drivers/gpu/drm/imx/parallel-display.c | 18 +++----------- 5 files changed, 22 insertions(+), 78 deletions(-) diff --git a/drivers/gpu/drm/imx/dw_hdmi-imx.c b/drivers/gpu/drm/imx/dw_hdmi-imx.c index 5f64674..5f1d437 100644 --- a/drivers/gpu/drm/imx/dw_hdmi-imx.c +++ b/drivers/gpu/drm/imx/dw_hdmi-imx.c @@ -117,7 +117,7 @@ static void dw_hdmi_imx_encoder_mode_set(struct drm_encoder *encoder, { } -static void dw_hdmi_imx_encoder_commit(struct drm_encoder *encoder) +static void dw_hdmi_imx_encoder_enable(struct drm_encoder *encoder) { struct imx_drm_encoder *imx_encoder = enc_to_imx_enc(encoder); struct imx_hdmi *hdmi = imx_enc_to_imx_hdmi(imx_encoder); @@ -130,7 +130,7 @@ static void dw_hdmi_imx_encoder_commit(struct drm_encoder *encoder) static const struct drm_encoder_helper_funcs dw_hdmi_imx_encoder_helper_funcs = { .mode_set = dw_hdmi_imx_encoder_mode_set, - .commit = dw_hdmi_imx_encoder_commit, + .enable = dw_hdmi_imx_encoder_enable, .disable = dw_hdmi_imx_encoder_disable, }; diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c index d7d1e31..4194150 100644 --- a/drivers/gpu/drm/imx/imx-ldb.c +++ b/drivers/gpu/drm/imx/imx-ldb.c @@ -137,10 +137,6 @@ static struct drm_encoder *imx_ldb_connector_best_encoder( return &imx_ldb_ch->imx_encoder.encoder; } -static void imx_ldb_encoder_dpms(struct drm_encoder *encoder, int mode) -{ -} - static void imx_ldb_set_clock(struct imx_ldb *ldb, int mux, int chno, unsigned long serial_clk, unsigned long di_clk) { @@ -169,7 +165,7 @@ static void imx_ldb_set_clock(struct imx_ldb *ldb, int mux, int chno, chno); } -static void imx_ldb_encoder_commit(struct drm_encoder *encoder) +static void imx_ldb_encoder_enable(struct drm_encoder *encoder) { struct imx_drm_encoder *imx_encoder = enc_to_imx_enc(encoder); struct imx_ldb_channel *imx_ldb_ch = imx_enc_to_imx_ldb_ch(imx_encoder); @@ -180,8 +176,13 @@ static void imx_ldb_encoder_commit(struct drm_encoder *encoder) drm_panel_prepare(imx_ldb_ch->panel); if (dual) { + clk_set_parent(ldb->clk_sel[mux], ldb->clk[0]); + clk_set_parent(ldb->clk_sel[mux], ldb->clk[1]); + clk_prepare_enable(ldb->clk[0]); clk_prepare_enable(ldb->clk[1]); + } else { + clk_set_parent(ldb->clk_sel[mux], ldb->clk[imx_ldb_ch->chno]); } if (imx_ldb_ch == &ldb->channel[0] || dual) { @@ -321,7 +322,7 @@ static void imx_ldb_encoder_disable(struct drm_encoder *encoder) } static const struct drm_connector_funcs imx_ldb_connector_funcs = { - .dpms = drm_helper_connector_dpms, + .dpms = drm_atomic_helper_connector_dpms, .fill_modes = drm_helper_probe_single_connector_modes, .detect = imx_ldb_connector_detect, .destroy = imx_drm_connector_destroy, @@ -340,9 +341,8 @@ static const struct drm_encoder_funcs imx_ldb_encoder_funcs = { }; static const struct drm_encoder_helper_funcs imx_ldb_encoder_helper_funcs = { - .dpms = imx_ldb_encoder_dpms, - .commit = imx_ldb_encoder_commit, .mode_set = imx_ldb_encoder_mode_set, + .enable = imx_ldb_encoder_enable, .disable = imx_ldb_encoder_disable, }; diff --git a/drivers/gpu/drm/imx/imx-tve.c b/drivers/gpu/drm/imx/imx-tve.c index 82a1edd..ed19a7f 100644 --- a/drivers/gpu/drm/imx/imx-tve.c +++ b/drivers/gpu/drm/imx/imx-tve.c @@ -274,18 +274,6 @@ static struct drm_encoder *imx_tve_connector_best_encoder( return &tve->imx_encoder.encoder; } -static void imx_tve_encoder_dpms(struct drm_encoder *encoder, int mode) -{ - struct imx_drm_encoder *imx_encoder = enc_to_imx_enc(encoder); - struct imx_tve *tve = imx_enc_to_tve(imx_encoder); - int ret; - - ret = regmap_update_bits(tve->regmap, TVE_COM_CONF_REG, - TVE_TV_OUT_MODE_MASK, TVE_TV_OUT_DISABLE); - if (ret < 0) - dev_err(tve->dev, "failed to disable TVOUT: %d\n", ret); -} - static void imx_tve_encoder_mode_set(struct drm_encoder *encoder, struct drm_display_mode *orig_mode, struct drm_display_mode *mode) @@ -323,7 +311,7 @@ static void imx_tve_encoder_mode_set(struct drm_encoder *encoder, dev_err(tve->dev, "failed to set configuration: %d\n", ret); } -static void imx_tve_encoder_commit(struct drm_encoder *encoder) +static void imx_tve_encoder_enable(struct drm_encoder *encoder) { struct imx_drm_encoder *imx_encoder = enc_to_imx_enc(encoder); struct imx_tve *tve = imx_enc_to_tve(imx_encoder); @@ -340,7 +328,7 @@ static void imx_tve_encoder_disable(struct drm_encoder *encoder) } static const struct drm_connector_funcs imx_tve_connector_funcs = { - .dpms = drm_helper_connector_dpms, + .dpms = drm_atomic_helper_connector_dpms, .fill_modes = drm_helper_probe_single_connector_modes, .detect = imx_tve_connector_detect, .destroy = imx_drm_connector_destroy, @@ -360,9 +348,8 @@ static const struct drm_encoder_funcs imx_tve_encoder_funcs = { }; static const struct drm_encoder_helper_funcs imx_tve_encoder_helper_funcs = { - .dpms = imx_tve_encoder_dpms, .mode_set = imx_tve_encoder_mode_set, - .commit = imx_tve_encoder_commit, + .enable = imx_tve_encoder_enable, .disable = imx_tve_encoder_disable, }; diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c index 3a3b67c..4d1b911 100644 --- a/drivers/gpu/drm/imx/ipuv3-crtc.c +++ b/drivers/gpu/drm/imx/ipuv3-crtc.c @@ -70,8 +70,9 @@ struct ipu_crtc { #define to_ipu_crtc(x) container_of(x, struct ipu_crtc, base) -static void ipu_crtc_enable(struct ipu_crtc *ipu_crtc) +static void ipu_crtc_enable(struct drm_crtc *crtc) { + struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); struct ipu_soc *ipu = dev_get_drvdata(ipu_crtc->dev->parent); ipu_dc_enable(ipu); @@ -81,8 +82,9 @@ static void ipu_crtc_enable(struct ipu_crtc *ipu_crtc) drm_crtc_vblank_on(&ipu_crtc->base); } -static void ipu_crtc_disable(struct ipu_crtc *ipu_crtc) +static void ipu_crtc_disable(struct drm_crtc *crtc) { + struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); struct ipu_soc *ipu = dev_get_drvdata(ipu_crtc->dev->parent); /* Stop DC channel and DI before IDMAC */ @@ -92,24 +94,6 @@ static void ipu_crtc_disable(struct ipu_crtc *ipu_crtc) drm_crtc_vblank_off(&ipu_crtc->base); } -static void ipu_crtc_dpms(struct drm_crtc *crtc, int mode) -{ - struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); - - dev_dbg(ipu_crtc->dev, "%s mode: %d\n", __func__, mode); - - switch (mode) { - case DRM_MODE_DPMS_ON: - ipu_crtc_enable(ipu_crtc); - break; - case DRM_MODE_DPMS_STANDBY: - case DRM_MODE_DPMS_SUSPEND: - case DRM_MODE_DPMS_OFF: - ipu_crtc_disable(ipu_crtc); - break; - } -} - static void ipu_flip_unref_work_func(struct work_struct *__work) { struct ipu_flip_work *work = @@ -280,20 +264,6 @@ static bool ipu_crtc_mode_fixup(struct drm_crtc *crtc, return true; } -static void ipu_crtc_prepare(struct drm_crtc *crtc) -{ - struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); - - ipu_crtc_disable(ipu_crtc); -} - -static void ipu_crtc_commit(struct drm_crtc *crtc) -{ - struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); - - ipu_crtc_enable(ipu_crtc); -} - static int ipu_crtc_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state) { @@ -359,12 +329,11 @@ static void ipu_crtc_mode_set_nofb(struct drm_crtc *crtc) } static const struct drm_crtc_helper_funcs ipu_helper_funcs = { - .dpms = ipu_crtc_dpms, .mode_fixup = ipu_crtc_mode_fixup, .mode_set_nofb = ipu_crtc_mode_set_nofb, - .prepare = ipu_crtc_prepare, - .commit = ipu_crtc_commit, .atomic_check = ipu_crtc_atomic_check, + .disable = ipu_crtc_disable, + .enable = ipu_crtc_enable, }; static int ipu_enable_vblank(struct drm_crtc *crtc) diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c index 2367f0a..999e771 100644 --- a/drivers/gpu/drm/imx/parallel-display.c +++ b/drivers/gpu/drm/imx/parallel-display.c @@ -103,18 +103,7 @@ static struct drm_encoder *imx_pd_connector_best_encoder( return &imxpd->imx_encoder.encoder; } -static void imx_pd_encoder_dpms(struct drm_encoder *encoder, int mode) -{ - struct imx_drm_encoder *imx_encoder = enc_to_imx_enc(encoder); - struct imx_parallel_display *imxpd = imx_enc_to_imxpd(imx_encoder); - - if (mode != DRM_MODE_DPMS_ON) - drm_panel_disable(imxpd->panel); - else - drm_panel_enable(imxpd->panel); -} - -static void imx_pd_encoder_commit(struct drm_encoder *encoder) +static void imx_pd_encoder_enable(struct drm_encoder *encoder) { struct imx_drm_encoder *imx_encoder = enc_to_imx_enc(encoder); struct imx_parallel_display *imxpd = imx_enc_to_imxpd(imx_encoder); @@ -139,7 +128,7 @@ static void imx_pd_encoder_disable(struct drm_encoder *encoder) } static const struct drm_connector_funcs imx_pd_connector_funcs = { - .dpms = drm_helper_connector_dpms, + .dpms = drm_atomic_helper_connector_dpms, .fill_modes = drm_helper_probe_single_connector_modes, .detect = imx_pd_connector_detect, .destroy = imx_drm_connector_destroy, @@ -158,9 +147,8 @@ static const struct drm_encoder_funcs imx_pd_encoder_funcs = { }; static const struct drm_encoder_helper_funcs imx_pd_encoder_helper_funcs = { - .dpms = imx_pd_encoder_dpms, - .commit = imx_pd_encoder_commit, .mode_set = imx_pd_encoder_mode_set, + .enable = imx_pd_encoder_enable, .disable = imx_pd_encoder_disable, };