From patchwork Mon Jul 4 07:40:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 9211861 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 4FC1160571 for ; Mon, 4 Jul 2016 08:14:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F9B8284BC for ; Mon, 4 Jul 2016 08:14:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3465828522; Mon, 4 Jul 2016 08:14:45 +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 8A102284BC for ; Mon, 4 Jul 2016 08:14:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6CEFA6E3CC; Mon, 4 Jul 2016 08:14:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0082.outbound.protection.outlook.com [104.47.36.82]) by gabe.freedesktop.org (Postfix) with ESMTPS id ED9EE6E3C9 for ; Mon, 4 Jul 2016 08:14:40 +0000 (UTC) Received: from BY2PR03CA063.namprd03.prod.outlook.com (10.141.249.36) by BY2PR03MB588.namprd03.prod.outlook.com (10.141.144.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.517.8; Mon, 4 Jul 2016 07:41:15 +0000 Received: from BL2FFO11FD046.protection.gbl (2a01:111:f400:7c09::151) by BY2PR03CA063.outlook.office365.com (2a01:111:e400:2c5d::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.523.12 via Frontend Transport; Mon, 4 Jul 2016 07:41:15 +0000 Authentication-Results: spf=softfail (sender IP is 192.88.158.2) smtp.mailfrom=gmail.com; ffwll.ch; dkim=none (message not signed) header.d=none; ffwll.ch; dmarc=fail action=none header.from=gmail.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning gmail.com discourages use of 192.88.158.2 as permitted sender) Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD046.mail.protection.outlook.com (10.173.161.208) with Microsoft SMTP Server (TLS) id 15.1.523.9 via Frontend Transport; Mon, 4 Jul 2016 07:41:14 +0000 Received: from victor.ap.freescale.net (victor.ap.freescale.net [10.192.241.62]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id u647ep0Y026135; Mon, 4 Jul 2016 00:41:12 -0700 From: Liu Ying To: Subject: [PATCH v3 09/10] drm/imx: atomic phase 3 step 2: Legacy callback fixups Date: Mon, 4 Jul 2016 15:40:38 +0800 Message-ID: <1467618039-7457-10-git-send-email-gnuiyl@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1467618039-7457-1-git-send-email-gnuiyl@gmail.com> References: <1467618039-7457-1-git-send-email-gnuiyl@gmail.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131120916752333470; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(199003)(189002)(2950100001)(4326007)(110136002)(86362001)(586003)(229853001)(50226002)(189998001)(68736007)(305945005)(2906002)(104016004)(575784001)(6260500002)(48376002)(97736004)(6806005)(8936002)(87936001)(7846002)(55446002)(76482005)(356003)(19580395003)(83322999)(82202001)(61266001)(81442002)(92566002)(77096005)(73972006)(81156014)(8676002)(36756003)(50466002)(50986999)(76176999)(47776003)(19580405001)(69596002)(33646002)(11100500001)(5003940100001)(105596002)(87572001)(73392002)(2351001)(106466001)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB588; H:az84smr01.freescale.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; CAT:NONE; LANG:en; CAT:NONE; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD046; 1:WPYojGyu6Xrmu8WNNA4shsTN+ljisw538NQ3EMoLz9PNsyjMPS9B7QteXzfn7zUEvgs2DtlChFucCAtPEPw2E4Ro/qMe3tYLt7pckZQE/JoxAGnF1Hx3M+1PkCUpV0nFQJUwDXlRJq4iLWRtGP42o74yjJkyF91VENI64nJ6rSFFOljDISow/JaBpiJWo6N7ODosX0NbB2aDUOe6ceog/ljCNwnpt6pPcK88vL2r5Jiw2csLTNVfqd7g3sMBor1Wc8G3oeb8mZhhGVSvC990cba1A73D84BE/7rvCXlsWOwW2sj4ldzW6zzcgk3aXHBUnMWJ/uGxn3tBVhyCZTVLsHxo7uagDa1tK6mPKxBxt0osNTGL8ezpx2ce8i3bHHZ1DHwCB9BAIxjyTAL/OdjP6Ig9iMgDBwuUkAerIKBtvd6S7jwu/6P0qGCu6ogZJ9FD+9yRo16ch1OnhUQIIgbpxwe08TAcbvYnVOECmAUDbSfC17iVlWx/YGrQcVWjcyTCn/zIW2tmUpo9nu1hvV9Gb8FJzdkN5yqhY3bjIL5c0AW6Rc+8t9a4JJAod3XJlchiSrDdjGpqXwtIZ1XrrR/obQ== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 95fb6de5-2783-4f1d-6fa6-08d3a3de9409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2jPF601usnl2JsSl2bqDQBTsWVUSw2mEPia8PCjPSL8Vlz8tpnivOEXOt5trCZDuqVE66WjU4tiS/UigYxLzjV84z5UT0J4SQa6g6pjA8AuZF/JO4YDZVkLW2UcBERBjmn305BAHd+D1dGwpp3LWj8Dhig8W+7/zXobPUKF/96KW+MY5+HV3BGLG+Zb5WC3kh1xpZ0vAmrFU7CsXaYCwRDTBiZFcLe6MHgzdJ6AXqM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13024025)(13017025)(13023025)(8121501046)(13018025)(13015025)(5005006)(3002001)(10201501046)(6055026); SRVR:BY2PR03MB588; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR03MB588; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB588; 4:dWUJIdE+Kq5KsbgAPIB7mgVDzqbQhqwMWRn9qqTEz+K51LydG63FI0rX0qgMuuL06ZTw1W4F1cUakgcXMDACH5NOOtn8iPECRFHf1XfEbrt7u9nFd/xxKFyskB64Cusdr73kUgKE1rKnaqfpFj+ykad5abLU72n1NeikdD1pbKNPv2vI+Qjjzqv4AR6arKH4KlS+1qYJXuQOq3Wen7yHqz8xgxCZTlUUGKgZl6MWul9C1D4si448pVuv3m1pPDYylo7bCshsF+/9PnmFJGazdBRyCvIHiqYMO/j5pwcL4lVD1zVJOa8mtTlQxGP/aJph3X2oiAwaH0qiQATIbLZQtgg8rCuXCT2KiL6yuVHKHxQYoUjNaIuO7iy6x2lIsFoc7QY8fEG9CLu/Le72X8HQAchfMVB+s1O7RMbrsT8WdeXcayCMkzFTfcpMLDSA745iKe+n2HVkMkYNhDartPH5EKiej+7iA+8WF9Y07z2E7Ko= X-Forefront-PRVS: 0993689CD1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR03MB588; 23:tmzaNxrGX0tlqWMygRmyEk2A5e4Tfuhy+1iibY8ji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juBWOUcNWJ8ekJh0qHGOwwG2rjwh5JS/uyN+egdChP5vd00TY3sFXwYiq7uQ2hkooR+nk+j2+GUb/D5Vbk7r95MAc9uAc=; 7:J2y9LLtNiIjTI5+oS0LJGieKDleyDw0XLz3GbuQCNgM+l/s3UIvT89PWiE2VPhnbGMdfwykUgkEIR82XsWG08M3H4YGf3odfI0EZFWLMX1wkRkDWOcJAidIRlxbcbQY2uuU/3rRunVZPz8fl1M0pV+K2/M+B35SCrYPkf1v/kFstB7WRzEQ8nJhV9trucCfephh47QnbVxs8h1kFOWS8u6JRKJqTzSSeAU/+b963qpo4oWFsoDONikOub9oHEX3A SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2016 07:41:14.8901 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR03MB588 Cc: Russell King , Daniel Vetter 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. For the imx-tve driver, since the encoder's callback ->dpms is replaced by ->disable, we need to move the setting for the IPU_CLK_EN bit(in register TVE_COM_CONF_REG) from ->enable/->disable to ->mode_set, otherwise, the relevant CRTC cannot be disabled correctly with a warning on DC stop timeout. Signed-off-by: Liu Ying --- v2->v3: * Trivial change due to rebasing. v1->v2: * A fixup on the TVE register bit IPU_CLK_EN to avoid a warning on DC stop timeout when doing mode setting. drivers/gpu/drm/imx/dw_hdmi-imx.c | 4 ++-- drivers/gpu/drm/imx/imx-ldb.c | 16 ++++++------- drivers/gpu/drm/imx/imx-tve.c | 27 +++++++-------------- drivers/gpu/drm/imx/ipuv3-crtc.c | 44 +++++----------------------------- drivers/gpu/drm/imx/parallel-display.c | 18 +++----------- 5 files changed, 27 insertions(+), 82 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 4a98eaa..9a4190c 100644 --- a/drivers/gpu/drm/imx/imx-ldb.c +++ b/drivers/gpu/drm/imx/imx-ldb.c @@ -142,10 +142,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) { @@ -174,7 +170,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); @@ -185,8 +181,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) { @@ -326,7 +327,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, @@ -345,9 +346,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..cd92aac 100644 --- a/drivers/gpu/drm/imx/imx-tve.c +++ b/drivers/gpu/drm/imx/imx-tve.c @@ -147,8 +147,7 @@ static void tve_enable(struct imx_tve *tve) tve->enabled = true; clk_prepare_enable(tve->clk); ret = regmap_update_bits(tve->regmap, TVE_COM_CONF_REG, - TVE_IPU_CLK_EN | TVE_EN, - TVE_IPU_CLK_EN | TVE_EN); + TVE_EN, TVE_EN); } /* clear interrupt status register */ @@ -171,7 +170,7 @@ static void tve_disable(struct imx_tve *tve) if (tve->enabled) { tve->enabled = false; ret = regmap_update_bits(tve->regmap, TVE_COM_CONF_REG, - TVE_IPU_CLK_EN | TVE_EN, 0); + TVE_EN, 0); clk_disable_unprepare(tve->clk); } } @@ -274,18 +273,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) @@ -315,6 +302,9 @@ static void imx_tve_encoder_mode_set(struct drm_encoder *encoder, ret); } + regmap_update_bits(tve->regmap, TVE_COM_CONF_REG, + TVE_IPU_CLK_EN, TVE_IPU_CLK_EN); + if (tve->mode == TVE_MODE_VGA) ret = tve_setup_vga(tve); else @@ -323,7 +313,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 +330,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 +350,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 3e82534..274b0e2 100644 --- a/drivers/gpu/drm/imx/ipuv3-crtc.c +++ b/drivers/gpu/drm/imx/ipuv3-crtc.c @@ -48,8 +48,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); @@ -57,10 +58,10 @@ static void ipu_crtc_enable(struct ipu_crtc *ipu_crtc) ipu_di_enable(ipu_crtc->di); } -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); - struct drm_crtc *crtc = &ipu_crtc->base; ipu_dc_disable_channel(ipu_crtc->dc); ipu_di_disable(ipu_crtc->di); @@ -74,24 +75,6 @@ static void ipu_crtc_disable(struct ipu_crtc *ipu_crtc) spin_unlock_irq(&crtc->dev->event_lock); } -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 const struct drm_crtc_funcs ipu_crtc_funcs = { .set_config = drm_atomic_helper_set_config, .destroy = drm_crtc_cleanup, @@ -132,20 +115,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) { @@ -225,13 +194,12 @@ 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, .atomic_begin = ipu_crtc_atomic_begin, + .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 7374d82..bb5dbd6 100644 --- a/drivers/gpu/drm/imx/parallel-display.c +++ b/drivers/gpu/drm/imx/parallel-display.c @@ -92,18 +92,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); @@ -128,7 +117,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, @@ -147,9 +136,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, };