From patchwork Wed Aug 8 16:08:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 10563457 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 18E1814C0 for ; Sat, 11 Aug 2018 12:08:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7B582A157 for ; Sat, 11 Aug 2018 12:08:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB4A32A2B8; Sat, 11 Aug 2018 12:08: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=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI,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 8352A2A157 for ; Sat, 11 Aug 2018 12:08:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3FD596E1EE; Sat, 11 Aug 2018 12:05:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40045.outbound.protection.outlook.com [40.107.4.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9208689E08 for ; Wed, 8 Aug 2018 16:09:32 +0000 (UTC) Received: from localhost.localdomain (95.76.156.53) by VI1PR04MB4301.eurprd04.prod.outlook.com (2603:10a6:803:3f::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Wed, 8 Aug 2018 16:09:28 +0000 From: Leonard Crestez To: Stefan Agner , Marek Vasut , Shawn Guo Subject: [PATCH v4 1/5] drm/mxsfb: Move axi clk enable/disable to crtc enable/disable Date: Wed, 8 Aug 2018 19:08:58 +0300 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [95.76.156.53] X-ClientProxiedBy: DB6PR02CA0004.eurprd02.prod.outlook.com (2603:10a6:6:15::17) To VI1PR04MB4301.eurprd04.prod.outlook.com (2603:10a6:803:3f::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1bf0034b-2334-4404-87b8-08d5fd495242 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB4301; X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB4301; 3:1CXoTL0BWH21EwuCrwzl1W8qHGo/GjQrCPzdS8wIZpqrypHPZ1QcrdEfJCm1RUQp76ELyOLtl498bBfSy+uAk03jU/jjiaQIb2Ce9CH5BJmjzoDQjw3cEy9d6n2uXsOiAiTNHxPpNa1PrWklNEHu0HulCq/NQhDOTb6sv/HGVprwBEgA/kkCtW8XtWJFsuIGX9nS1IXRfrR2SSZX82e1ZqGw8jkjb697walbJmppZfgwrpWosit0z4W8Vus2JzSo; 25:Ew2XYCtAoW6PJkWpTt2yOnQGDStKG95VmVRzBoz8+LkVod5+dTU5mV6TGulGPXkl4fdLrGGaTMrNR3UpfQj5d7wtz280MXhq4uq0KCw8QffUpb7iWp8NRoSQKV2oVH7YBAQeiCLI3/mvhBtU7KG/ccKc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5+aMAlCvsrg6b2Fzt65uXE8ZKUgi5IqL5xEzhPteYSxGVsHjz7wu7XPomnVo865mAPYBR8H/iELH5UwcjUTEFQM1mcpHJkxJuLsbSQEjkBJhKjPGG1Zxs1nW7G5JFLFDLvdNUtvzHlO6sG3hVOuryUO1n39UV6/NfJC2ikSpXq9FVdgbrZMqjQrao9pwf1DfALmx9wKQe3h1Ffw9klNNYsPzAS+Cx4nwjy28BviLWa40hYUErRQXK3yiv3OuZrDaitKV/FKhxdI X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:VI1PR04MB4301; BCL:0; PCL:0; RULEID:; SRVR:VI1PR04MB4301; X-Forefront-PRVS: 07584EDBCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(39850400004)(376002)(396003)(346002)(366004)(136003)(199004)(189003)(66066001)(7736002)(76176011)(47776003)(6512007)(81166006)(68736007)(81156014)(25786009)(8676002)(6666003)(110136005)(54906003)(36756003)(14444005)(305945005)(106356001)(105586002)(53936002)(50466002)(6486002)(97736004)(48376002)(86362001)(4326008)(3846002)(5660300001)(26005)(486006)(16526019)(186003)(316002)(2906002)(16586007)(6116002)(6506007)(44832011)(478600001)(8936002)(956004)(11346002)(2616005)(50226002)(386003)(446003)(476003)(51416003)(52116002)(118296001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB4301; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender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m9cmNpetRwMXT7+1I606eLttXDcdLRIsTpD4aqkp5Ydg41fev13zZRVOTmoPGFVVoCaTPqUow==; 5:75JOA6qwalN84Rp74Pi9qrEh3GObHby/ZW6KG7YfwH/XbF2vuAtR8uUx7A20UbDW+9Dp//casZYdXH6JIgg8j8DpZx4ONHCLzEaT/YdQk3NhO6c+P5NhCFzSDmCjKR0rlMtOVAKad664pDiOGzeZETfNbomOA3Pmju1fbVDPHIQ=; 7:2TLuhXsnk1bK9X6u6JHgvf/KesDIQ0yI4keNMWnY7YjO5HNOR04O4+N+zFc9bI9BHyUBL9jz7hu5MgSuetf9MpTC/aRGFr2RvLH7B2ZWCjniNEVqW+mbs+HoilFJjb/Fgu/Iev01c8MKoM4DQ0u380iJnbDSh6VUGo7Z0HUvKV3oQUBe5ntaEHEHQW0v4D3Sku2fOktWir+zInex33Vg4TEFu4959b+0QVMNNJxV5wNJWw/IE+q+FzJB96Xeh72w SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2018 16:09:28.4199 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1bf0034b-2334-4404-87b8-08d5fd495242 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4301 X-Mailman-Approved-At: Sat, 11 Aug 2018 12:05:13 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dong Aisheng , kernel@pengutronix.de, Anson Huang , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Fabio Estevam , linux-imx@nxp.com, Robert Chiras Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The main axi clk is disabled at the end of mxsfb_crtc_mode_set_nofb and immediately reenabled in mxsfb_enable_controller. Avoid this by moving the handling of axi clk one level up to mxsfb_crtc_enable. Do the same for mxsfb_crtc_disable for simmetry This shouldn't have any functional effect. Signed-off-by: Leonard Crestez --- drivers/gpu/drm/mxsfb/mxsfb_crtc.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c index 0abe77675b76..e4fcbb65b969 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c @@ -127,11 +127,10 @@ static void mxsfb_enable_controller(struct mxsfb_drm_private *mxsfb) u32 reg; if (mxsfb->clk_disp_axi) clk_prepare_enable(mxsfb->clk_disp_axi); clk_prepare_enable(mxsfb->clk); - mxsfb_enable_axi_clk(mxsfb); /* If it was disabled, re-enable the mode again */ writel(CTRL_DOTCLK_MODE, mxsfb->base + LCDC_CTRL + REG_SET); /* Enable the SYNC signals first, then the DMA engine */ @@ -157,12 +156,10 @@ static void mxsfb_disable_controller(struct mxsfb_drm_private *mxsfb) reg = readl(mxsfb->base + LCDC_VDCTRL4); reg &= ~VDCTRL4_SYNC_SIGNALS_ON; writel(reg, mxsfb->base + LCDC_VDCTRL4); - mxsfb_disable_axi_clk(mxsfb); - clk_disable_unprepare(mxsfb->clk); if (mxsfb->clk_disp_axi) clk_disable_unprepare(mxsfb->clk_disp_axi); } @@ -206,11 +203,10 @@ static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb) /* * It seems, you can't re-program the controller if it is still * running. This may lead to shifted pictures (FIFO issue?), so * first stop the controller and drain its FIFOs. */ - mxsfb_enable_axi_clk(mxsfb); /* Mandatory eLCDIF reset as per the Reference Manual */ err = mxsfb_reset_block(mxsfb->base); if (err) return; @@ -267,23 +263,23 @@ static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb) SET_VERT_WAIT_CNT(m->crtc_vtotal - m->crtc_vsync_start), mxsfb->base + LCDC_VDCTRL3); writel(SET_DOTCLK_H_VALID_DATA_CNT(m->hdisplay), mxsfb->base + LCDC_VDCTRL4); - - mxsfb_disable_axi_clk(mxsfb); } void mxsfb_crtc_enable(struct mxsfb_drm_private *mxsfb) { + mxsfb_enable_axi_clk(mxsfb); mxsfb_crtc_mode_set_nofb(mxsfb); mxsfb_enable_controller(mxsfb); } void mxsfb_crtc_disable(struct mxsfb_drm_private *mxsfb) { mxsfb_disable_controller(mxsfb); + mxsfb_disable_axi_clk(mxsfb); } void mxsfb_plane_atomic_update(struct mxsfb_drm_private *mxsfb, struct drm_plane_state *state) { From patchwork Wed Aug 8 16:08:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 10563429 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 86D7913B4 for ; Sat, 11 Aug 2018 12:05:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 602652A2B8 for ; Sat, 11 Aug 2018 12:05:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 526332A532; Sat, 11 Aug 2018 12:05:44 +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=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI,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 D7BF02A2B8 for ; Sat, 11 Aug 2018 12:05:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 28CAE6E1A7; Sat, 11 Aug 2018 12:05:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40045.outbound.protection.outlook.com [40.107.4.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2E0A289E08 for ; Wed, 8 Aug 2018 16:09:33 +0000 (UTC) Received: from localhost.localdomain (95.76.156.53) by VI1PR04MB4301.eurprd04.prod.outlook.com (2603:10a6:803:3f::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Wed, 8 Aug 2018 16:09:30 +0000 From: Leonard Crestez To: Stefan Agner , Marek Vasut , Shawn Guo Subject: [PATCH v4 2/5] drm/mxsfb: Fix initial corrupt frame when activating display Date: Wed, 8 Aug 2018 19:08:59 +0300 Message-Id: <056bd70ef7bf4d66d636cf7869a489e8c743aaf3.1533743954.git.leonard.crestez@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [95.76.156.53] X-ClientProxiedBy: DB6PR02CA0004.eurprd02.prod.outlook.com (2603:10a6:6:15::17) To VI1PR04MB4301.eurprd04.prod.outlook.com (2603:10a6:803:3f::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 737d53ab-a6a2-4911-dfa7-08d5fd49533c X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(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zI12Pv0i5JjfF/MkuF+Geb/jJdwWwrdZu7ekRdiFb+vhEZdhPwMfVMzF5SFWlYDzlRY+RFi22K9UCFWyrU8dZB41Bp9pgsUuIfI9vOZpdDcbed0JS+SRcmCQCc5Nd5Lbn2T3XddWX503GEO8Q93l92W7WKAQ5SslMK5JNUMzhwcKfmF92jnzpqyB5cedDro0FT8Rqq1QJYSw2++kRR1myVlsEQRNUI/qaVAQAieUuYJG6v/8bpjyKmSjGPYoepDIXWCtxvNmOeE2MT6XsU1qwAEVu1tX2a2N8K4TEMQvi2zS62LYCL++8CZw+9nA+YQLr+w7ep7LBfGDq56hNVzHU5Fb09xZUeTHxH1F9yiE2zSVZibF1WZ14KeLrA9tighYaQz1R+9YcupwxayWnr7GYNbDndI/eQahSLlBT1VOW5836mayZcdvQEvdDdjNh8t0kx/Duj; 4:SwqgO+yDCqeFaCHZSf1/A2g3lyMUCXXBuADD+soF34jupon+cFhMdTBBWbLe6T7G+mL2wItSQr7uUZ6uY8M3AGCWsZIbkqR2VVpGxZsYiI68u4+Z9D5KW/8IUQguNUrIIFSR8U9mAj+1DUQq9ZeJWse75mKzqvAOoIVfyCnckzgRuOphTtBUA0Eu0FMn19FCz51N2BpRycCCI4ym2FPYCvIjikVrUpCmKMXMh4YbBhGWk3ycWPpjcZ4ty0LFLZU2Sm+pWLU41WVneX/9u4kv5W2o+tXwNdab+Nx1JDoe6iojC7MjQkhRhzZYICF+e/pK X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:VI1PR04MB4301; BCL:0; PCL:0; RULEID:; SRVR:VI1PR04MB4301; X-Forefront-PRVS: 07584EDBCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(39850400004)(376002)(396003)(346002)(366004)(136003)(199004)(189003)(66066001)(7736002)(76176011)(47776003)(6512007)(81166006)(68736007)(81156014)(25786009)(8676002)(6666003)(110136005)(54906003)(36756003)(14444005)(305945005)(106356001)(105586002)(53936002)(50466002)(6486002)(97736004)(48376002)(86362001)(4326008)(575784001)(3846002)(5660300001)(26005)(486006)(16526019)(186003)(316002)(2906002)(16586007)(6116002)(6506007)(44832011)(478600001)(8936002)(956004)(11346002)(2616005)(50226002)(386003)(446003)(476003)(51416003)(52116002)(118296001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB4301; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR04MB4301; 23:mcnipxJWYD0RphA7Pvbm6dbRq7oxUInNFfz9lif91?= FZU54zospCZDeYA89PVRT+yQD1FizEM361qLqZdbPo8xjV77eUhUnpDYD6XJH+C/UmLgp6Y7FB8FMc+9cx6UXUI0rjp8A7PnDRnFXRkwoHB/IxOjM7fiomAeLwaE/3zR/v3jOHUnxCa2UvMAfhnROVaVfHR978n7hRGeAXXSO/iand6p9oZj+Ced6FlOZXaX7PAkujawJVgzzs2ZejcM6CvYng0EBY1iFi79s9NYpB2DCM/TghMwujPh54Sk7/F2CpCMarFwTqlyw2TLeLITPQ1MUVpYlyATmohpX72AI4O8Pbu50QryY+WWHNMZQ1aqkB/zYnTmhV44W40LDGQs71aE53hufPB63hwtZgpVDtni2GtqtvPor8gpv3DPbpf3kqP+BANi/xAAqznL1cNGULDD1frYi7Ee06LE009VP3aevnAmLf59M3qvx5vm49NVO7QHcpnNhmj1KREq4SOXMQs7PFRq5QY7DFQ+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ald47c2wdkCe15W2Jvf22IWsBXjhonils9+iUc1DxPnKOAvz9bKX/cxZwRtVWg6YgYRNHl8= X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB4301; 6:uoDQhwEd8koZP4XyOKk0J/48lgbXLNyTXL+Q/hPSJ6bFw3SgTypdyp1g5u9f6ol1qRSSAHx6MJp8+FuNWa27CeLjrb3k+cnz/lC/CUGsNGmFTlLYWS3t7bUPQTFH/S3c245Qr0v4jnLo+yIuFm/fa6cfymPxrNP6xyaDtQ8QYkgozpdJ3yjQu7xVXtjNwdiRb6yZH/29aGVqGXXrmmYimb6FrVC7aMVjS7m8DtP7GGhX3qR5R1H/MAYloF27Z38DACubuEP98DnZANQsILMBnjczBw3FWb3sBA6v3dZug3AMKK54fpRyuf96GV4BkCudkRwtstiwV15w+I5L7dgSC0IyN1wJXAbmyThxxuPGQniSMQPIJRFeSf1dKvFBXZ2blwv5WbdpwBU7D2lmWmHpxqj3FuDaRz/sdX61I6vahBA2H5eENKj33J+eedzxx7lC7ww2ce2r/2QGPheI3+CP6w==; 5:XWGcNnaLRaldHfzmST9EC3HelZ/zUAr3kaW3UoJztt5S/8mO5EeCkLP5NOHQkBEC839coUBeiDW87oUou6LbVbpe0DWdQSnaLinz3j8BJW9VfvfyFHL5wt0CfJvyZCsCuLbvbkGJYaDy3dapxtw6DtZKmYxulvZE4auWQbS52vA=; 7:iaPmnkpKQOzzssjS5aS+AQyI1vbWAemz17gZ83i2AbXyWKZFn+QRjrltR25ep9pqDBBcZwcNhVaZip6Wmf2sqqkfiEdpocW+97jaMRfKH+Jj7llufZy9bf01jfwl+k5OWjLWYedC70f6EowfWJAGBC3ENWQLHSAX1oEVu8Cilti3fC39zHwmOeHnLPNATOcyHBWJA3HxxJlpT3nXk6i99lHS24s+K6ysAl3da3WklbxhrpnM7fDlywoNbvtAnsnF SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2018 16:09:30.0606 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 737d53ab-a6a2-4911-dfa7-08d5fd49533c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4301 X-Mailman-Approved-At: Sat, 11 Aug 2018 12:05:13 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dong Aisheng , kernel@pengutronix.de, Anson Huang , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Fabio Estevam , linux-imx@nxp.com, Robert Chiras Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP LCDIF will repeatedly display data from CUR_BUF and set CUR_BUF to NEXT_BUF when done. Since we are only ever writing to NEXT_BUF the display will show an initial corrupt frame. Fix by writing the FB paddr to both CUR_BUF and NEXT_BUF when activating the CRTC. Signed-off-by: Leonard Crestez Tested-by: Philipp Zabel --- drivers/gpu/drm/mxsfb/mxsfb_crtc.c | 45 +++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c index e4fcbb65b969..24b1f0c1432e 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c @@ -191,10 +191,25 @@ static int mxsfb_reset_block(void __iomem *reset_addr) return ret; return clear_poll_bit(reset_addr, MODULE_CLKGATE); } +static dma_addr_t mxsfb_get_fb_paddr(struct mxsfb_drm_private *mxsfb) +{ + struct drm_framebuffer *fb = mxsfb->pipe.plane.state->fb; + struct drm_gem_cma_object *gem; + + if (!fb) + return 0; + + gem = drm_fb_cma_get_gem_obj(fb, 0); + if (!gem) + return 0; + + return gem->paddr; +} + static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb) { struct drm_display_mode *m = &mxsfb->pipe.crtc.state->adjusted_mode; const u32 bus_flags = mxsfb->connector.display_info.bus_flags; u32 vdctrl0, vsync_pulse_len, hsync_pulse_len; @@ -267,12 +282,22 @@ static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb) mxsfb->base + LCDC_VDCTRL4); } void mxsfb_crtc_enable(struct mxsfb_drm_private *mxsfb) { + dma_addr_t paddr; + mxsfb_enable_axi_clk(mxsfb); mxsfb_crtc_mode_set_nofb(mxsfb); + + /* Write cur_buf as well to avoid an initial corrupt frame */ + paddr = mxsfb_get_fb_paddr(mxsfb); + if (paddr) { + writel(paddr, mxsfb->base + mxsfb->devdata->cur_buf); + writel(paddr, mxsfb->base + mxsfb->devdata->next_buf); + } + mxsfb_enable_controller(mxsfb); } void mxsfb_crtc_disable(struct mxsfb_drm_private *mxsfb) { @@ -283,16 +308,12 @@ void mxsfb_crtc_disable(struct mxsfb_drm_private *mxsfb) void mxsfb_plane_atomic_update(struct mxsfb_drm_private *mxsfb, struct drm_plane_state *state) { struct drm_simple_display_pipe *pipe = &mxsfb->pipe; struct drm_crtc *crtc = &pipe->crtc; - struct drm_framebuffer *fb = pipe->plane.state->fb; struct drm_pending_vblank_event *event; - struct drm_gem_cma_object *gem; - - if (!crtc) - return; + dma_addr_t paddr; spin_lock_irq(&crtc->dev->event_lock); event = crtc->state->event; if (event) { crtc->state->event = NULL; @@ -303,14 +324,12 @@ void mxsfb_plane_atomic_update(struct mxsfb_drm_private *mxsfb, drm_crtc_send_vblank_event(crtc, event); } } spin_unlock_irq(&crtc->dev->event_lock); - if (!fb) - return; - - gem = drm_fb_cma_get_gem_obj(fb, 0); - - mxsfb_enable_axi_clk(mxsfb); - writel(gem->paddr, mxsfb->base + mxsfb->devdata->next_buf); - mxsfb_disable_axi_clk(mxsfb); + paddr = mxsfb_get_fb_paddr(mxsfb); + if (paddr) { + mxsfb_enable_axi_clk(mxsfb); + writel(paddr, mxsfb->base + mxsfb->devdata->next_buf); + mxsfb_disable_axi_clk(mxsfb); + } } From patchwork Wed Aug 8 16:09:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 10563465 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B75D914C0 for ; Sat, 11 Aug 2018 12:08:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92F532A157 for ; Sat, 11 Aug 2018 12:08:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86D312A6F5; Sat, 11 Aug 2018 12:08:53 +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=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI,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 3446A2A157 for ; Sat, 11 Aug 2018 12:08:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DF33A6E1ED; Sat, 11 Aug 2018 12:06:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40047.outbound.protection.outlook.com [40.107.4.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id 867D289E08 for ; Wed, 8 Aug 2018 16:09:35 +0000 (UTC) Received: from localhost.localdomain (95.76.156.53) by VI1PR04MB4301.eurprd04.prod.outlook.com (2603:10a6:803:3f::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Wed, 8 Aug 2018 16:09:31 +0000 From: Leonard Crestez To: Stefan Agner , Marek Vasut , Shawn Guo Subject: [PATCH v4 3/5] drm/mxsfb: Add pm_runtime calls to pipe_enable/disable Date: Wed, 8 Aug 2018 19:09:00 +0300 Message-Id: <5b434a3d8b2968552e9bdff9eb5c78266c3bb28b.1533743954.git.leonard.crestez@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [95.76.156.53] X-ClientProxiedBy: DB6PR02CA0004.eurprd02.prod.outlook.com (2603:10a6:6:15::17) To VI1PR04MB4301.eurprd04.prod.outlook.com (2603:10a6:803:3f::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8a3e8284-ceb8-4fbe-fc31-08d5fd49543b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB4301; X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB4301; 3:HCY3JrMiwzZGqdMU+3Ofd4ivnwTTBrgXVR+/+bhe7oOkeScxDdhvswd6FYI7QcIJmfoIL7w78mv76k4+CsfJAJfzfMVvHNeA/Kae0ZCt4v7lWspkcjQz7ZdauDCGgSFE80BrvwKefVHKPohY4ixyDkZFcrIVK56L8sqE2yPrV+efXhRyzlNUO8spuuwJdJHOvsfrO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UDF6NBNfVmpXHTh01YIR0jMZ8xzbDOUxP3uPC6yAxJhTpN1lGpSKwa4oZFFrlZM+a66sUAE4WEphgjxrsmTjkgCyRaePrfmNXa767KiaSJLpeodafiBb8AGzvAzdKa1gG2Py1B7tiHNHSLf/mWbvm+Y; 4:EIGGgQEOVtLQefZV6qnkvCEpnNSg/DGJD+q130izkHPJ7ZPD1dOhbO2hV6tJ1+kfrDMyWI3YQ8N4ob0ICOcS65MjK5jzEir6wbR2I/TYe61sZuezHdvSMcf1bhFjNx2HltdyexoS3Ik+gpVlfWbX6CCNJvYgqJennZ8xX0drSyYdNjpaKYQYZ2B2yDzlxzIB2BFVxqNUrvoSbVdGaVyNMgs0i98DyJnEX8+n7wTEU1v29ATE19PY2zovlrVWNyg14zg771CRQ612GGKmT2bvz0bg8rcxP+UZbZDxWs615+8rxACbXdMu3UOx6bPMBjnP X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:VI1PR04MB4301; BCL:0; PCL:0; RULEID:; SRVR:VI1PR04MB4301; X-Forefront-PRVS: 07584EDBCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(39850400004)(376002)(396003)(346002)(366004)(136003)(199004)(189003)(66066001)(7736002)(76176011)(47776003)(6512007)(81166006)(68736007)(81156014)(25786009)(8676002)(6666003)(110136005)(54906003)(36756003)(14444005)(305945005)(106356001)(105586002)(53936002)(50466002)(6486002)(97736004)(48376002)(86362001)(4326008)(575784001)(3846002)(5660300001)(26005)(486006)(16526019)(186003)(316002)(2906002)(16586007)(6116002)(6506007)(44832011)(478600001)(8936002)(956004)(11346002)(2616005)(50226002)(386003)(446003)(476003)(51416003)(52116002)(118296001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB4301; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR04MB4301; 23:a6W7MBoGtyGyLRWRsAfUmXb44FY52HCrj7WXmy1z9?= OjDxRMWtGzvswikUOL2Fk1JIyLVWHx+y+60czaNpUENiCjdOiTJKfgnStAr6Gi8L2RBtsfFzjsF124MqYtYqmOHYiJQJC/Cpn8oJHcxFlQG1M0J0lGnDNH/eQyROitQBarTlQZarN7HsFFv8Fpyyt1bdJzxA/m5jWzXILnr+rNlBUzI6U9iGZyKkbveF27fByo4rewVvvGQ0sqcFPvVcPgmXBbCrt466iykG2KJgW/TdrSo+qGcgCCZ56xIAGmM0XmR1vzNLOUxyeUslaw8W9sLZuJ6lmCTnbVcEgL0nMPYTouplPDCQe6zjn1n9wF2RAQS6XnCFDK/3pnj48/Wx24bW6vwONTEG/k4zXOGkzQuJt+w6LBeUrW647uclGHukyad4BtXTTpRh8x5Un7iO/OJXBSuqjOwc2QtmRWDZX39ThZWMkJxurBN2VQkxt10g1X05j8GF22I/d4p6X7IjETeONGyR0SW/0S3tHJ4NDwgFbezjdw1EIEe/5ZXT5kXa1TnJ67k9zm2Ym5uQ0lZI+C2lhrCXv4XXtZPVyCFjk8k2cESQYNqbpI1c8Yv6BDoM9I0PY1R0kiOj0+RtvXOv7pkwQvvSHzVXjrPv0ijDLs8o/AgcO2O+O1isgzTb0uxNbuv80qe+jhPwUcK595D6LkMyuXBPdvSspYCKe+h5sdmfCOKA9NyokRVu66MIF2ERPY0NxIMt0wVdXVszfwr6I9ByuVXN5mBUEBgTG/+B19N+9bryQQOrje/T+BVKyVlsTb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Nij8G73Zb04xi/KaPyA6+LKzrmRRUVIjopIe7VydJPgTxdHMurlru9oXBhfZ8AIl0e6m7NADg6ikNDjbHpA1HvI+m+cXQoJJZNZ/WBd1IOGX4kSTt/JaEQ1ty+WdQmBRGT3nTLmnUB24WaBAdImu7NJoARkqfPZsLUKY+PADMJ1TsKysREJEkMnNkAtis6CeUGRnQo56PpUyk9CKRnZAtm2rUfgYvxJyDs/Gi3Nqix7gKEn6AHY3+rEjh7syk8N2iyeEY8sPrVXK5HhEcKFkRAj75hrQ8H8ImRSQ1brrwblkaQy+Mbgg==; 5:VBOXR5MhUkQDKl+1q4oYN46BYpnINq1R/oDi/IDEhzITfYZF/GmlQPW7UU7fEdDLIKStpOHzqOInQMHYkHFwlmkFh5NOAR+IUgU3oCA0IO9nE+cDaoFvky8V+Zzx5TpmvCdz0DoH50Y5CpD9MJpjgSBZxzfJGNvtRJsIQSqYM8g=; 7:ULHRbynEAfEdJJlDFeTstpfFeZ6dF1Cpp2otlxr8vzdgbWD1O45fYDkO5o6l4TS3EZKp00Ig2O4fastr2OWETWfSJVIIItXR9K+dXHFpb7upgJBNdjle71/mM3OkoJAWZy8RWf3ufTFpPpHY1xPQmf8Iz4fdPfERt2MOY7quCIpYqVWMLlZaocvdnZSoByFDUTHQwfe9gt84plSy0iqN5SJzlWI8Gk0UKLcPUedYeiHouQMassFujXruC81/gpON SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2018 16:09:31.7325 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8a3e8284-ceb8-4fbe-fc31-08d5fd49543b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4301 X-Mailman-Approved-At: Sat, 11 Aug 2018 12:05:13 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dong Aisheng , kernel@pengutronix.de, Anson Huang , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Fabio Estevam , linux-imx@nxp.com, Robert Chiras Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Adding lcdif nodes to a power domain currently results in black/corrupted screens or hangs because power is not correctly enabled when required. Ensure power is on when display is active by adding pm_runtime_get/put_sync to mxsfb_pipe_enable/disable. Signed-off-by: Leonard Crestez Reviewed-by: Stefan Agner --- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c index ffe5137ccaf8..68d79f5dc0d3 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c @@ -101,23 +101,27 @@ static const struct drm_mode_config_funcs mxsfb_mode_config_funcs = { static void mxsfb_pipe_enable(struct drm_simple_display_pipe *pipe, struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { struct mxsfb_drm_private *mxsfb = drm_pipe_to_mxsfb_drm_private(pipe); + struct drm_device *drm = pipe->plane.dev; + pm_runtime_get_sync(drm->dev); drm_panel_prepare(mxsfb->panel); mxsfb_crtc_enable(mxsfb); drm_panel_enable(mxsfb->panel); } static void mxsfb_pipe_disable(struct drm_simple_display_pipe *pipe) { struct mxsfb_drm_private *mxsfb = drm_pipe_to_mxsfb_drm_private(pipe); + struct drm_device *drm = pipe->plane.dev; drm_panel_disable(mxsfb->panel); mxsfb_crtc_disable(mxsfb); drm_panel_unprepare(mxsfb->panel); + pm_runtime_put_sync(drm->dev); } static void mxsfb_pipe_update(struct drm_simple_display_pipe *pipe, struct drm_plane_state *plane_state) { From patchwork Wed Aug 8 16:09:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 10563439 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D147D14C0 for ; Sat, 11 Aug 2018 12:06:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADD7F2A2B8 for ; Sat, 11 Aug 2018 12:06:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1A3F2A529; Sat, 11 Aug 2018 12:06:49 +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=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI,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 589442A2B8 for ; Sat, 11 Aug 2018 12:06:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BA2D26E1D0; Sat, 11 Aug 2018 12:05:15 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40047.outbound.protection.outlook.com [40.107.4.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4A85889E08 for ; Wed, 8 Aug 2018 16:09:36 +0000 (UTC) Received: from localhost.localdomain (95.76.156.53) by VI1PR04MB4301.eurprd04.prod.outlook.com (2603:10a6:803:3f::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Wed, 8 Aug 2018 16:09:33 +0000 From: Leonard Crestez To: Stefan Agner , Marek Vasut , Shawn Guo Subject: [PATCH v4 4/5] drm/mxsfb: Add PM_SLEEP support Date: Wed, 8 Aug 2018 19:09:01 +0300 Message-Id: <3559b9b99a8a48042ee468034e5f1d538ffbd081.1533743954.git.leonard.crestez@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [95.76.156.53] X-ClientProxiedBy: DB6PR02CA0004.eurprd02.prod.outlook.com (2603:10a6:6:15::17) To VI1PR04MB4301.eurprd04.prod.outlook.com (2603:10a6:803:3f::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b84b282f-d218-4bf0-f1ad-08d5fd495533 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB4301; X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB4301; 3:jX6pmXQTFslrxamkqUQx3DaCijsu2h1PMDq4l+d4+9hw1/gnKzEEu1JhTwTEx1GPXF0urNBMJlY4dZmBsoWxCm5orLVxWJtTy3JTnrgD6R/vaxFmaFQ/tEjwDh54j2STq9oNVIslLOfjt4+3pvgGN0SkX8QODldWBss0mkgElc3QsnGMQbQaayqQJWnvZKP/NSZNqJH2fNP/vI41D9CyybjNnbVGQdkTmvWIgDgoFTkyk9ZdyDJydIKfKA29oRbX; 25:Sw1jVzwYqpbUfKG/RsHArpoalnb8VvgsYiJktyvSfYkSrVehkgsckghe9x3V6fpuKqayl56UiF+5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qaAtbQnrRTQ+gTZiwq; 4:mjVFuRImG3k2vkYd8UkJQAgHYMXIaaFFjqsAbRWfwoSFjLXf5trglUKG9rsp7knNTOkyO/oRWETY4qeD83HiHPISelJmIHfdxW9gzpoxdQZYP7/HVhUB1jOknFcYiT9uvnPY0BmOp1D1jAiKD/RfRJgMiiof+B+ZB4qfKCxY/XyKgy9dj36TeuwdCEMCZuPo6eDgZw+jUbj/6F8oPl46XHa42gYJQgM/GUOQdK45EodulBKnNmPRvGHpHIyzMftz/xnLfsW14KW64M1q0cU6t4hd6MFpMcYyFYbbDoScjTv9gF/DCq+tRgE/uHpXmaTr X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:VI1PR04MB4301; BCL:0; PCL:0; RULEID:; SRVR:VI1PR04MB4301; X-Forefront-PRVS: 07584EDBCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(6069001)(39850400004)(376002)(396003)(346002)(366004)(136003)(199004)(189003)(66066001)(7736002)(76176011)(47776003)(6512007)(81166006)(68736007)(81156014)(25786009)(8676002)(6666003)(110136005)(54906003)(36756003)(14444005)(305945005)(106356001)(105586002)(53936002)(50466002)(6486002)(97736004)(48376002)(86362001)(4326008)(575784001)(3846002)(5660300001)(26005)(486006)(16526019)(186003)(316002)(2906002)(16586007)(6116002)(6506007)(44832011)(478600001)(8936002)(956004)(11346002)(2616005)(50226002)(386003)(446003)(476003)(51416003)(52116002)(118296001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB4301; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR04MB4301; 23:gXc/v81EvW1lWIVbVkKoy7/ohBVA+eVilb4GLycYT?= nmtRTKwN2PADGxiMG0WrSclDq4V0x0XNyl8qEANlFIpR0aNvPZX4Ke6hRvW8RFEpwMgzuTa/uP7RgoMC58vy0nYNDGhtaaiiMS9LusAK23vyz0SuMzKg0YmKWIIPQkyJmfWYEZdH8gsQ3mHg0te6EjQXcBYKODhQaUVxLTG2oXxn05lNqdcZvXNn8OQ7F5j9praP5zWn3VVJw02DFRhRzRENRH2lJ6gcadlWQJxyGIg8Huj0vXSNFimcZz5OQF12N/vPv5Cg7LOUfJDio2h1+C6FJGtMpn5VueTeWmjZUfBlJm/tcho7CIA5vlExl5YZBc9Jel/PUXflazjUFMJchU1lViNkVi70LSHhyVj113282IkNghPt6FPmA6ep2gxpKL5WRMZA4RxEcs8/yh6xr/J7jC4qlTeCHZ1X5tvjsC3Mzs0P0qFY9g30xHIcOLaly9oGRvC6aAGqpKsYgIbHDHn2BsgIduccpo5+bkeia1d0uCGOHGwzKIyMzWwxzH7qrrhLTsG5R+35jdxx7mDtWDs55x6bc3abIwdPlcYoCcQhusb8U4DZFHQZub8WSQUxSeWWtKFu11ATFhaLlzzpNCJoiSCKazwsEJoBMrO4cVKmt/wVU6VKyKtFDYN8Mr3sRB4DE743NvOBEtY/V/kwFOvVcCqg0qHQrOcmO4JEHVSKjcKOqGq8u34CSpY0kBJjzaWF7Qyzxw2RwnF/S5NWgv9eUUXBolePLQuYnxbssAk0Mhk7NUwFD//cs4QonmJCo9dmBMJlStOEmvHXx6Y9jx0m7fktyy6aa8dDSa+OXrSeisQgE1MiaFCROMfPbar8a7bCQiy8PSoRvYROFBU/m8j6QEWKU9+njp+zsGG19s7k53tvi02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TWQIAKoDU5xidKcVd5YUAtM1l09lK7ouMBy5wHfWio/aYRNi9qmTULs2qmH3vG8bxaRwlQ7VTv/x5phekm6g5ugrLZSUCp/ihcjBXO1OCBM4pFkqkhB6D+TJIDqa06cgEbgn5VlrEtpp/mnhW0ezDpeuYVStlTYpkRkDSN5oxdAhIiS73irej/UYHePT8oqIke9KgIuVxMd464uvM9b/CH8I0wJC28UvMbygNDTk+Dnl4+y/+YXLQliut51YedIt3KcD6HXqpCp399cdkbzf2KQow4yBqQxgZeStMVBZYqVTA==; 5:AxLlDEpyEmihhayK/kxK26TUGGlf4bsIu4YZbUEyqnH9EwQVu+9CRfvQTD6l+p5VO5BASH+h2KIVreGauJdEByHbrTk55zlTMV7rnfdxUmAxfrYn/B3huECBf4cY/EjLToAtiaucd9w3FkRdrTxNzqCAVUILanluTMXJgzoz034=; 7:gPM+XmeYtGtat6WYqmgqf426tiNTY1tOLHGlZuKEhtVuirVTghb2aQJ8qM1tXJv2q0tmuGa56TxLK0dTAEr6rmfcv1joj9ovmcMaxnFeuMMAG+OOpLl9oTEsF4b/zCzyfhNmsi+3CCPieM25ROi10rs/d3NmgAcTcAOJ8kZ6YP8161D9hY5oODTtvuECISx/WUcBFwzUU8kLau/9UrGmfbXbtWqM/jk7VFSY64q3N1q/BZc8Zb8HeBX5q+w98jZ+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2018 16:09:33.3731 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b84b282f-d218-4bf0-f1ad-08d5fd495533 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4301 X-Mailman-Approved-At: Sat, 11 Aug 2018 12:05:13 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dong Aisheng , kernel@pengutronix.de, Anson Huang , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Fabio Estevam , linux-imx@nxp.com, Robert Chiras Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Since power to the lcdif block can be lost on suspend implement PM_SLEEP_OPS using drm_mode_config_helper_suspend/resume to save/restore the current mode. Signed-off-by: Leonard Crestez Reviewed-by: Stefan Agner --- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c index 68d79f5dc0d3..d797dfd40d98 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c @@ -416,17 +416,38 @@ static int mxsfb_remove(struct platform_device *pdev) drm_dev_unref(drm); return 0; } +#ifdef CONFIG_PM_SLEEP +static int mxsfb_suspend(struct device *dev) +{ + struct drm_device *drm = dev_get_drvdata(dev); + + return drm_mode_config_helper_suspend(drm); +} + +static int mxsfb_resume(struct device *dev) +{ + struct drm_device *drm = dev_get_drvdata(dev); + + return drm_mode_config_helper_resume(drm); +} +#endif + +static const struct dev_pm_ops mxsfb_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(mxsfb_suspend, mxsfb_resume) +}; + static struct platform_driver mxsfb_platform_driver = { .probe = mxsfb_probe, .remove = mxsfb_remove, .id_table = mxsfb_devtype, .driver = { .name = "mxsfb", .of_match_table = mxsfb_dt_ids, + .pm = &mxsfb_pm_ops, }, }; module_platform_driver(mxsfb_platform_driver); From patchwork Wed Aug 8 16:09:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 10563435 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1A64414C0 for ; Sat, 11 Aug 2018 12:06:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBA602A2B8 for ; Sat, 11 Aug 2018 12:06:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DCD462A529; Sat, 11 Aug 2018 12:06:10 +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=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI,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 226D82A2B8 for ; Sat, 11 Aug 2018 12:06:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3090C6E1C7; Sat, 11 Aug 2018 12:05:15 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-am5eur03on0619.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe08::619]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8468B6E5C7 for ; Wed, 8 Aug 2018 16:09:38 +0000 (UTC) Received: from localhost.localdomain (95.76.156.53) by VI1PR04MB4301.eurprd04.prod.outlook.com (2603:10a6:803:3f::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Wed, 8 Aug 2018 16:09:35 +0000 From: Leonard Crestez To: Stefan Agner , Marek Vasut , Shawn Guo Subject: [PATCH v4 5/5] drm/mxsfb: Switch to drm_atomic_helper_commit_tail_rpm Date: Wed, 8 Aug 2018 19:09:02 +0300 Message-Id: <172ea0eeed9f129632cc1e279b922e637dff088b.1533743954.git.leonard.crestez@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [95.76.156.53] X-ClientProxiedBy: DB6PR02CA0004.eurprd02.prod.outlook.com (2603:10a6:6:15::17) To VI1PR04MB4301.eurprd04.prod.outlook.com (2603:10a6:803:3f::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: faf649cb-ff57-46e8-0e5d-08d5fd495633 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB4301; X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB4301; 3:QIrcTrEVi4Wv3YshR98XWFRbvG0LGpdeBn9LentCBmzaCmIQUeYG4gLicCEVF2W+uazlz1I7LGaIEZNAADg10+pELxT2R/3IDViduOlWeKeEEGoXkbX8OJYYlnsfPwbn7TjHzkO7lwIWXd+1xoadYn85UzSBlojBSO+4XEgyFOn/STcK0beXjKYDG/0yjc5RlDGvR1leTjMJLTXsHdf2+KTQeeklJ38wVx8AHy6N2sH6fxIZRhBl7QqYD0a7u80+; 25:1rnwf2PVPGdTH9Kg7+X+ozWdKem3jQYIJCGL20keD9FdfplUjphiWIXmfYo9CcMctAU7UNpCMRm8Jh/awu493Vdu9rPiRMR27DqkO/pxQ9jxn4V3XWuuAcLG1aIgGLEjb1LOyewM4ykSkQVSJL45aW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beD62DXtt9Gvuw8nNqocZoDdxAsDW+oW2ZIGPi2ZHZT58KqKmlPYEyQqfYm+gnN7pK3Wnw7z4WE4sG2GnND/Cfr37woFRPiTcVEVhmdDCHrMMoGty+/xsfx4X910snnLKIQL6hzKfMaGtm+UGg/3QlrExATr37XYo6ZMlwCkiooGchl2BAPkgb+L3m8J1j2r+SdKg9lJix513PX0X64LP95wEpJdPOZscexOc2TeYiIRUtCMqk09cpUK0zLtBGP/1k0+Lw0UQxxqsBINdwwH2LnPzjf7Ro6VdUfAfMXqPgjx+U= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(17755550239193); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:VI1PR04MB4301; BCL:0; PCL:0; RULEID:; SRVR:VI1PR04MB4301; X-Forefront-PRVS: 07584EDBCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(39850400004)(376002)(396003)(346002)(366004)(136003)(199004)(189003)(66066001)(7736002)(76176011)(47776003)(6512007)(81166006)(68736007)(81156014)(25786009)(8676002)(6666003)(110136005)(54906003)(36756003)(14444005)(305945005)(106356001)(105586002)(53936002)(50466002)(6486002)(97736004)(48376002)(86362001)(4326008)(3846002)(5660300001)(26005)(486006)(16526019)(186003)(316002)(2906002)(16586007)(6116002)(6506007)(44832011)(478600001)(8936002)(956004)(11346002)(2616005)(50226002)(386003)(446003)(476003)(51416003)(52116002)(118296001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB4301; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR04MB4301; 23:KKEEZg0OLqhOYBVO38jYtB4cLLmZfGQFTABQLgpv6?= RQ1zbfyzEmMIkLN8HuuYZkJczaGDUzQOkeBmSWyb0j9a+nqGkpWmnNUlWCxNQjSch/Llg2SCoEqeB6ddfn5Q0DRvBS2Tofv4uu54B3viHVUadLccvlVgmTgboJPBR6Qdyc1TjDBVUIdAvbju2kQNhCr2rbJFSaBlsenwIUjrnt7LCrq14WcDGKotBtc4rJ2RF/qvm//NdhGtPAaNqxXIyYHGtO/mJwjgI8j4kLp1BekhWA2w3xryAwcX071TkiKZnJM2I92tIBywDi9B/wAB15Up0f0Zpg/LXeq/uVbj26brvcTo08N56/gAUgfTXEtrH7wDL7uGKoOfFy7SrT3OlulhCoFEsYhLx4ykCZ4TmQPcDXmwffKIagKbUzGvKEyparo7G6No7C7vvqKrTt2BpzYRLJvm/Rysec1jnN+RsNIzPNr01xppoHZsKxF26LYtVHnboNfMd0zk7Y0JjH/fPnc0nppTZB+icKIv8iIG/JyEcC4BF7Wf9GhlRKvYViuyjtfZeLa3uMyASJiy6g0nE+tuFXw5ZDGgC7PsMPhSkRfcl7xP9pYeW8aMsqPsmOPh6TeHyU7VSyqED40U4iz5TuO1onFavc37uIzoF6p/NQGTbfdZaLrRCj8bJJp9GG8QoUElD66v4b0qdSQ96nJmw9/N8DYTq0iPNdfzAxGA30gg9EjKB+TavrZeJu+wBys+j6iQZCSt2EqW6Nw4i6d88O4WkPkc1TAy63+0DLg3kYwcTKtm4UM53Hur2ZgpBos4EcHtEthLWXX4kfYbRBCPVC17Z8bZpNUYt271zjgNWV12iLXB3tQIxbygH6GNCDcOhTJuI9JWTt1bq6/JHinpGC0UzOwWi0QUatTjWq8sMePTbpuTJX2Rq5rnHerl5biJzcmOxbqHy9/pFqc8N3mMMuWsDILYtDGcCCBRtx9JtMFtpyRf6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3kVf4zSyCEVfD3w0sTc96Y79h2kEo9vnH1cYjYkEc3wDNLjB9ghYk7eaFUTYvG4Rt8b32MbS3dattiB24Gcs6dVwMRrVqMTJus+rkZc07fuVhqpBFKA==; 5:9epmmeeh0602XlssYix2bbD/yoJ82hk62nbF/cxEmsZcqLhHUV8Eoc5VJQrbpEYz3JI2wYdCF8JCDdVe62vT1Fi2CpD9097EfLjgMkogqJQuVjy8vIf59i/cpzOCS2bAmM0w7+90WiyN1BVZLw5s9c5rxCoqRl9K2iV+K7a7HFI=; 7:MAvVU+LYVQU1P9qSGIWQdBzM6FWQOGuJICT8eHCm+y6eruf0R/pSdT6iEDiShb1aEVXNPjeQjWuHW5YP1XxfmNUIE73vnl+77DBNiill8xiKURFVdtQoBwtzWFG51K+4Xw8Mw+b0LwBIJbCObYEFZ4qY/l7y58X7xUm0bADno1NycIluqV4bTtYO8lj6bqLYPeI+4wwR5Eo5G4P1sgvqfz+DeIausdbq2fAljQIbREORxsSJit1I5xGGmohXl89m SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2018 16:09:35.0294 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: faf649cb-ff57-46e8-0e5d-08d5fd495633 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4301 X-Mailman-Approved-At: Sat, 11 Aug 2018 12:05:13 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dong Aisheng , kernel@pengutronix.de, Anson Huang , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Fabio Estevam , linux-imx@nxp.com, Robert Chiras Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The lcdif block is only powered on when display is active so plane updates when not enabled are not valid. Writing to an unpowered IP block is mostly ignored but can trigger bus errors on some chips. Prevent this situation by switching to drm_atomic_helper_commit_tail_rpm and having the drm core ensure atomic_plane_update is only called while the crtc is active. This avoids having to keep track of "enabled" bits inside the mxsfb driver. This also requires handling the vblank event for disable from mxsfb_pipe_update. Signed-off-by: Leonard Crestez Suggested-by: Stefan Agner Reviewed-by: Stefan Agner --- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c index d797dfd40d98..5777e730085b 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c @@ -96,10 +96,14 @@ static const struct drm_mode_config_funcs mxsfb_mode_config_funcs = { .fb_create = drm_gem_fb_create, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit, }; +static const struct drm_mode_config_helper_funcs mxsfb_mode_config_helpers = { + .atomic_commit_tail = drm_atomic_helper_commit_tail_rpm, +}; + static void mxsfb_pipe_enable(struct drm_simple_display_pipe *pipe, struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { struct mxsfb_drm_private *mxsfb = drm_pipe_to_mxsfb_drm_private(pipe); @@ -113,15 +117,25 @@ static void mxsfb_pipe_enable(struct drm_simple_display_pipe *pipe, static void mxsfb_pipe_disable(struct drm_simple_display_pipe *pipe) { struct mxsfb_drm_private *mxsfb = drm_pipe_to_mxsfb_drm_private(pipe); struct drm_device *drm = pipe->plane.dev; + struct drm_crtc *crtc = &pipe->crtc; + struct drm_pending_vblank_event *event; drm_panel_disable(mxsfb->panel); mxsfb_crtc_disable(mxsfb); drm_panel_unprepare(mxsfb->panel); pm_runtime_put_sync(drm->dev); + + spin_lock_irq(&drm->event_lock); + event = crtc->state->event; + if (event) { + crtc->state->event = NULL; + drm_crtc_send_vblank_event(crtc, event); + } + spin_unlock_irq(&drm->event_lock); } static void mxsfb_pipe_update(struct drm_simple_display_pipe *pipe, struct drm_plane_state *plane_state) { @@ -232,10 +246,11 @@ static int mxsfb_load(struct drm_device *drm, unsigned long flags) drm->mode_config.min_width = MXSFB_MIN_XRES; drm->mode_config.min_height = MXSFB_MIN_YRES; drm->mode_config.max_width = MXSFB_MAX_XRES; drm->mode_config.max_height = MXSFB_MAX_YRES; drm->mode_config.funcs = &mxsfb_mode_config_funcs; + drm->mode_config.helper_private = &mxsfb_mode_config_helpers; drm_mode_config_reset(drm); pm_runtime_get_sync(drm->dev); ret = drm_irq_install(drm, platform_get_irq(pdev, 0));