From patchwork Mon Aug 27 11:10:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 10576987 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 534BE174A for ; Mon, 27 Aug 2018 11:15:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 433322972A for ; Mon, 27 Aug 2018 11:15:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 374072983F; Mon, 27 Aug 2018 11:15:31 +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=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8EBE42972A for ; Mon, 27 Aug 2018 11:15:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wVYb46WeLoxZ38ZQ+O8tfZ3BRGVpYIMTWYYeSS+iSOY=; b=EqD96cZI96mL5z nr66STRjOeFn5Up0iCS1/2kz8LkCchb7f6387gH/9yZj6CgDMKOfTN4FZzab2vpBxkkTI0w7B9hvp HmFFKRDOwKgcyPHMG+GhuXMoslRgpzjfGVeWHYNa9myblTOSf1olScD/8fVfmghiA0SvzYRxD5G6y se7BFY7aVBiZ1ejQ+LEHl87hj+FjPftpVVFkxTdq+A9ShREK9r5IIUx93cVBPs/6B3Zcqtma1uVvQ OujPrm/NYFqpA0RrZiVHgSpe0gvMNPQ8PINdZJ34JvrxgtOpLafSanRHhknFHoDQiwQC6yQvl11q1 cKUG15IrDXiIEdlnCtWQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuFUR-0002Gh-V1; Mon, 27 Aug 2018 11:15:23 +0000 Received: from mail-he1eur01on0083.outbound.protection.outlook.com ([104.47.0.83] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuFQj-0007hJ-1X for linux-arm-kernel@lists.infradead.org; Mon, 27 Aug 2018 11:11:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MZMbrbTCJrsmTfLND9qkbaNvCURQg0xkYrepOv0UU4E=; b=F4YoIiBp2sGiu5U6M4ckfyzOtdcE/z1j3ejsFOS7ydgGw3CCr6Oeht3oQ0epnMnp2+LqgDSSoIQgDXFO1kMrtEeVh+5/bpdCdkVyany8jmwqn0OMSeDENNISmSFLLGuBNHH/DRj+NcpDAobomNN5uRXJ6LwCIsalGR4ptjc451M= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=leonard.crestez@nxp.com; Received: from localhost.localdomain (95.76.156.53) by DB7PR04MB4297.eurprd04.prod.outlook.com (2603:10a6:5:28::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.17; Mon, 27 Aug 2018 11:11:05 +0000 From: Leonard Crestez To: Marek Vasut , Philipp Zabel Subject: [RESEND 1/5] drm/mxsfb: Move axi clk enable/disable to crtc enable/disable Date: Mon, 27 Aug 2018 14:10:37 +0300 Message-Id: <58ec6338ada7fd46af99675dc1268d31d2a15464.1535367027.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: HE1PR0802CA0012.eurprd08.prod.outlook.com (2603:10a6:3:bd::22) To DB7PR04MB4297.eurprd04.prod.outlook.com (2603:10a6:5:28::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0db51431-4cd3-48d4-3668-08d60c0dc92e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR04MB4297; X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4297; 3:eBpJq82PL8aUmSOi1VsoXBqqByiB7lcctbL4ntHf7eriR+na7c9Mr0RZjg6QRgAPtLD940G3YwzyDrO063qkLSX6IbxLW5IrkMA/i2YfZ4kbP1oDKQrcbCllaz5dIqld/MCrSqA96Ddhr/HY+50xBk53qHFqeaBehDkjK3fUcEYS5gRvDzFF6afe46+9DfaQgvesGATnviCP0TrlOSE6fbM/Kqu4xr5oErRGDLnFn72Am83APU21LrYxYuTITYBI; 25:AlgsR9chPeXZW3Z/eOfjEdEJxGO9AuV6phCoX5lFctmKETIU3qQ5r3WFZXy8lK661Hgvfh8WSJ1QBu07Zy7j36pU+kgX5U7subEy0E2h3q16oRe16E7KXLsLGLpMYQbJLAhtg9vRmiKGWLnk60ps87V/EkwEtJ0W+68L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bugNsuiA7/9NLQHe2omleoJMGol5EMn+AI1otMHvLbn9YOZvkobb1cI6PRL2t2THzotvabJUS6Nn/Y/9ALvQR3ph2l4iDPbeuIg9OZc9Oc1lkSOnfGr6KRb7765gsmJqx+21Ce0nMiYHE0dP5MyoDmoaJWI5hHGlto+p32pjkOeBsbsVRtr+M1UzUYJQh84CzVULqD/ehr07lud/sHOYz/KCur9UyJifdf4fyhYr2RDTY+ 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)(823301075)(3231311)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016); SRVR:DB7PR04MB4297; BCL:0; PCL:0; RULEID:; SRVR:DB7PR04MB4297; X-Forefront-PRVS: 07778E4001 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(396003)(376002)(136003)(366004)(346002)(39860400002)(199004)(189003)(4326008)(305945005)(478600001)(6666003)(2906002)(36756003)(446003)(476003)(2616005)(956004)(81166006)(8676002)(81156014)(14444005)(44832011)(7736002)(486006)(11346002)(3846002)(6116002)(47776003)(6486002)(66066001)(97736004)(86362001)(54906003)(5660300001)(53936002)(6512007)(16586007)(110136005)(316002)(50466002)(48376002)(50226002)(118296001)(105586002)(8936002)(106356001)(51416003)(186003)(26005)(52116002)(16526019)(6506007)(386003)(68736007)(25786009)(76176011)(69590400005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR04MB4297; 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-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ZqH9VAIJL5XMXs4xwOrUH/37b6FOv3b7VAt6Sj1VJF4k+9ddvD15Per/szgTv/M1/5qncdZjaEM6sGQNZqTZgIDhy+u/0A==; 5:LILE6nQyPe9+zq6+TGm8lcKabGYct8iJxam/Ht1P/fUzV6xfYTLpl8dPC2LqyiKKLjAlEO+wKzNpTZpYbD2vbl3yh36iZ7t3veawgxYWZzaWUHUQm78OGHEeWbZikU4ytwTPmX2lZrnjMmn+i7GbhgA1Ami5y4qPCnRc9r4DI34=; 7:LQ8pbYCP8njZb9yqv+Fq5+rlgaL224jmpgXVGxUFCHkjzGfV6CinMiVVwhjGZOS0V6doyiSC+AFpj7oa3oWklkdJbDTx+v476E/zM1gOAukHUm8orImGnx1SydPFVBucsnN4S+fzMM6aERYJhg589CzjkBT///Zesn1RTG8te1DCRfkI/IyrFa8OzPU7x4iFz8EuuWRyAjiOn0sdcRlch/nYsf4ceNLI2Yd/x5hum6SyUDmUvh0kF4p5hnmdtGqJ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2018 11:11:05.0988 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0db51431-4cd3-48d4-3668-08d60c0dc92e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4297 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180827_041133_324844_E082789F X-CRM114-Status: GOOD ( 12.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dong Aisheng , David Airlie , linux-kernel@vger.kernel.org, Stefan Agner , Robert Chiras , dri-devel@lists.freedesktop.org, kernel@pengutronix.de, Fabio Estevam , Marco Franchi , Shawn Guo , linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 symmetry. This shouldn't have any functional effect. Signed-off-by: Leonard Crestez Reviewed-by: Stefan Agner --- 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 Mon Aug 27 11:10:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 10576979 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 02BE5920 for ; Mon, 27 Aug 2018 11:12:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E72CC2965C for ; Mon, 27 Aug 2018 11:12:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D99E6296B9; Mon, 27 Aug 2018 11:12:24 +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=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E930429668 for ; Mon, 27 Aug 2018 11:12:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KRJsANGUtJqAKdrJz9VQ9oiYVAI6sM2WO0/9cp/iF+I=; b=CsfgKMyfElGHTw HAni7+7QqUhhYQxTtvVr5QIQmjlXhPsIec4K0rBM8lKWWwn4yGpff/8UltBEztae4vDqTmtHHhLp/ fgATjb7mdOyecWWeZYcjs8YaMe3YjfduKPuEz1gF3mI5zrn51dbj6xSombU4p4wwDlxhDbKUUIWrF 8b0xMkSJScYYgGWoApTQebpfS3i9IDMhwVo/EJASAeVqfiignid8g+aEePX/tJiy2VHlGNAsNo5US kDmsAdC9qtcE/3382dalLJoNp5NE5Ku0/E/7mtKCtFH7zXugddMMEDtR1dFx2PSgthx0uH23F/lD3 W13zOikwkWLarsJP+iIg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuFRP-00082s-FB; Mon, 27 Aug 2018 11:12:15 +0000 Received: from mail-he1eur01on0088.outbound.protection.outlook.com ([104.47.0.88] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuFQZ-0007gC-5P for linux-arm-kernel@lists.infradead.org; Mon, 27 Aug 2018 11:11:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x29FxP6cx8gNBjbFoOrq6u20hsJpDEHgdSSA4sSCqBc=; b=d0m+TiTJaOiziPwLue0z2/PMsQQulUwEE4kLAdiX9FXNwaPGJPMbwIUAotwy7VCnLyTduRyx25tgkXeh6GX3Gg9cy69h4bij7PHu8vP/sbRLe2cOIK0sJFuwFTVIao5fL6PBQO1X1RDJ4IwStt6OLcATwXr+sJTpAjQ0TdKFhFQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=leonard.crestez@nxp.com; Received: from localhost.localdomain (95.76.156.53) by DB7PR04MB4297.eurprd04.prod.outlook.com (2603:10a6:5:28::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.17; Mon, 27 Aug 2018 11:11:07 +0000 From: Leonard Crestez To: Marek Vasut , Philipp Zabel Subject: [RESEND 2/5] drm/mxsfb: Fix initial corrupt frame when activating display Date: Mon, 27 Aug 2018 14:10:38 +0300 Message-Id: <7ce983379410b6c29a16c9f394b382ec16c16ba9.1535367027.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: HE1PR0802CA0012.eurprd08.prod.outlook.com (2603:10a6:3:bd::22) To DB7PR04MB4297.eurprd04.prod.outlook.com (2603:10a6:5:28::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 188589d1-dc43-457e-de99-08d60c0dca8d X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR04MB4297; X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4297; 3:Tm7rFa3LMN9cZMlQ6Ui0AQJgQHUAqV1PBHsTAp55ajvXksNoq6PDBvdWQTIwWG/6KORG7KRwYeIxw3ZbInzBaEP5WdytxVEV/fbe+eya3ogNcSTJjiyeCXvB2bONP4JEvLo5apwWGoD8TltJcY1uAompgVJTOxlw9SK8M45rZNDYuiUqCZ4pg0vMTjyKZF4CK9MotYIjQm4PAGp4ObqCmpE1NbX7pbq01gekJnCnHUi+swmEWhYTbkxQhSs6n9c/; 25:yjE7kVu8IkiRSqkpjaitqEYXhcgIwkAGslomYzaQyd1U18Vxj/EJAht9IqOHqRgfP2XBERaAREhImIu3hsJyCeiS/SFsttO0nYMcdpu1OZcofrcpnUCzCl+K80WQ7g8q6Mf5VOjx2V4WvgDPtYj+MtBpjUUAfWGUoGO5+GJpDA6pey+i+M9dpXlUX1BblMh5TpVXmTYtk/cYkvEIe19CCf9joteVXTo0z4yrXFlZogiY27CyOKdveLSu/SJHQQO3oLdLPwxYkdSGjCaDNi6TfRIthP+6FkTznBIaQo9HFhd6DoBI3uXVp6ykRbtHsEbiR12cUbkic9DTBCcBFgqnbw==; 31:C5fJTy4WO8TOswXYztBSviOtyO7UL+dsypDS6gzp93lwX17nDAiDMgR8puJ7iCgnLcoEuzb9j5XUAcfg2/JxiF/bH2/GQj7snpvOE271mxbWJivmTamrxizilwuf2s4OPjPwbbtHiNogo/8YysN8CKz1TMEsJAlrH5ylKvgTEKY1U2g810HzH5SSSWvJEDuMfP0WsUTPYm2iy+Z2rSXOo8Tz4i+SkMliAiqCP14owvQ= X-MS-TrafficTypeDiagnostic: DB7PR04MB4297: X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4297; 20:mXdd5J0qPyg692OCa6xllCYRYKsg8K9Vc4vMsnrhTxotwCy0Pdm6Ll5apfcuOWQW4T1cGB5JmI8UPzZItN5FMeXWPKZEnmIWzFQ7S0MA/lkG6g3VKVs6OtwSWEkz1T5Owzx3iVg2e+RUk1o+eaNBlARzpOZbvgaHJFusY/KqKUxZdpN8g+6dJlW4nG52ldRhniLMSvyitcq62eMdL8s67j43B+zFuX9IS01xK1SnYnDRglwLrBqmOcYYx4itc+LXHZALtz5mywiwAmdqClgRGzPnu9+KeSqAilIg+8zgma0CN8W+eoaQOu+fCAvmu2na8yaVd/RS19HlXCc6l/Y5K9DJEqTCrfpWWIQxhCqhIVIusrj3Zt3Vqio2jt8kw9N5D1SBWRnNHJdtFSg0Vbx7d01DlImqEknU2gT9KPjYUx18Y9eAdlirrWWEo3QGaWA6OgG8FODqT2O2SIK4v9/IC+Ftw966XjCU8Xvs9GIsVh7tBPditVsDG68/FnV+bmLu; 4:2hA2RCPTx7hFj4JtAZxR5b2e3Z69dJoyf6YxWSdiKzEtFYCAjeISQDA49uljrKUOaJdScN6dPxM9bYeAkYnzgbn2Ou3QM7bYe5Zn3NoGDb+oubYdZawBV9a8lkUQR4NdF6E891SR5ZmUQCIKQ4+etbLkJK6tXlU6mnAiRXvmSBfQJwfqxdgPfxj+G4Xi9bfgkxbAFACjMCLY8nMTrRH9dwrh2sG8vV17sa/jn06OhXjkvpYxmyVOC6OEmAS3+JYErugQ4whrVT+jsSudsM2WT8cOKu3UJc2T42E43hb4igkFVtQQGs7tClrGKP26ksVr 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)(823301075)(3231311)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016); SRVR:DB7PR04MB4297; BCL:0; PCL:0; RULEID:; SRVR:DB7PR04MB4297; X-Forefront-PRVS: 07778E4001 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(396003)(376002)(136003)(366004)(346002)(39860400002)(199004)(189003)(4326008)(305945005)(478600001)(6666003)(2906002)(36756003)(446003)(476003)(2616005)(956004)(81166006)(8676002)(81156014)(14444005)(44832011)(7736002)(486006)(11346002)(3846002)(6116002)(47776003)(6486002)(66066001)(97736004)(575784001)(86362001)(54906003)(5660300001)(53936002)(6512007)(16586007)(110136005)(316002)(50466002)(48376002)(50226002)(118296001)(105586002)(8936002)(106356001)(51416003)(186003)(26005)(52116002)(16526019)(6506007)(386003)(68736007)(25786009)(76176011)(69590400005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR04MB4297; 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; DB7PR04MB4297; 23:lbip7Y7Vc4wwmIWNxHZ/r+NpU/Nqct1DutwwZHhvD?= rky9DWXgHo/leA474kyYnOojrYyOrWhz9O7L1AlxqcT4dv/q8SRv7mCMHhW0Ur3I5xeQs06ZgTmuPiPcEC2UkQ9wbTUWaR+LIbMx7BpdP8aW6gLOodaEOYTWW9FgwsFLxsc3/ieusEv7a3RMK7x2bOO94jIZVQ/PLou+AS5bvUA713GLbIk1579zClgbY39fk+T+P/YDGn8TVcrmJ9Sd3cQUcPlt572ZxA8uuch1yfLDX+ffaDKVcFUAN7q6r7yu3EGL4SPiQxoMcW5yzEp/QNTOeoc9qvJT8Trad8RrOxnvURsp8KXs6XCKU1/fuezcFIODG/eEAQaxL4aqNwyHKStG00bTenrRikq1qOxkI1JpjcwbOzWbCbDDVJ/q6ttsTCzjJ3NKkJrWratx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PaTIFkSN3Zi3vvZnTMe+YqGWnZMxUU/g3Qq0fVIbxTLGSEK6C6n4mLITqtuv7hIeZbjtGBy+uItdwOmR2LOW/Z8 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2018 11:11:07.3824 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 188589d1-dc43-457e-de99-08d60c0dca8d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4297 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180827_041123_234743_4A3D4361 X-CRM114-Status: GOOD ( 12.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dong Aisheng , David Airlie , linux-kernel@vger.kernel.org, Stefan Agner , Robert Chiras , dri-devel@lists.freedesktop.org, kernel@pengutronix.de, Fabio Estevam , Marco Franchi , Shawn Guo , linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 Reviewed-by: Stefan Agner --- 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 Mon Aug 27 11:10:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 10576981 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 D40161803 for ; Mon, 27 Aug 2018 11:13:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C315D2931C for ; Mon, 27 Aug 2018 11:13:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B64082950B; Mon, 27 Aug 2018 11:13:07 +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=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 366402931C for ; Mon, 27 Aug 2018 11:13:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=engZ3AbLRlASJoRS/tngqqa2f9aroFdF/STNLFnypXg=; b=ly6Q5N/myMiSr2 4UjHCrwDMPokNIigsWkjqS6VkKfKV/UOdLZdoAgI0D2ZgGtd7J8ZgY7h6rya3T5FUNhuh+mXmiyNG mUaaVCJy9PynuwZpe69ltHKrbTJhJp7Ge+1DpIKbKh9i+fuCPq/oFWJFGpNT6yM09svBWSigG6kYa 8FWVaFt/31Z0BwljtgpIH/nEaPF3/fG/A7v9kYYYF4vD6tL7Sw6uJsRfS5KiOfzJHNJdWeGZBm4BQ SLxiog8e7EYIe7ScTf9bxo48RQ67XkNJ8bWb2JDTs5PfcQOyXPOgLCvpb4hw3+/btWCE+UWnhEiQ7 cgTdEVJvsx4Hti4scUvw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuFS5-0008N5-6c; Mon, 27 Aug 2018 11:12:57 +0000 Received: from mail-he1eur01on0088.outbound.protection.outlook.com ([104.47.0.88] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuFQb-0007gC-CJ for linux-arm-kernel@lists.infradead.org; Mon, 27 Aug 2018 11:11:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1QAhmaXx6KCcyr6kdBHbCSNBB1V8087ar5J2iuHWfNE=; b=xJLzMNQ5Inc8M4Tx9FlYlkaVv6egd16lG3hESyW2cgFhOz/E+AuxHCGM/s8fxUqJRFAz9DQExwIJ+fnPtIXEeqbyFGDhV6PtwKhaihqsJ0FAAu7S7+fYw77IlxFYFbb6EmogPJN4HJ6JDpmUIyR7ZIn6y5CMXnOKb5KEuVGgmFU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=leonard.crestez@nxp.com; Received: from localhost.localdomain (95.76.156.53) by DB7PR04MB4297.eurprd04.prod.outlook.com (2603:10a6:5:28::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.17; Mon, 27 Aug 2018 11:11:09 +0000 From: Leonard Crestez To: Marek Vasut , Philipp Zabel Subject: [RESEND 3/5] drm/mxsfb: Add pm_runtime calls to pipe_enable/disable Date: Mon, 27 Aug 2018 14:10:39 +0300 Message-Id: <22181175cbefbd997596969e1e3addc04063be03.1535367027.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: HE1PR0802CA0012.eurprd08.prod.outlook.com (2603:10a6:3:bd::22) To DB7PR04MB4297.eurprd04.prod.outlook.com (2603:10a6:5:28::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0f6f00e5-7826-41c6-ad15-08d60c0dcbd9 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR04MB4297; X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4297; 3:SXo4Oc16xeUF8QTXzMgnOxvwyWHskd0Spc8MiLj82cMaFDJXVsLYDgJmwQv3JLs7ucLitW7eniw8N1bkJKNzrqd7hicC4ueu7IWggOdK89SNxnslgDA7n9ukmLl0RTEQGN9Ig9IIYlCKD68Cdl8/wnJc/zfE+m9Lea5iPty6ls4pu4ElSOfkSHEfQ55JHIdwgBuSTOqqCa7zRmZo/EHi9b9RtoacdkEk6S+KB/+HUp0cBBjYpy8y8+lAMH2KmxCE; 25:Esfzaml00Nd68lmiz8YLV3RIMORNaJGUMGn9WQyMPIH0osz4yTvpGOjIEdBM2Chn8rkFySQYAqhkO1XZg/J45FGUJHH3Je2kD1vwFl1N46ccNqG4xWSXCAxDjJZCV9PgpIXXc2XYGEkNUp8yqJ6cvcCKtXEwGm1pKG1RinJJGGUnwQFW246keicFlf3mkuRWBW5YPc78e/SOXI2gfBSJf0alKLMrYkyWYnvMhU7oCdGA3I0vvKUZ0hfntme57PJpSIifnQvPFvLUKfxJZlpFk+8UZITdBvWLy9Ym4jBPkZJIrqMY/e8MpnWUorAK9HNdb04mlOpDvjuSCmrXxXjusw==; 31:BkIzx5EtzvkTI5b7KGgne6dG1TKo+VZMRaX0hboRBgsvpHFothWuaV3b5DPLwv6zeTSp4buyRJ57DmcG/xDcbsU9YjDvcCxXFV3wraHLMtVVNZASd6pzqWH+eL2Q5flaaGWOxizaxTCedsXWq4S66e9MAH7LchEw96+8IjBpzoGPS5npUdHlvoA4CH5wnCjCN16nSUH4dTaGprypBjkEySoukuq3hKIA0seOsjor40k= X-MS-TrafficTypeDiagnostic: DB7PR04MB4297: X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4297; 20:NaLhteG2+84coWwGEYVkJP9x4bkfO0uIjDkwyyMaePV7TdCHArZ+dIbhA4ma7/aHdBFNdKP98CKD56+s7BvDreleUfROOP3RhNf8hyj5WgyFQ17BdBcLi68Ah/S91KsQUCcvohr6G+5SspNm2GzU9BI84cnLt5mZtQj33U2+SN6vRaW+hbx5Xy8LiYxnP9lo7hM0JyLE0yCMvQynaQteAS8TVhWGeIg3QGIJ+xPY20RGRCuwL2zTh6P1T3WNxTGn1nksKfiJoTs8WRbdEaMwxRqdZ15H9i+60GLyS23CeCC4Z4AItX9mrQp2Q5frhUAlQ/0Vk1/3+ZaXhHXmpUiBqiRAlL4bT01O/sMjeeknkUinQVWfdV3rvgVw/nog+5Z5JNRR0pCUYVwPLIHDknqQSn0SCAHJEIC7bVZC2G9t8/R3KhF6gOOSRkE8klhd47UlGzncLMf5Xt43pGjpkLSp93QHy/b/5inwinBdaaPJ2OGnw8h2+xoXZJrTL4gHlUru; 4:nptWmhYBPbIKs1sGe9NxMLs4TNGI1iUjvE2u7xhVsuRwO9ErxclmwM2ebVlW5pWeEy+XzcmkkV2HvyYJd/JP+7TLozgcSIBmPncWEFnq916xmB8P/8CiacipmNZtfVLpLPlS8B97jqDSRr226QUEChT1TmfeQ4/TQqJ2UbgolCUuRVvTKgPhxEDvNvaH5Lw6xGJuA/BbpfmvbxjH1j/lDKp4h1pLPJ2J8TFYHXs9oYSCHMw1eHCUXYNRnw3bIx6Fy0C3WFqDUudh3ThvxQJr8ejFYhrVv7NpgmFpSBhe+3B4KGQyJUgmhcefFlXeyA5P 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)(823301075)(3231311)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016); SRVR:DB7PR04MB4297; BCL:0; PCL:0; RULEID:; SRVR:DB7PR04MB4297; X-Forefront-PRVS: 07778E4001 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(396003)(376002)(136003)(366004)(346002)(39860400002)(199004)(189003)(4326008)(305945005)(478600001)(6666003)(2906002)(36756003)(446003)(476003)(2616005)(956004)(81166006)(8676002)(81156014)(14444005)(44832011)(7736002)(486006)(11346002)(3846002)(6116002)(47776003)(6486002)(66066001)(97736004)(575784001)(86362001)(54906003)(5660300001)(53936002)(6512007)(16586007)(110136005)(316002)(50466002)(48376002)(50226002)(118296001)(105586002)(8936002)(106356001)(51416003)(186003)(26005)(52116002)(16526019)(6506007)(386003)(68736007)(25786009)(76176011)(69590400005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR04MB4297; 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; DB7PR04MB4297; 23:z1tAnZm9ViCd5PDep5ImvkaAFjgsRy/ymaR+mInz9?= xYdp6UyyAZ9avE0dnY9CFtRUm6kZutfUFdhSUFshXr/nviZ1q6ZtoYOlUYNXH03xD1GRg2V6JeCuRGxAkxmJ69O68WcW1oRlGvUuAtH5+J6BhrHfW79fmcrkUKl1lmvM0eCe662fr/lRw5Gi1kHsIlFcqWxSXCthT1SjQPejSVz1Nx6Sj1FTQbavaJSmRM7FnJuf29yxqlqDnrURbVwdGj4KLd1fcDxRE85/w0v/e2gXsbCoUo245dL807xIQ9yDVEle20YbBY1nqlKLhaITjVHuaXxYlDRMnDtVlOjBBQHjctlOQRrwyAieCGLjhWcf+YARvjqo1kNjfDBg5YK/g69Isp+2To22eaWLAJF64P8HeCnvViYwEFKitd/2hxdga2fJ8u6rxf0KINwQR5nOzRMCuUX5PfQiXOesU33hHus6uNYyW/S0KGVVR8WCbJ9T3YZcROlG+JxFEBUY956uvu3wfJkTnZO95Q7AX+A+EPmLeHAYhhILx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1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2018 11:11:09.5609 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0f6f00e5-7826-41c6-ad15-08d60c0dcbd9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4297 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180827_041125_453801_9612F1D4 X-CRM114-Status: GOOD ( 10.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dong Aisheng , David Airlie , linux-kernel@vger.kernel.org, Stefan Agner , Robert Chiras , dri-devel@lists.freedesktop.org, kernel@pengutronix.de, Fabio Estevam , Marco Franchi , Shawn Guo , linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 Mon Aug 27 11:10:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 10576983 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 0EB2517DE for ; Mon, 27 Aug 2018 11:13:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 000762972A for ; Mon, 27 Aug 2018 11:13:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E722B296F7; Mon, 27 Aug 2018 11:13:55 +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=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 643B3296F7 for ; Mon, 27 Aug 2018 11:13:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=K7Dh19SvdCL/CJKTomm4LZHmg5ypFiD0lpEjQMPDj30=; b=Z5/nivFrabzti5 f4l6OoQTY+VtDWKWxiIqIDsPOaBWDifBs+hfxE4QS3LaCywGjDdwqhTFuBzqGeZKHxB0X3eJrAb7N Xq07lU39eLfpyhsP512334H9QQC5pPPhDZsMEX1kOQBwnY4BG6YomTDZFV3IU7cb+r6uQxDgw1hKj ssq1INfKEAf2ZUaY00GeNMldvTBa+tAxq9H1UN3nY54mr/K0KE2GXsFyu8/hc51Ch2GML79P7dUC5 yQTwkGnYGJ5at5PEUHAI3JaqKJubkzx4yhSc0pgK++14KcsOhnEB9BjBQNF7hetTop+DT8G7klPR8 y6Rv+I5iE57GaLjLVyxQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuFSs-0000E4-0L; Mon, 27 Aug 2018 11:13:46 +0000 Received: from mail-he1eur01on0088.outbound.protection.outlook.com ([104.47.0.88] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuFQd-0007gC-EO for linux-arm-kernel@lists.infradead.org; Mon, 27 Aug 2018 11:11:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6my6uAMqziLxxqG1qIv87gR90N+afLl9bRdXzQVqn+I=; b=EBO4dTKykZN1i2b0ONTDIW7Cs3tXzdIAYMmwyzyMLkP0UVBlnJr88ut4O6okv4FCG+sCZi/XLJiY0vvAaZ7+Unv3KFruC16t6j/tDdllShZ5msOx6U56Y4KwBcr8C6VObjzCG+HJunRzh3AIUscercvIHtP2eV+i4RFUAwSg18o= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=leonard.crestez@nxp.com; Received: from localhost.localdomain (95.76.156.53) by DB7PR04MB4297.eurprd04.prod.outlook.com (2603:10a6:5:28::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.17; Mon, 27 Aug 2018 11:11:11 +0000 From: Leonard Crestez To: Marek Vasut , Philipp Zabel Subject: [RESEND 4/5] drm/mxsfb: Add PM_SLEEP support Date: Mon, 27 Aug 2018 14:10:40 +0300 Message-Id: <7d661819825a36f4aebe412e7bed8fe24c7292ae.1535367027.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: HE1PR0802CA0012.eurprd08.prod.outlook.com (2603:10a6:3:bd::22) To DB7PR04MB4297.eurprd04.prod.outlook.com (2603:10a6:5:28::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15917ca7-ec2a-4bcd-70f6-08d60c0dcd3f X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)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aOjXNrw4AvOKN3H7VKzSKTJpq70Pr4hQCHPqZ32HiuWiY/fKjWfWOoxwfHzO5yyEDvHyCj/uMad/4oRupA/b04YxrtIqhOFJUArW/0erLgKaaIbwEkELU4eTwK3MP1Ci5xGu+LsZQb/a730XYK6pGoG8bGc9tknGa482VMNHIIT41936VpJpolySvtB5lVmYS4mAL9u7EYiMDXJh7BXw9ict2uWx21c21EDQlkzcAj3ajEHZUbkVxlxrFLvjnZcnQpdgbHGwiaEkZC9CcvKKzEnDhuiYwzS3oGh31jlH/SXp3vITFrmuaHMWOEp6yCqivL5ql/lpVzU7qVZRMttai8Pbvmm6A/wLFy6kn9Xn+TtcIO4S2NoKdyTeZeLUfTen/Xg9KEDX4WXcBU5cN6h8+duNzzJzYizKl8Bl4740V; 4:feJH8dhtarDSjQ/gbFM85mRQPeCYV5z6uNAO3/LxXokxUdOdPDjTjxzalPvG+dphT1f/q1OtiCeEeBoM3W8K1TNQ69UE/LvpG/ZncbkoYhxdNjvOmAdn7xvGPu8z9oKXe/2QO5GWTIGoG7v3w+n3sLDVaGFuPHvwkPm/IzOEMkOTUWh11HNd9GFxrLUOdg9VwtF6JkKVxEpL5y/hL3K0Nhg3yhXRitDVfkbzfq3l+UjMD1wH/T3Vkb7PZlnI/+wrgb8cWd4Ll0THIUBF6cTczvVXB4mh0xt+/bmjTMXmbmhS7NHBEP23ryPyH1ZbHaEF 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)(823301075)(3231311)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016); SRVR:DB7PR04MB4297; BCL:0; PCL:0; RULEID:; SRVR:DB7PR04MB4297; X-Forefront-PRVS: 07778E4001 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(396003)(376002)(136003)(366004)(346002)(39860400002)(199004)(189003)(4326008)(305945005)(478600001)(6666003)(2906002)(36756003)(446003)(476003)(2616005)(956004)(81166006)(8676002)(81156014)(14444005)(44832011)(7736002)(486006)(11346002)(3846002)(6116002)(47776003)(6486002)(66066001)(97736004)(575784001)(86362001)(54906003)(5660300001)(53936002)(6512007)(16586007)(110136005)(316002)(50466002)(48376002)(50226002)(118296001)(105586002)(8936002)(106356001)(51416003)(186003)(26005)(52116002)(16526019)(6506007)(386003)(68736007)(25786009)(76176011)(69590400005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR04MB4297; 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; DB7PR04MB4297; 23:FY3yZAD5sT+ss3dMU6WDvn15ajAZ27E6CgnQQgAX7?= hpjxpuqGgGSIB3so4ewBRGzzHdXVX6U//67YY7WM66XnKUxCBtsAq5LVeWg7vtTMqSK10bY2/KoOJGKeTdpi47EhECq/uTl4pB2sPzI5CRKsQ4FmB6mTrEw2ri/go8rz+vZLZkJ/pe6ZQqtQRdlkuHi5oAUgWebIZW9Z85nCc/UWpzHP+Em4ppIvp3/hQzLjL2O9U2Ha7ALa13vXxxavVyY6gy0/rF6IrwTGhLpAWq8NmfJAxS3xmblwaEnElyF2uFw4PTat2loV/6fVFE17Fc6evVfFV6iScQlIyJJ6+GJhAexv26x2Z3iMi8kg1SlPGC4uwbj7ARijadcFwJYXE1quVSN16K6syYVgmxL9t5gOwLaCNufOFcqnyOukS2guytKXZvoYNgOs2AVoNwCW//avsVl/b/u+BbCjPkNA1oru/SXt6inawLSGUnTt9j9LghhXcHBdy4IJ1BGuJIC6ZpCeFyOGYY4iiZJe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t SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2018 11:11:11.9136 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 15917ca7-ec2a-4bcd-70f6-08d60c0dcd3f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4297 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180827_041127_563440_03FF0359 X-CRM114-Status: GOOD ( 11.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dong Aisheng , David Airlie , linux-kernel@vger.kernel.org, Stefan Agner , Robert Chiras , dri-devel@lists.freedesktop.org, kernel@pengutronix.de, Fabio Estevam , Marco Franchi , Shawn Guo , linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 Mon Aug 27 11:10:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 10576985 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 8BF5C920 for ; Mon, 27 Aug 2018 11:14:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AD0E2972A for ; Mon, 27 Aug 2018 11:14:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DE992983F; Mon, 27 Aug 2018 11:14: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=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DA9872972A for ; Mon, 27 Aug 2018 11:14:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XIfCIoZJkwJ8u7mY6ujrgKwC9F9hMgYVccPpe3BRF40=; b=QQLMzzQ98tRF8Y 4DszK/xqG9qy7pO8g01kNT7uspBQpHAWdR2K+rapkoD8GSTViX6ra7qZMgrP4mQ6rnF8S2VSfiYOm Vhy9ii/TO6EshVRaWXMSD/AR1Aw1eX4ulJNFBDYu7NEsx4D10l6HOuqJPOGhx10j32SO/u3nXCif9 xaLzDj7TwRMF8ZJWLDGR8gpUbLGN78p5q2ie5UusXaRYv8x/UhCeaWP0WWBOpj8J9gtohVMCRPSCw PCGRogeioAX2zcpG3nTRsuzXDo2XkIdrQYRoCa+LF27Em0X41Q6OS2lGRWXGgwkQQj/wjL0m5RAzQ uoqEgSVe2shE5gUggm7Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuFTd-0000VU-6h; Mon, 27 Aug 2018 11:14:33 +0000 Received: from mail-he1eur01on0088.outbound.protection.outlook.com ([104.47.0.88] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuFQf-0007gC-Oq for linux-arm-kernel@lists.infradead.org; Mon, 27 Aug 2018 11:11:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6OuoQ6ME5x9zl8DUCFOnuDh9S4MBGNhyUDs21Ggg0Og=; b=TB2+AJMAxN9/8MQ8PYLTIBkBCCtXz3nK0+W9U6C3C5Npq7Kz2MMtIjro+7qNHXpvAqrYYWGtKq6fBQmTTUX4TeAI+FIlL86gSa+hcE+uzj0rssUOxgmpiNJZ0rW4y45dFiivHS2GIm0QbyqJ0xQ7Xq1XiyNZgCxhxHvCRXQAqDY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=leonard.crestez@nxp.com; Received: from localhost.localdomain (95.76.156.53) by DB7PR04MB4297.eurprd04.prod.outlook.com (2603:10a6:5:28::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.17; Mon, 27 Aug 2018 11:11:14 +0000 From: Leonard Crestez To: Marek Vasut , Philipp Zabel Subject: [RESEND 5/5] drm/mxsfb: Switch to drm_atomic_helper_commit_tail_rpm Date: Mon, 27 Aug 2018 14:10:41 +0300 Message-Id: <1dcf9e3b25ddff3906491a2ce43ac5c1a3f2167a.1535367027.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: HE1PR0802CA0012.eurprd08.prod.outlook.com (2603:10a6:3:bd::22) To DB7PR04MB4297.eurprd04.prod.outlook.com (2603:10a6:5:28::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7a6baa19-2c1c-43f5-be9f-08d60c0dce90 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR04MB4297; X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4297; 3:ot013vanC5Jj+5//rSBJcK1HJPZF92NeiL5viWN0KXmMgn7aErblao+tE/IDydzI0iZqoIKaMI8jMwkxIhjEWgljkePCYhocE/9+7lEeyInRnb1X7axExNC5jDJGnpIZMHEEsqxW2DmUzxRv4Lgi91ocChXLeHgNThTbjKz9gL0YAbZ8j1QrWSLv46sHDIF5IT+aHQe0mlz7rFSmy9BgNJflOPr6gRR+9QCLyOxzjOmP4PUVuBBbQivIihfFh1OT; 25:NBurl/sDJOHS+VlUzMWLwteVLASp14ldHbflwLE7pJQUXTdc0IgVF4znpVFvTVS5OunmmzdWo+xtBDatX2Nb4+zonn52nkmqtWSvlmp/c2DCbml+Rx3dODAaNmzeqhZznO+nJZdmmtPL8z9sYzSIBl1tG/0Zq/cyqSjHP0ar3IoYxSPk3mMm8RHWQM9OyJAKADYmLTykctxhK398VHgRP4q7KM90rG34sV9n4VAxCpMYdpK0KKYGCDfmNAD79BnbffUNbCL1xbYCDlju0B7RDMcAmgP5rnpPqhr5fzy3DbpXkEqAh+uVaC55mK6oykQ4BDM2leerUc0+APmdJs0J7A==; 31:F5AfNW0j5LE4LC9wztaOfvnHMZ7EjGDa3BfcrUNl1+Ciry90H32Dzd/MKjxfUQxzATBDlgY1yt/wxi0bOSU1t/hS/bdrt9uDZaLbGGKdti/au28svllE1agD18IkKgAYR9HBygkuMCiKN3tzcxccNQRubTHuYm8m3DiAm0+ylvp3auFpiaplare7V486ZjfHXvh+tu4I2b5r3Ptt/tzHS0ID3S/TLinWK4ZwI0HpMq0= X-MS-TrafficTypeDiagnostic: DB7PR04MB4297: X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4297; 20:Uw7cIEoYS5anspA5zJhRxd8zunMw3HAfMteUUkPZySnKGluBp4IXJM/BoiexQdsR8R/8k3juYUjmydTEv5g/Iu0RNOiUm9k1FZP/pEvSuUVj0PmtE2JeIAI8sQdRnCSQKsGzNy4XHNIm/w/Onmd1RisCrQKwApcb3+M9pR6Jchmdi7E/Y8KW4Cxu+Sxq0JS8RJ2vMJ8lnmq4KK6P37ehUw3eC288yDy1RCGp+GQ38z+mjzQB2BEei/QdIoUlkgMEr5FQFKsBTSWXWGOu64B6Mco+21RUeLnfenhVzFFdM2URBt6Ygs/XAVhzKmEiJA6OBwh1QmC+IrDHCK6zrT8qQeTR3HYX0fOMvPN9p4StyJIBY45ftagidyMWmLlL0CcmQyn/gQa3c3Z5PeBAVXzGItcdCEjtbvkyWyNzqjt4zS7uYemqtSafKaatPBHkTFKO+ns1R42+PLwpil1Vb6ZPzbjGOyW8ISOBvUZXwRUcAUjr3rlNS7R+uFzKrBDaJrm7; 4:dNlvUITbSXr6y5Z804REN4YtaPe8axayaqQeU76TpPAyUlmtWdoZWrLFoNoIul2i90U+h+sMo4cJoE9+r9up6k1M/iA4CNLGRHM+6a0tDYuUzosAB2tt/VgLgulpkXKufba1xn97/GftaIVLZQxICE6F03ptjF/REvFg4F+6vc8GQpDxCPeoyi/fhZYRBbkR+YJFW68S2VU1iLK8b836thkzSEwDR1NxwnCudKB8TFUkZ3/gJBzU3/xbYJjGRc3ti8tmrV92ZSHAzFbTqtVMO1866NYc6pSJ+pqYjXcn39WRBWWIXBtvxlkILFD5Ke8MwT5kUwz2jblDu2BO0vRXurKe/7dR8aA1NS0+ui57fC4= 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)(823301075)(3231311)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016); SRVR:DB7PR04MB4297; BCL:0; PCL:0; RULEID:; SRVR:DB7PR04MB4297; X-Forefront-PRVS: 07778E4001 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(396003)(376002)(136003)(366004)(346002)(39860400002)(199004)(189003)(4326008)(305945005)(478600001)(6666003)(2906002)(36756003)(446003)(476003)(2616005)(956004)(81166006)(8676002)(81156014)(14444005)(44832011)(7736002)(486006)(11346002)(3846002)(6116002)(47776003)(6486002)(66066001)(97736004)(86362001)(54906003)(5660300001)(53936002)(6512007)(16586007)(110136005)(316002)(50466002)(48376002)(50226002)(118296001)(105586002)(8936002)(106356001)(51416003)(186003)(26005)(52116002)(16526019)(6506007)(386003)(68736007)(25786009)(76176011)(69590400005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR04MB4297; 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; DB7PR04MB4297; 23:9lIlWoL8LLQibNHBvSGMwegJ2a23ddL1tlgyaOVeE?= +V1GxR6cRkLZ3nkVW7dxgcnyMbomwuxp9r9bggsMirEyEi20jeC0GmBXe37ty0Eg8l6FDVkfdHW+Rt8kpXWPzQQ5HS++/z01cppgM9dEQu1HtyVgqOshFCI18xlUcaWzrt3nsL9yiBuMhNW46k4es1hyT1nvNi1MXq8Ues3OV+iRLKZpKNnG759a0FrLQE/RSLWpRTrMs+eyVq7SFot/xwPa2eDUeNDardoAiwE3Xg7INWcyzVxmzU5ZuRZfQgk2s3D+M8mf1yz/+lSoJTo9JLq3RVpQ0VnQJto9CGhP7CYDixBs7DDtHU9Zh9A6mCLmPVGFZ2lsYhkwQxWozfazsnD0YGyMUJVy3C86b52PMuXG7CZUkQe91/81gqRsWHuCNrmckZi7yRMVJX0v3CN5ix8DyvJn910mB55Q89tGvda4OC3o78QpdferhOBL6tREmsKY3MjCgJSFiL213x/q3yJi9YIq1Nky/XIv0nZZDCf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riginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2018 11:11:14.1241 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7a6baa19-2c1c-43f5-be9f-08d60c0dce90 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4297 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180827_041129_852910_25824514 X-CRM114-Status: GOOD ( 13.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dong Aisheng , David Airlie , linux-kernel@vger.kernel.org, Stefan Agner , Robert Chiras , dri-devel@lists.freedesktop.org, kernel@pengutronix.de, Fabio Estevam , Marco Franchi , Shawn Guo , linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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_disable. 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));