From patchwork Fri Jul 8 09:41:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 9220345 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 16D4A60572 for ; Fri, 8 Jul 2016 09:41:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 06EDD28638 for ; Fri, 8 Jul 2016 09:41:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF9202863A; Fri, 8 Jul 2016 09:41:51 +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 4E5B628638 for ; Fri, 8 Jul 2016 09:41:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F0C026E8DC; Fri, 8 Jul 2016 09:41:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0081.outbound.protection.outlook.com [104.47.40.81]) by gabe.freedesktop.org (Postfix) with ESMTPS id E3A5589B98 for ; Fri, 8 Jul 2016 09:41:40 +0000 (UTC) Received: from BN3PR0301CA0022.namprd03.prod.outlook.com (10.160.180.160) by BLUPR03MB1490.namprd03.prod.outlook.com (10.163.81.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.534.14; Fri, 8 Jul 2016 09:41:38 +0000 Received: from BY2FFO11FD003.protection.gbl (2a01:111:f400:7c0c::139) by BN3PR0301CA0022.outlook.office365.com (2a01:111:e400:4000::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.528.16 via Frontend Transport; Fri, 8 Jul 2016 09:41:38 +0000 Authentication-Results: spf=softfail (sender IP is 192.88.168.50) 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.168.50 as permitted sender) Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD003.mail.protection.outlook.com (10.1.14.125) with Microsoft SMTP Server (TLS) id 15.1.534.7 via Frontend Transport; Fri, 8 Jul 2016 09:41:37 +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 u689fBMv003192; Fri, 8 Jul 2016 02:41:35 -0700 From: Liu Ying To: Subject: [PATCH v4 09/10] drm/imx: atomic phase 3 step 2: Legacy callback fixups Date: Fri, 8 Jul 2016 17:41:01 +0800 Message-ID: <1467970862-28012-10-git-send-email-gnuiyl@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1467970862-28012-1-git-send-email-gnuiyl@gmail.com> References: <1467970862-28012-1-git-send-email-gnuiyl@gmail.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131124444982464098; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(6009001)(7916002)(2980300002)(199003)(189002)(4326007)(48376002)(33646002)(87936001)(6806005)(81442002)(50466002)(586003)(73972006)(83322999)(2906002)(73392002)(55446002)(92566002)(77096005)(19580395003)(76176999)(50986999)(5003940100001)(36756003)(82202001)(229853001)(86362001)(575784001)(106466001)(2351001)(11100500001)(87572001)(104016004)(110136002)(7846002)(305945005)(8936002)(47776003)(61266001)(105596002)(81156014)(68736007)(50226002)(76482005)(6260500002)(356003)(2950100001)(19580405001)(81166006)(97736004)(8676002)(189998001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR03MB1490; H:tx30smr01.am.freescale.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD003; 1:6UbO306uczJZhNR/CeBgwfNiS28/0PKJGR5w/obwRcYiMNJ/qyPeYdyOz9dawdT641hqlFXR1psA7jr+U3lqxqeqjHQlZVxmmnPI9E1DhhrnB64Pv9pafxbu3AFL4W9XE5tyzkMEIUV2j3ZGeszXmAtTHzQShvi0tZjeRng7CcIMED+WrijiyD7Qkl6ssc05dgbutF392MO67eHsX4W/MPuiDxWsNeOyOvuN8nSa2JTd+otJq1IExHSEO5Xx6CtQKI6dXRV4GRMWYVccLZMP8Wnfnx3G4i0ZMVQuiHBuaWPmSnFVB2RHHLUP4XcmDrBKyFLMsPBrdhrpsFX/8jNIJJlFJuL7xACcAww2wxzpZEkYpvly8uQQVoKtnJkhxawejQPu6uWr9t8yUo0eAqm88aaMdgqle7vQzkAKAZbpaDRbnpZtPvKHXbKGOeV73psk7jewI4zVjMsHgG0qyTW/E/pFKWIxQhTLKgCuk8MkNbfraHQAUSc4iW4wP2vAH9qEa86XzraJO4w4mKwlKFJQZFGAsC+zbhjSEu45kYkSgkkBs1qutG//xL9Kq/FEf7AJVg4jmrI4TP0HfqkTKvHAiQ== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 7f767dc7-e3b2-44aa-0098-08d3a7140eec X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB1490; 2:ASgbtns6vwE6LMuh3mRqXZgIs1Oe07OpuxGOcDbVBj0da89Eye1bOtnLRuQJuSYKIkl5/lly3qxpT4qjYoWFXOJ9m8NZTP/m0hRjjy94Lfi7Qnb2xlLKIL8tIwjr4lc1amdrfpAuWCUzQXIO4M1AcKad7Oqwr042ztKJWf5q3C+6yN1d5avFXzToPZbrshGB; 3:JRHydnlJo7zo49gVak3H2M9kXM8vwO2+a9ZABxQ3On+K7XKKQQaZdUZrft1Pvpi+uuByzYWP6ZO5YkRjp61JmRJgMkQgEUm5DuKi/yMa92GzpyqFbq91JlRV1mTxNUO8+YkclOmeYhSh2YfOegfQhAeFAAHYoAiqmxuzpM+j6hlT2az7nzq2Q8lAz87yDU4k/92CwUxtzBeltXJSqE+8sHTJe5RmapAe2sVz8qKYWMU=; 25:JVaUpCHQr1C+GRo6i6oIPPyRNPHzC5iAPV/oH1tJcTjX4DneJo9TKnBpJ+7wsAmltSRuMPTBx/NW5CDs3pOzZdn0uot6JwS7MC1db+yHzvYQQ8ox6+F+LTBVYoQ4IxAlRWLE8xB5QTpnpkzK377F9iDUlaAQxjRoH8kW2lJ4WcLD1GV8pFuXprScn6Q8YimuOT8BM1xynWbql4DxJIr5b+OTj0phcsPi90kzmJGXpF51nKs46377s+jGqD0XS2kDn8wsPp8kkJ1Kv1GR3C+GKWizrol1At1UkS4EWQxbjlVMM77Xf5RSFXDs2+g5FYo4MFikHM0sOSokAExmJgiw11U94h2TDFSeV2q6tT7GZoiKlehEuY8uObnq9ERT5MGwGwCxADmiLmRLfab0IPnIEbd6ZSzol/KhZVV0PcYBNhM= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1490; X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB1490; 31:hM9qgy7wBQ6htTARpv7b33sYndSefk5DLLWV8kU98VOhfZEEiTrXQPH7LuF6+QiWoG8l6jQJyZX4AJ2Z+sc+A1CsXbNTfmOMoORRBArchF9OEbvtfqDZf4Q8BTUTOUemzRaOV0PDaJKTdBVWI9QwRSSJIB3EK3MiQiCU63HP7Rirltr5nWxUNLAZSLxzOmZuTw8o85AVnaN6tR7P5dh2oQ==; 4:Zqr6mmD0pJbnVW9hc8+z/fTeifxH2d1NrbhXOCv68zDDAOzXQj9ee5feWX7M+bSNVKnVNdqf8A1UsCN9FFts7TPyfNV3bWBC1gLav9W2QU2TReRdxnkuwgHNU4v7ooBWlGQFNHrp3jJi33ZU60eS3U1BPgcznkS4Y25VWjLv8YxTkO42gPWGuR0tT3CBG+L8AfvT2EoI/vjga6pUw1vWIpaGpfM2xwhhXxGfFAthE/XriOOfNWnlNr6faUcmofqYHdNZdnFTNY8AYRGE8papKSVtxbPzW6n5mUFM66NAuqYZ/2rDPwSgrqP2yWtsUwQOcAkUfIXwiudcfV2k45h5ka7lgz+85zv+e6vpJKikIkV3nNp9GAxrC6Z/T2WQp3HzgCI034A6FqtzBAMm/1BQJX9Tgg4j83sQInXqIHfebiZnC5MJokzMgm5pAWGXGjKa774p1YSZJXQfINpCCIVmO0sZDFDN8AIp0gQ1OyJZALs= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13018025)(13023025)(13017025)(13024025)(13015025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:BLUPR03MB1490; BCL:0; PCL:0; RULEID:(400006); SRVR:BLUPR03MB1490; X-Forefront-PRVS: 0997523C40 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR03MB1490; 23:atCLgLhsJMmU7VAMutXPpeJB0776J29VYuuyBVq95?= =?us-ascii?Q?wJhLeRL6KSdWkTvE8SuKE7186Ig+pnoJeoxIy4sfJ4HE73sfeHii+5l7NgWs?= =?us-ascii?Q?fORxV3QMdN0nKvXPh63MJqyh97CbV5sqauuB1Rk1TPP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MQ/AKElbFuXs16aGaqZII8=; 7:O/pQsmyy9NV36vCgdBgf/UUJZ+EVqFoLM81k9B1h3xOMuorJcHolNumHWO/5AIoJUbnkthJ4c/rr3aFQqRNllPEsn1Fk7YlszXzKXTKZ5bntBtYbpbxM4YEbgI3uxUVBn3Wo9ymt9/4Y2Fccm5tMW50NmzpdmY3Ew99EKiNz4LYxXsSiVSsE2DeCXWS50C48FB5aem0v4bnnXoaCuODEbwdhbYf7Wt5jb7didZWMcuMzLvPJv3AWlNtRo6nZqKP1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2016 09:41:37.9032 (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: BLUPR03MB1490 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 --- v3->v4: * None. 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 6e110bb..9c48c4b 100644 --- a/drivers/gpu/drm/imx/imx-ldb.c +++ b/drivers/gpu/drm/imx/imx-ldb.c @@ -172,10 +172,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) { @@ -204,7 +200,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); @@ -215,8 +211,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) { @@ -356,7 +357,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, @@ -375,9 +376,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, };