From patchwork Tue May 31 09:24:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 9144037 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 2877560761 for ; Tue, 31 May 2016 09:25:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A10425D97 for ; Tue, 31 May 2016 09:25:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0EC182796F; Tue, 31 May 2016 09:25:13 +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 66DC525D97 for ; Tue, 31 May 2016 09:25:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 303206E369; Tue, 31 May 2016 09:25:09 +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-bn1bon0088.outbound.protection.outlook.com [157.56.111.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 34CDB6E369 for ; Tue, 31 May 2016 09:25:06 +0000 (UTC) Received: from DM2PR03CA0010.namprd03.prod.outlook.com (10.141.96.20) by BN1PR03MB203.namprd03.prod.outlook.com (10.255.200.146) with Microsoft SMTP Server (TLS) id 15.1.497.12; Tue, 31 May 2016 09:25:04 +0000 Received: from BN1BFFO11FD027.protection.gbl (2a01:111:f400:7c10::1:137) by DM2PR03CA0010.outlook.office365.com (2a01:111:e400:2428::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.506.9 via Frontend Transport; Tue, 31 May 2016 09:25:03 +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 BN1BFFO11FD027.mail.protection.outlook.com (10.58.144.90) with Microsoft SMTP Server (TLS) id 15.1.497.8 via Frontend Transport; Tue, 31 May 2016 09:25:02 +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 u4V9OfRS013844; Tue, 31 May 2016 02:25:00 -0700 From: Liu Ying To: Subject: [PATCH v2 08/10] drm/imx: atomic phase 3 step 3: Legacy callback fixups Date: Tue, 31 May 2016 17:24:29 +0800 Message-ID: <1464686671-20299-9-git-send-email-gnuiyl@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1464686671-20299-1-git-send-email-gnuiyl@gmail.com> References: <1464686671-20299-1-git-send-email-gnuiyl@gmail.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131091603025827957; (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)(2980300002)(189002)(199003)(9170700003)(76176999)(87936001)(86362001)(50986999)(77096005)(6806005)(104016004)(87572001)(19580405001)(50226002)(2950100001)(50466002)(73392002)(5008740100001)(229853001)(586003)(105596002)(55446002)(19580395003)(92566002)(106466001)(33646002)(48376002)(82202001)(8936002)(81166006)(36756003)(83322999)(81442002)(4326007)(189998001)(73972006)(76482005)(110136002)(47776003)(5003940100001)(8676002)(6260500002)(2351001)(61266001)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR03MB203; H:az84smr01.freescale.net; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD027; 1:+SZfwDUZGHyqktIs33d625M4+hvMB4MKhJ9WPmgFHyoVrR5THWBVvp0/j+i7xCmjK0QXxyYzvdHFQNdsw2WqI0It6RWSzjesAxRVhJs1fi2CCLq3pKFCuqTtSFuVJloeMKpYSkXlNUSduZvooLmhJcNhsIuTUb0ZayKyhEBK5oIpcIjQ9ZV93wJsteLM28CG3Cbdftd3/s6Q6PD9kjx22qmoAJUge8ucP1mGmeP5bAzCDM7OEXl9JldI8KGT63RjDCjvKRQCqQPRWBW9FDxpVyPsFD5mKzYz20P3QdJ/ccVGUPo2Xv1YcAAtqAg+PYvy30oVS40oH7kwrLp6tH6SGJNKllVNN/AtTUnSd003oMGkSGRR4h2oaT9fizLlA8NjJxZFPaw8SaocJyco7rSqboDbsZD6uNSF/HJXVQKxB4JCE+Xa0fE9VVzX0qSe0b5v/H+j8/pdMqJncvwIDT5+o7sA+RERLkHYPgk2n1kvccU+GFouBWa0Bcg02k+fjPPr6cHzW8MQFMGjcQJcUZlTvxgD5zGIg12HgiPpUJ4VIq6FsGTwwtNa7+TR6eZEAEhi MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 6ba110ab-0075-40f6-b714-08d3893571d8 X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB203; 2:oFZTKvqs1kbzEin3zEbGFuk0A/aYYJHG0Flc6TIFl2DP4ccXggssQBbviCZ569LFqfqdgEy7DwsnkUA0VBdGKsGNfvcXgq8FjGOk1O3jX8df1h7eRIIZVLoMfiA5vHQ6v9zd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GaOkfbCfEbvQ+uv1BfSDJcsVfeTpbKNrLCMzu6284Pc8HgJ5e8ku8s4zQ0xmOi19034CbK1N7qJ/5Ca2Q X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13015025)(13018025)(8121501046)(13023025)(13017025)(13024025)(5005006)(3002001)(10201501046)(6055026); SRVR:BN1PR03MB203; BCL:0; PCL:0; RULEID:(400006); SRVR:BN1PR03MB203; X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB203; 4:pV70DxuWEJ6LOqIJebGJqSNM5pIFGQCVv2xMFJIkHvngJMRzikXjUjDFEoQrNyGJR7fvBLxIo8KiAK5TSPcq3ygBxMjz27w59ayrqsXLuoevWp4A7U95KU47XZccAVEln4MXkrTboVAiL4OhtNyzpD/Cr05bLIawp+TLerVHuMCV5v975mLzlXOXVZcjgYs2djS39I+34mOJU+HC89OwBtX9Gw9hOsvzlEuXol6bXJUugrr1MTMlAxtLPk3N2IihD3OUQVTURI/UQbmRWz7TDsJCyDaaHzhBxtPEmykqXtarH2+ZdEfMOBhTjpHEmzelEeqvH9jlbE2HNIeOAWRZKJQMTz3Ete031gWpLVgeKF23Tp9/cpH32bRNZ2Nlat6dMYl1AqhoFpkKjetekCq2pbTVBHTDaMyVo7RFoGSvwgIlAbjvN3NG5HGncatP8AgrzoYCYJZYWwqOWd34cJsI7FXYieMXy7F7DzqKAgl+JmA= X-Forefront-PRVS: 095972DF2F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR03MB203; 23:TYyQuwiAMLbIrS8wWnz7JcMj8cWRqmPKxqZ/0OCZkP?= =?us-ascii?Q?iWe9jB5nAi0RW/BNOzaOhlH16Ev5G86qH986awS/6CthsCgUUT5Y5ao7Cnv5?= =?us-ascii?Q?4ACcrcAQSVN9htv7nGUeAGhy+T1fr60vGG75cbZCaARECsnq8eTyX7o6xShL?= =?us-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v0djxwoo/ZpCmW0WJ4Ul1QPe2nrJf/+dJ6Rpc+F8D?= =?us-ascii?Q?uWe7mbE0bJsxF3YMSpIn4iauZIlT6rp5nUB9dpKXTbgSRr+XWqetLdLIlarL?= =?us-ascii?Q?RgrjCgPOhzDYhYg07BXIQgAgZuIko37aexLP96fqEbw+uG1rA1/hC9YEQfCT?= =?us-ascii?Q?TR95aZa5+a/ig=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB203; 5:VYCcCwFLy1zafNb4hO85i78wGlVOPImpo8R0XsGK1sOekwW9RvbavUstZI/eeZlSSWJMXNrMii28N+q+Vne+8PN78vxK3U3dyx3xkLa3xsjjQW+ycWDiSMeAtLL1OdRCt9P7Mf31UhK/ESkC2t3/7vIXZF6KeV2fufU90ictitw=; 24:hj+HUomR5RUSeEutshoYnuc4RgMY3T86ly1UAPhpcwv3seSAY/GUWXyZT2BB/hDtDMLAIHowZypeEx+SPutg75QSGGJ3jruZw+0fkatIdx4=; 7:h1jg/2rsnxNwCaKYf6tMJ3VpjVzJ5klRF1s3+gb/nup5KdPi2VnM3UpwQw62aqKeDbQ206AfUpYtrc67luuY2sG1W1o/VryeW4dbNSjk3/KaV5bby7lcaDqOYakn8fQy+4KnBSbdwDp7XtbmpScYVRyFYMx80u3gbeh20kkpLcT8nbiGJ3s2fuOvsnPGb9WJ SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2016 09:25:02.1147 (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: BN1PR03MB203 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 --- 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 | 43 +++++----------------------------- drivers/gpu/drm/imx/parallel-display.c | 18 +++----------- 5 files changed, 27 insertions(+), 81 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 7f4475a1..f20340f 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); @@ -80,8 +81,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); ipu_dc_disable_channel(ipu_crtc->dc); @@ -90,24 +92,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 = @@ -278,20 +262,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 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, };