From patchwork Mon Sep 17 13:42:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 10604021 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 746EE913 for ; Tue, 18 Sep 2018 09:59:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 641A529C91 for ; Tue, 18 Sep 2018 09:59:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57CEF29CB5; Tue, 18 Sep 2018 09:59:06 +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 32EA429CA9 for ; Tue, 18 Sep 2018 09:59:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 54EE76E3B7; Tue, 18 Sep 2018 09:58:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50043.outbound.protection.outlook.com [40.107.5.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id DAC5A891FB for ; Mon, 17 Sep 2018 13:43:01 +0000 (UTC) Received: from localhost.localdomain (95.76.156.53) by AM0PR04MB4290.eurprd04.prod.outlook.com (2603:10a6:208:67::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Mon, 17 Sep 2018 13:42:58 +0000 From: Leonard Crestez To: Daniel Vetter , Philipp Zabel , Marek Vasut Subject: [RESEND 1/5] drm/mxsfb: Move axi clk enable/disable to crtc enable/disable Date: Mon, 17 Sep 2018 16:42:11 +0300 Message-Id: <985c1f1cad250bd9ca154b3e4b3f913c310eeabd.1537191359.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: HE1P190CA0028.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::17) To AM0PR04MB4290.eurprd04.prod.outlook.com (2603:10a6:208:67::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5141b6be-3402-4a08-4023-08d61ca37bc8 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:AM0PR04MB4290; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4290; 3:euyD/ifS+Rt6vdC147PwqekihPwl0KcG0m2cdn5kOpj1Eqtn6P7aQ6hIuUCZZm3uiDXXDASR0p5xv5Cgs0S08tUm/zWGTSSryUfbQrRURt+4736BmA7u+hlbwj7+Kgw1qGly1ny/4snEBSul1yAVtFp4KEkqF38SqxRgxmxsbvNwa2KjN2ZfAuKfXi5DUjfnf5vf7x1pg/6T+NLTzyLJQVe7cXef3hwf/9OQJ/TjyNPYQh7qcYbWRQkhN9KJno7t; 25:oj11VN/aikN+AM18iLEUasAt7XUYHwIfZ2IEFQ6s67hXfJmDeRpEQ9tqAeiFWlZtSzjVNulvMF/4XfqAXrnd2G1Fq4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+NvdcK; 4:7FF17BWFvg00MizJ+TqWfvBq6LjvmwYyCz/qwxqWVkdjlV1o/UwAZQclZlNiz7YxTC58YZsdlS3Ox2B1Ceb1Zde26LC8u1Gkgelr9m6GCHUmQLx38+BjUT9Jl18Ds02vmQQeufmHQRU2E0qxrPMPdlUUdXPkk6YaaLpFSk4kWu+gjlVA3MpbTzS+AmsKDWZu7BGuRzfnY2VuB1QyqDEHw0XPmM2tdINE5zJyCGS33TvZxGK76ElbdMEaCNANgSqGL8+D3dpdFjtkkGNFqKbdO8JRRlaVq4CBHDoJGWFJIywStYokSty8sYKAAhfFRQ29 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)(93006095)(93001095)(3231355)(944501410)(52105095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699050); SRVR:AM0PR04MB4290; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4290; X-Forefront-PRVS: 0798146F16 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(376002)(396003)(346002)(136003)(39860400002)(366004)(199004)(189003)(6506007)(81166006)(81156014)(8936002)(14444005)(50226002)(478600001)(16526019)(186003)(106356001)(3846002)(6116002)(105586002)(97736004)(47776003)(26005)(68736007)(50466002)(48376002)(66066001)(6512007)(2906002)(5660300001)(118296001)(11346002)(446003)(386003)(110136005)(4326008)(7736002)(6666003)(476003)(956004)(2616005)(54906003)(51416003)(16586007)(86362001)(305945005)(6486002)(44832011)(25786009)(53936002)(36756003)(8676002)(52116002)(486006)(69590400006)(76176011)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4290; 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; AM0PR04MB4290; 23:K7c/0WtT/ILa4Irj1WikohINOha9fKSs9TjMsX/99?= nTjTHqgql4sDolsBQPU5GOeHWj8Y3/u/ecRPcIG7n98e8JTHdDZvePbdvjWMy1uOXSnoMwiYr9BK0ySlvyOcEUvBNe9m1zOX/LKCtnu4UQSG8f/a4I9uQFuINqMZGmwUp1ioCGuHngIKu4I4Mt+kUSBwJxIRodL3xkBi7Wo2zZlp03kyYyReFTtXw/3Jk63kfePD+EQt3lkafUMLNNPANlFi6zlksq2b2slZ4v/qDs156T09jUrCu5EeiOHfQ4fQxCdPeXTGk7sN5tGBS7B4PqlY7QyHiP1yq0b2Z8kscMN8KSREw3XtfLi5boYAnpXEnHl5hOoNf0UWWmqvwW816KAa1Cm+ttj7V/lk82bSyAeX9cmA95zs+Vg463Sh//j31LeKUivMG8qU9A3+ORqPt5ZBWWrKYt385dLmQGS9ykj94nRBGVUZi1SKfwzfevPwv+mdklf4SNf79kdAzJfSCRj7eWcuAy2CZvQeLZW5AyEN8x2ugpr8KiGf374XLeSPVyaaMpqKPFlRPtRhlvpCCrxwPQqPhDj24KpzVvh4kuR9Xb7HurfpiWxvdI7kOzNsq+AQaAN8mjaZhMz5/Iehx5ESGllhfqHYjhCv6hjntPG+20IRb6KZxyAy/kLx3j4htbz+for+5X1D3qUqc8yFl98f0r03Zq6LBr6T2OJ9Psog4VkD2HxPrO4AiQnFmZ3DrSHJTw7XG+SduReBTPkyXNR/VjDNWg1/0f97UV5VF1oLRa9eQbGDMxJ542M5mzBIRnKDO1PXUDLdhHu4RdmLCAH+Xzk8s3vSobBNRlFPu6sQwFP5uRASpsY/9t9Jvg661Ep8RMEk4AgUczpcXBJWbKVDcqw/uULc80s75/Vc+uOpnW3QOUjk0ZxP5CSyfx96pZNDxopPoX5X9oE1lrty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tIVJKLmOx8VilW1fij3wE5834Mgg3aBXVv40aO2XfmrwuAQxd4v8GJ02swQt/fW7xP5bl+xdgPGDAPWLXlFvqNpp4qKShD6oenc8YNJpRqLik079bMq6Z4NfV9jEEoK7IMFxccxVxIXyZ34YNKJXQmtEaztrAc9AjS+Ed8/xBQAdhuICtfJebuG5rJ+MQ==; 5:6iRzcB3KdYDZWBb+60Vx8rA49UrYQ+FUOv510mNMoYUzC2mEYgkipHufXQN5P6ytGrmT+cKZzmH2YFKdVNArzyXCpKIuYXzIOh74iH+Ck9HzOt4k2MABZIo/CwFBUmhXYSpSCHzrXi3vCndWouLSFMtY3vga9VdvzbfWLTrNHwg=; 7:S9DwPALEGgKDJWijAllg7hO14g43lcG4gGcLiV4U0s2VOvr4rbgjIjhckM5r44xFQLIqEuWpN7UjFBWAnHKOCk6sh4JFdZz/F7PvpG3vOTWMMICLxDcJVYSuyc7SDp3A5XcbrD4QpiDPTZEyAozUu6hhuWZq5VmkUD97zADNIZsd9RsE7nv1cpEBMY+lAvbZx8i720Dy7VKbq0frFIRVV73C9psHh/tRreBL6SyiRdrR5kCx/w7o37uJHqeQHq4c SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2018 13:42:58.7112 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5141b6be-3402-4a08-4023-08d61ca37bc8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4290 X-Mailman-Approved-At: Tue, 18 Sep 2018 09:57:51 +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: Anson Huang , David Airlie , linux-kernel@vger.kernel.org, Robert Chiras , dri-devel@lists.freedesktop.org, kernel@pengutronix.de, Fabio Estevam , Shawn Guo , linux-imx@nxp.com 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 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 Sep 17 13:42:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 10604013 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 6840E913 for ; Tue, 18 Sep 2018 09:58:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0FA1329AE5 for ; Tue, 18 Sep 2018 09:58:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 037E529B11; Tue, 18 Sep 2018 09:58:06 +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 7769329AE5 for ; Tue, 18 Sep 2018 09:58:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D93026E3AB; Tue, 18 Sep 2018 09:57:53 +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-eopbgr30041.outbound.protection.outlook.com [40.107.3.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6A7BD891FB for ; Mon, 17 Sep 2018 13:43:04 +0000 (UTC) Received: from localhost.localdomain (95.76.156.53) by AM0PR04MB4290.eurprd04.prod.outlook.com (2603:10a6:208:67::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Mon, 17 Sep 2018 13:43:00 +0000 From: Leonard Crestez To: Daniel Vetter , Philipp Zabel , Marek Vasut Subject: [RESEND 2/5] drm/mxsfb: Fix initial corrupt frame when activating display Date: Mon, 17 Sep 2018 16:42:12 +0300 Message-Id: <7cdac9c064cc2b8a3d237934f186da98cefe6cb3.1537191359.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: HE1P190CA0028.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::17) To AM0PR04MB4290.eurprd04.prod.outlook.com (2603:10a6:208:67::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b7d68a23-614f-40ea-5133-08d61ca37cdc 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:AM0PR04MB4290; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4290; 3:P0w6+Hbqn8Egi3B1+D8SdtjSPvh0lld4/5jnmouExS9xr4iB2noVgjh1IFSceEf66S5Kv4LIPb29kMUMCeauiBjp1ezWKUAlzEUXFGwSN2F+XZ0cDpk/IfsKrcxbCYQWwlRSp7zxd20siAHt6/QIvHvwdnR0Wp7/xxk/VJcG26kbmpWjQ6ffY/ZrDe4LnSlwUCB/wXpWf26vTsZEs540mOpC/Bmirx3M2tmEM80G4SsDHWTZrnuCfioFaaxwcHY0; 25:U2BOVg2HhmqLoSdGB5DHUVKhPYfGgMTpNDRgD48HFm0Lb1c9P8F7zaTzNvFYx3KdU6O1tQl0wH/FKRTXp5y7R7WNlqM5j5h4StGbLOCrb+/+4a7pDvHxEGKZrBsweDoAQ142WB5kV3D07Sf0O+Gx9oFHZeXZ9Hg3XHI9qvg7ZFXm+RvOtbmhwdlH0RGNgzsti8x5xLL0pGOawtFXwC1VmsbqM6eKCwIM/2FR/0vFy7xZ4eY2aEi4UxNhpqsoLdI8++4h4VAqw+w4RfZFQzE27HVAO4PJoEvgLc+y+WTveptj45jZb1YeTfJCNTjOnt+HBo+LwBWMKMPoqA4LqbBnpw==; 31:aaykwBGV+fiiVqJ81/UYdJ/foELBa7lbeSkOJwhi8pBE/91C94zqjk+VG836jMuErNim+JCffGCfwRlMEsOdBfn//TQeL2mIzHu/O8pO98AghhpIcI9B9pqgNlVN6uY2awsmSKBECBGsXF5S8N4MuvzKQf01lvV1qeu7Jmsxxq1L1jcyPGms/qA7i4F+kzT4GlxFOIqRjta3Qf0c/DmWoXA/wdkS3NnfYi7Lk6TWeTc= X-MS-TrafficTypeDiagnostic: AM0PR04MB4290: X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4290; 20:4yTlJ1aujlTlodLN05AaBV7D3cdGwWu2o6qRMoH2DypUt1tgKJFLfmhFlr9qkEFLLOnL+F5cswB/s/7zzDW78E0BEYt4SmdYLpsfaM1RTEZx6yMDiq/yCWAGVZDREEPnr8/Fx1Bwxy6cOKcctuecAygOgWfHb1FQFOpvhQYQgbC3dDcmMCkK+QrzW1z+8BKLfOBFFTPgg4nkMhr77SsFOjnevbkvRQxEwf2PLfusNF5jTJJohhjEP97Df16Kpq6gakYqQWaG0/PChbuVJm6zKzYgdm27WQOqM+ME2dRQSFyg4B+17Qu2s42ijEaWYWzc87G1hYULo5jMWSMLmfFh4dF3+NqMRSMYZsDIZWTXv4eEQqUVuO0lT0GHU6w0JIiyT7tGb2mKXfujcBqXX9npKUHrRkH1wCnnvgXI1p2lGGKhZB/Ime588IJQ81hRGw2gWKo8CaAWFrjDNs309nUJMNIKcCoMz+NHJBzfGj6nAK7S1cvjbmsOpJPCq2lf43XV; 4:eMSIhwv1Bq/j/3fhIVAr3Bxv05k99L878VI5xky5hWewdsvioJTZ8QfNeSTZD6XaHxY0XXZuQc4zTllW3Hvt2fb7tEaCVty+rcwDsGivY2fIc7qMe5QSITgwTJSEe2/Y+cmirBPEMvymQo0ZcyafjkANL+3PwezX6u/AnT01iaSg5mEo1T7X7bO06iZ2JpPlEpsAI1bInXpW7c6wpY2jpLHJQFrkjXOy8Gxpi1qTbswSP3Ab1crjIMzGvIzlcdPKQyevR/zmAbea8quSA8pmwl0CAvg0BlYWeKsRJN/LAgvj4Dgdzoww0fj9pbwjzKXY 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)(93006095)(93001095)(3231355)(944501410)(52105095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699050); SRVR:AM0PR04MB4290; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4290; X-Forefront-PRVS: 0798146F16 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(376002)(396003)(346002)(136003)(39860400002)(366004)(199004)(189003)(6506007)(81166006)(81156014)(8936002)(14444005)(50226002)(478600001)(16526019)(186003)(106356001)(3846002)(6116002)(105586002)(97736004)(47776003)(26005)(68736007)(50466002)(48376002)(66066001)(6512007)(2906002)(5660300001)(118296001)(11346002)(446003)(386003)(110136005)(4326008)(7736002)(6666003)(476003)(956004)(2616005)(54906003)(51416003)(16586007)(575784001)(86362001)(305945005)(6486002)(44832011)(25786009)(53936002)(36756003)(8676002)(52116002)(486006)(69590400006)(76176011)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4290; 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; AM0PR04MB4290; 23:02/P157LasJd3CT4sM44GXNMk67N4S7R9eGJRdXgk?= 5ZE+C24tJZ+IZ7QzQxBx+atqH/KpZa3RrkZ0sEKZr3FsYFRLhvksJFGp73C78BkC/uib/fvM7q4jLQSAwRXOAnl8le8kf8yJkPyAw0nDl8jesLJYoays5ENzMlYH/wOxZzgtRJRkO/YDzfajq8LaF0jRLIsS22NE/F8ZipcplQhg2JU5LYTPQxkEU4mHQKQa+X9qmengJzLPQuFyXkYdF4hdSpanof1HgUpZ2JD7EM41jeyImX3KB/GKM4x+WwLCpEcbM1gj1j/A4TQKgAnZ4Okf3d3ssLMPIew25kkNcCDFTlAmVZm5gMzTG91wnL7yFhucrlAGO4N9gywKGfm0qzkliFHjW/hbTj0mK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UQxSPOIp7vNU7oSv1ADKV4a1g8eQbgcQnp6JhxxR66y2XMh6RTT+kmsgBnDgYpgofMk68EJlScaIMFFCAxXLs9IEM35zta7nxzZiVI/pF3yS SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2018 13:43:00.5054 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b7d68a23-614f-40ea-5133-08d61ca37cdc X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4290 X-Mailman-Approved-At: Tue, 18 Sep 2018 09:57:51 +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: Anson Huang , David Airlie , linux-kernel@vger.kernel.org, Robert Chiras , dri-devel@lists.freedesktop.org, kernel@pengutronix.de, Fabio Estevam , Shawn Guo , linux-imx@nxp.com 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 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 Sep 17 13:42:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 10604015 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 E1A5F13AD for ; Tue, 18 Sep 2018 09:58:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D00EC29C4C for ; Tue, 18 Sep 2018 09:58:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3D3829C66; Tue, 18 Sep 2018 09:58:16 +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 545B729C4C for ; Tue, 18 Sep 2018 09:58:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 834106E3B1; Tue, 18 Sep 2018 09:57:54 +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-eopbgr30041.outbound.protection.outlook.com [40.107.3.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0CE2188FE1 for ; Mon, 17 Sep 2018 13:43:05 +0000 (UTC) Received: from localhost.localdomain (95.76.156.53) by AM0PR04MB4290.eurprd04.prod.outlook.com (2603:10a6:208:67::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Mon, 17 Sep 2018 13:43:02 +0000 From: Leonard Crestez To: Daniel Vetter , Philipp Zabel , Marek Vasut Subject: [RESEND 3/5] drm/mxsfb: Add pm_runtime calls to pipe_enable/disable Date: Mon, 17 Sep 2018 16:42:13 +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: HE1P190CA0028.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::17) To AM0PR04MB4290.eurprd04.prod.outlook.com (2603:10a6:208:67::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c412547d-8a03-47f3-9c83-08d61ca37de6 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:AM0PR04MB4290; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4290; 3:zseh1xHD4uJ5TpV7bINKtL9vAnbz0KdO1yfwh6aXnTYv6c5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3zzhoyAl3j8liZ1dQrNZFwJZaWbxffxw3r5G3W2faX0MBLOgfjvYUHWeYOYwggS4gOHQfcaKVZgZM8n1qoAa+99XOpco3RjOfarmR1NUBjY6SewtQFywJobZRmNDvgDUunoosLB3e6563WzI54ggAjiwlu9JrQsRaYk6dHxBbEKD00TKW/MTUSgTdeTvsU/QvS2U6XqXL/1kQq8ZSv7G1LFAXZZ//ss7JxvmEjGe6zwlXbQegQBOsCmt+2jyYllEg3nNsN+T4EKWVRZRM+ybcctnd7P1fnc; 4:6SWPbcFpGYeeNTFWgJUP+kp3GBmcdx4AsPK8lRUkacCoSBDXUnbMugmK8e6rj4EU2DUCGqq77AGg2EM/Jb6NLZyvmhKnfjb4x92V5hIrIP2o8TMpEUQp0Lvqq+vG4Nsd4/hRikM9uGkMMLSK2gldykE9GzJZkp5WHq6n7OwDsL1VTMDJRxLi+W57aJ19XV9lRej+fOlke7Cglh7WLFQYhrQuaesUvYH3nxpTbgB22eB8xr+4BnlDG+DXy8tTebFpXm6YYQeciFgXCshc9ad8a9YyAYcrpKSR2lszNZUywZuPXH93lCGjfTWv7Jl6Rv5c97fVgTXYQ23MnSkS4RjegOV4E32cgY9KfqWYd/ViCQc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(269456686620040); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231355)(944501410)(52105095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699050); SRVR:AM0PR04MB4290; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4290; X-Forefront-PRVS: 0798146F16 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(376002)(396003)(346002)(136003)(39860400002)(366004)(199004)(189003)(6506007)(81166006)(81156014)(8936002)(14444005)(50226002)(478600001)(16526019)(186003)(106356001)(3846002)(6116002)(105586002)(97736004)(47776003)(26005)(68736007)(50466002)(48376002)(66066001)(6512007)(2906002)(5660300001)(118296001)(11346002)(446003)(386003)(110136005)(4326008)(7736002)(6666003)(476003)(956004)(2616005)(54906003)(51416003)(16586007)(575784001)(86362001)(305945005)(6486002)(44832011)(25786009)(53936002)(36756003)(8676002)(52116002)(486006)(69590400006)(76176011)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4290; 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; AM0PR04MB4290; 23:MOUwt4EzFXlNedLc2KbGOzAFr6IyNoWIBGb1O6gCm?= 2UtXzf623aT6yqEy+hqKmMXvuPy10oG4fHkCYcWstvrnx3lqs2I6PCPHf/LV7kcfCP15bscm4EflR7jD/y9fmgygu76l02zyND0NrenBtGVE8ihG70KLGbLCtKVVq2pcRTXmMrHfaSCWT0sxcbpKIHHJANfqjFGQWCNsmFlPM1ZuTDirtQwJbs5slI1ztMWdD+InfhXLFav9ZGW3/pNSnwasl0Y8743KQ45JAR8UYqaxNEnFXFvgNTkUoMX8l1YwbBRy2a/TeLdYBIDY+4cIWp98BudM1/4g2QXZTZ2wUxAJYZsRtay8xs+vxKXwlN2PyZeZTWCa189mAlMuzC6EKSge9Qz5F+AbN6sCj6w8eP9eQ5/idRSfJxUD6qYqnygljhqKgISNnwJwZ9AcG+3+luMG9fo5LtQKL6u3Cpjz6T3KF2jraYfcWhV/L1UCuGLr/2F3Ba0VUAuMrd0LiVEopTsRowwffE1/OlXcW3r+zgO+GjvKTWZpybBCSOpV+O9iy6eVoIcTAnopEzU0vhH4+ZexKlbr8qghELw6oy39VIp/M08EJCi1ep6Mr29trkZZe0SsJI8guDc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380dev8GWKBj62ON9j5jkeBkP5w= X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4290; 6:KKJZM7kT7tsdbGnuIRgPsQl39kgYQmopEMDPJ/LVlZ+O9jTL0VaC/5EIrzhbeNasEt7ehCEq8Ixnir/N5+yngYG4IjzrUXkqgTvqlRDSpt4xKE2eCqUwAyb/hkqVdHltEIbJZSDwPOWjzRuT6A0zuT33WupEbeAmmDgGFPHiEE6wRC7kokZakN+9PjX4p9yey0lT4e8s5qrO1r8JemevkWpTz9MSs5EZFV0kRDysBUCS1Jci396o2Jv7DAwXeIrHfC0kndNpI8+PXrP1tUfpkIgol7QAl3cruYmuLF9Yn/VIKmX4djTuX5vx566GVo5Cct4UUc08w+v8QQhtFEK18MBxEYHhicbnMB7I/HotQfM1zhgsNabohDTdlMN+FclDtu5O9iofP5OYTc0IqUbNmugqxJlMa2H0rPwGDyMjdQcUg89/uZpeQRi9OcBLdV5rSWf37buGZRmFjsQwFApjrw==; 5:wO+0W+cq4eciUwJnhc9AtD5c4tMvFh7bQPQM2YLC4cXYOBDD9p4N0swBblSLAagc0WcBZASTwR4YuuiJvnpD+acpheeBEIxCTQUuweY2/go5ph8Fb/HiHmQnZ0GPxNIMdqAuWH2V1XtLudFVkmafigXsdaZ+rrUx6D4QeXPCl6c=; 7:VsnsnLDNWbU40W8SJ4IKrMigjhQIU+fZIcEf6noRx9AxyZwQVKqksYZKSb+gfKMk8CBFhOnjasmUy58OPADCiaejgfZelKLuyZ7Md/eIPk/dCsDKU0f0tBipJkIQKEo1ihTXOrPyD9gVIrU83ToIRdAUeNPax5K2uaEzTPb5PvKozAIosExypXtsK2OjUJV3AKr681z1VpDORJa+4STzHRY8p7fTY8ayvx+c/R3SgrpWwV2phcH6Cgk1HMfCNx7i SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2018 13:43:02.3006 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c412547d-8a03-47f3-9c83-08d61ca37de6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4290 X-Mailman-Approved-At: Tue, 18 Sep 2018 09:57:51 +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: Anson Huang , David Airlie , linux-kernel@vger.kernel.org, Robert Chiras , dri-devel@lists.freedesktop.org, kernel@pengutronix.de, Fabio Estevam , Shawn Guo , linux-imx@nxp.com 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 Mon Sep 17 13:42:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 10604019 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 6D08013AD for ; Tue, 18 Sep 2018 09:58:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A54A29C9B for ; Tue, 18 Sep 2018 09:58:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4DEDB29CA9; Tue, 18 Sep 2018 09:58:58 +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 F1B6729C9B for ; Tue, 18 Sep 2018 09:58:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 711BB6E3A3; Tue, 18 Sep 2018 09:58:48 +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-eopbgr30067.outbound.protection.outlook.com [40.107.3.67]) by gabe.freedesktop.org (Postfix) with ESMTPS id C26F688FE1 for ; Mon, 17 Sep 2018 13:43:07 +0000 (UTC) Received: from localhost.localdomain (95.76.156.53) by AM0PR04MB4290.eurprd04.prod.outlook.com (2603:10a6:208:67::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Mon, 17 Sep 2018 13:43:04 +0000 From: Leonard Crestez To: Daniel Vetter , Philipp Zabel , Marek Vasut Subject: [RESEND 4/5] drm/mxsfb: Add PM_SLEEP support Date: Mon, 17 Sep 2018 16:42:14 +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: HE1P190CA0028.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::17) To AM0PR04MB4290.eurprd04.prod.outlook.com (2603:10a6:208:67::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2efac388-a0aa-489c-ab47-08d61ca37ef1 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:AM0PR04MB4290; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4290; 3:P78QgowvxqLdUqCPB1dIVnTrB08ICnt5QDsIg1fn7jCfU6rXVl76v2LWSUpa99Ry7NYssIflc8g1UEWVY9BaqAGpYVSZrnDahpMZIYfrC+F1Qyja7QvcBg3f2sxwmcadPLELMv4xudtHAhoQkehh1EG6+bLyCmO2wsoHX3w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aPs+XHTOjQQS44I59AKKQ370ctTwXHZnLEcJFGfJj/BF6/gOoHiH+czX6BiyKTEizu84ygAJwIwRx+nivMxziZ6STjwCgiiHFa0Bw5VRvRbk1BDK6vrDzRPCuuazp3+5z4193gcpjoIT179+SjrGYdkKO5reALAtnK4wXcad8Vgwu/SPA2Qg; 4:gIL48VA7/fPm+8rEiGHh6FYmJB4rC+xU5kqmOamMmeacjWPBrwmFg6Ep6g0/c5v789Va5af7BeMedLEzyS233doaOCO47XbCLiBHcSyzYZX5hvEaOTtX3OAtU9GuN0j3jCkPJWWz7Ro7nonmC/ZfQxDLSAM2Lq8yCZUSeCZvlP9vl9hMqsM+WpoWuLfMaH8gb/yikkR/nj5zQDT3EtdikDRPOn0ZCDXGiBJVZ5a27lqt4HeW+yhnNLqZhx7CnYiLd0L5jeZdixwwqytNyXWKQJQo6nl3UfAnyUp4C31wLz264PGE50AJcoDwvSzJNF74 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)(93006095)(93001095)(3231355)(944501410)(52105095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699050); SRVR:AM0PR04MB4290; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4290; X-Forefront-PRVS: 0798146F16 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(376002)(396003)(346002)(136003)(39860400002)(366004)(199004)(189003)(6506007)(81166006)(81156014)(8936002)(14444005)(50226002)(478600001)(16526019)(186003)(106356001)(3846002)(6116002)(105586002)(97736004)(47776003)(26005)(68736007)(50466002)(48376002)(66066001)(6512007)(2906002)(5660300001)(118296001)(11346002)(446003)(386003)(110136005)(4326008)(7736002)(6666003)(476003)(956004)(2616005)(54906003)(51416003)(16586007)(575784001)(86362001)(305945005)(6486002)(44832011)(25786009)(53936002)(36756003)(8676002)(52116002)(486006)(69590400006)(76176011)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4290; 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; AM0PR04MB4290; 23:doo2tDTW2qRxKbWdUIz+DXdJ2Q123lgZuPVwGOd/f?= jHqZjm/5A5BLvTNEHi5MeRRmHJx+ivroFYNYLmwHT6K76iqyv1F3bE7Hpv4XnD0adoEXZlnegMkgvBBSz+iuseq0nWxu/LrIOeoIZtfU8Y8+9PZX6kGSXDNol2IwfglIHL9JTxf5Gshc0kYeQM2HafA31uydoVNrf+JlUDe2958FUj8N2HCU5Uc1b6V1AePXkmvyQHAFJSvtJusjAoYaLGbpJQV/FY349SPsA2IFWNh9nGnxS8X6GX/0ZlnbaEchNB1alW9ePZplPlkjegYJzWYHnq7YardC0HT5azwKx2GHzfc8cpYn7GOq5zIx4d3rFkdvaWmx4lDeq/VvDwoav9N0oEWaWwj/S6ztdl1GL6bQuZUz8UQDn7zXriHn3Cnl2PlmOdO3WMBRsFC59TdfTEIMi6drP59plTdk25funPIqdXqZZTFEC8JUYyeQ0ixlIBl1f7G9BP9TEFp0FCTGd3ySDKSeHvjcDvWoMQIcblNka/zl9cXavIECzNfuNTSdaN5DkMT4E/yeYd1nq2//bqndMioX5BqNc6Cjs/ZjMYalWd0p9Nme/2mz42QKg5o693SANM6/T03VvDMwqXcQqTVsanCZT/Oz77EEUCZ887e/joxVh9mUEaSMY7+iPWObLaVHAQFPsbI3UhpqaTzjunOKqSc+b8Kyg+MAGl1TWdEiQXKXYRWLK+/FUnYTFrwUGQtNNHrlvBvmOF2FbyVlLEtDt8+kkiVJ59uq4DBDD8c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vk6UGk9vUNTXtF+8p5H/dTXrMRjpg7GROicZhLN9kuRE1A8BKolkTvxTeW2SNcAKLXg4abi+ZBqRmW+5MD4/hizasLIA7wzYHfR7ix0AOpeHOi654NcJua/YBprsSBEGn/vQfoDBN0YHDZJ+oKnU6bCM3yZoobw2gv5p2vgQKkOXklC4/gkavoxHKJk2INFnvgxrSPB+tJNJ+UBBf9OOEritooeY3dHpjG6TOPlhC1GjA4ypx2FCiV7b/2BWHuDHfSt2M9ATANYsEqEE1r4c6czqLIp2+/mULbIysz478Wi0fwR41vAGcyeGjMK7t8pjHu5JRW5pgeBGzUF/GYlmBVQ7ZTL17hQ1ql4YNPldMz+WkYZK+lyUEt3/A==; 5:eGvO6PeCs7/TbPGif6I3GBNlf4nvIEVYlEXL+0dk4ApVMcH55ZCr6QgvZIdsz3xGG8tHrwX48IoDjrQV+VZb79tgN1SxCjXm8PR3x1c/RpLoiw459+UZyTaSwWvnTIRtyDXOteLMGbbbMmj5EmXWfNxoVoD7IERmXt8vSYkJa48=; 7:ETsNgnzl/Zi/AJibkBxnv6x/pbE0LATjAr2ou8Zi/1F6OaQBaEJPshOD/Nf3TmNR81eUDL/gnZSnJwZTdWYePAklRh2oN90kf22jos9uXG+Ckit4heXAi/h/xLiAd/KxX0W4dhsLKG0FB/xHi8YCNS21+4H5H8KeET7/tl5rn+MnivX6Kfn+0bWrmxPTAu0c+7XmV0o0c9SNgoybkQc5JvOUHGirVib6f3P3zGyBEEW5fS7VhNA/zA5LSOpdATtS SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2018 13:43:04.0538 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2efac388-a0aa-489c-ab47-08d61ca37ef1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4290 X-Mailman-Approved-At: Tue, 18 Sep 2018 09:57:51 +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: Anson Huang , David Airlie , linux-kernel@vger.kernel.org, Robert Chiras , dri-devel@lists.freedesktop.org, kernel@pengutronix.de, Fabio Estevam , Shawn Guo , linux-imx@nxp.com 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 Mon Sep 17 13:42:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 10604023 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 5C31213AD for ; Tue, 18 Sep 2018 09:59:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B77429CA2 for ; Tue, 18 Sep 2018 09:59:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EE2829C91; Tue, 18 Sep 2018 09:59: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 D55E029C91 for ; Tue, 18 Sep 2018 09:59:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3EB756E3AF; Tue, 18 Sep 2018 09:58:49 +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-eopbgr30067.outbound.protection.outlook.com [40.107.3.67]) by gabe.freedesktop.org (Postfix) with ESMTPS id 64DB888FE1 for ; Mon, 17 Sep 2018 13:43:08 +0000 (UTC) Received: from localhost.localdomain (95.76.156.53) by AM0PR04MB4290.eurprd04.prod.outlook.com (2603:10a6:208:67::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Mon, 17 Sep 2018 13:43:05 +0000 From: Leonard Crestez To: Daniel Vetter , Philipp Zabel , Marek Vasut Subject: [RESEND 5/5] drm/mxsfb: Switch to drm_atomic_helper_commit_tail_rpm Date: Mon, 17 Sep 2018 16:42:15 +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: HE1P190CA0028.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::17) To AM0PR04MB4290.eurprd04.prod.outlook.com (2603:10a6:208:67::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e9fa18ec-5485-45b4-0c0e-08d61ca37ffb 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:AM0PR04MB4290; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4290; 3:xuiDAKE4I9QOwN2MtNJCv5H3BncUb5EejHoFN6wbUkj5USRd/DOI9vdmH9U8wF3O+3FBZQrdN+bxRo5oMj+5TLk4YiNKQ3QAlNVGqObDGJit+QKWu4CP9zlWUFfEeMegsfI/f55rEHitJwVv6+1p7HPjR5pvlWsq4LQX7ZZCLF4Fq0EeTP1YDMKEwevErh1e6PYrh28Us+vuXDI5lGUMWSXHyv/dQN52ISvizQG99t8q0bBLrxITaF1B6p2Av1C/; 25:OEtnTiF6Z+svmQYu56Qst3KuzSSWErJxSwUnARererBuSZ7ppO3kDNen04Zamp4M7GutdH+IAB+IN7s3cGne0Be98D96M5arURtGckh8H08S82V/HO1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QrOemDxgEu/nQr5zhRXj4KZQaDrlxaNqMXVjT3s4YsRcCJM8tKQKe2HR+WQ+zslfMTM88Z/0jcJ2IpP/TQqwTU0C60jLMv0knjSkG4NuXZm9KqhTrHV09gDvycl1/cU+6cnsG6Dwii6x2ze0Awmx2WQ9lCoQvEskxFabfcDDz3GsQVHu+ksX/jEz61tMzCUkGtQaP+QcOAi++R1TgU7614aT+7jTbHAhj1AbMils9hhG+KOvycdI5GoGptRuPpCJjlPxdVaj+MS3SCsBJ+BaX+UMx6tQi5UgkmqdLj+vgp1YY6P/cjYY0RE+l7aLGbTpa+rHpC4zkkUWeo= 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)(93006095)(93001095)(3231355)(944501410)(52105095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699050); SRVR:AM0PR04MB4290; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4290; X-Forefront-PRVS: 0798146F16 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(376002)(396003)(346002)(136003)(39860400002)(366004)(199004)(189003)(6506007)(81166006)(81156014)(8936002)(14444005)(50226002)(478600001)(16526019)(186003)(106356001)(3846002)(6116002)(105586002)(97736004)(47776003)(26005)(68736007)(50466002)(48376002)(66066001)(6512007)(2906002)(5660300001)(118296001)(11346002)(446003)(386003)(110136005)(4326008)(7736002)(6666003)(476003)(956004)(2616005)(54906003)(51416003)(16586007)(86362001)(305945005)(6486002)(44832011)(25786009)(53936002)(36756003)(8676002)(52116002)(486006)(69590400006)(76176011)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4290; 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; AM0PR04MB4290; 23:ogmAz2qaDWkcrlps68CYx+jnaZ9UkgLPgkjYK+VUy?= T8asyGogPOh9gciwQrAI0HMfPZPUsUW7SLNFG+x/xItTfrtB2fA80866FXDsp/H/7FigpJUS+yiRe2t1fTn8WZM6NeFNcezbSpC8/yWWC9U/CJhGMSlgSLspEeyZKJd8l60KY+KazlBCnWtWW29q+ebxPMN0gqdxZj8WJcbqZIVnRM+K79EP0Zpjvs8kKX2kpLkVqbF+CPA4iAMEV9bJozaoxspdaUkT+xhIRJbuBd46dYw4dJDNpZBEjrURO6cJomkfpLaCu6BdyNHCvxMB4aXyF7N3h6Dvi7H5/P9y51sNxX7h+8REU5468yFi1jAb5r0JlyLsHRQMztye1DkeWXl0k2lUHlhUtbDZowNEkJKlh2r8Rs1Xn5Rz546eKzQ1AkulFJmvieiXFzHlr1bn0CfiMl0Xmrt5q2YT8pdW3PFQc7Pbmkm5VLmwxVDVlzbl675ICq6/ZYjtngmwocuaG5HvX8fM91p9VAUvk4aCpZC+HrAy55ZLYElOiu7YgWQ6XWuvl06TtT17xrUWAOWqEi4SdXpxXrx2HZQxLRG+i74dSmpoBtZGSdX59zu3NUCAtsF7p1P5fVOF1PVsVM5quZHsCTNj7UboHWSey4JOQbw7AcgE8c1kNRVooOZn0DKVu7s6/VRI2Grk8VAu4dgQS8Z670mkT/nSsrHdJ/xczhfDCuKSgVXWQpoOy7QFaOSRtt303YlPgvdIZyxk0hIzIH0Vscx0jhVF2OR4cA+Cw7TWzVi+i74gVJtI7d3qIMZQ1EV7V1B5HU9XuLaRJlzJl6z6uOGHQkruhcbk+QZtQdTuvrayJwhn5/1X4lgNFqdCrr98W+pc1D79BaYIFxw5yZYKjt8JH3//GYJKfvH2Lr8bkPidhJX2QaZkk4NDs6Fj5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8/DWZ8PPLw8bQCdxNmHGf1IsMy8GqueQLp1ytwaN5eho2/AENB3ygwFNrHpVjyr9Z4TXgRtMpizsqRUIMoOBMSWFixrQ9ppXwaq0HfbDgSKGT/fOnqpf/bHkIisgbSwN7wOBC4xZZaLddnJexrpJb9FaTxzyQcJb66e/kw7iPCYIOchWoO17UJaydGyEEyk42VGO8yfNXjIdxbgkItw==; 5:8q46Toc47YefRJt3fUyYcUvRj3pX5qWqCidf8Sen0gqQ8QWc+HWBdCWF8ytZKB/d2Cio6+v3QtSVkrd1viPBhCi10SdtimNmgaW4bwsbRJmjC8iOV1EOSChSMZpHJX0c11l4BtfaSk6JzFOBFj29PIY35afERbOWha3H7MqBhDk=; 7:/pxE3gsz7ivhr+rmZWIfCpDIzs+g5JMdbfQwQBqlHnh12yd78hnXGDAb6zzh/fspxRrZmHwVbB9EqEUbPgdAZ6SpgLbg2dj1u/O9He2IqRJzx5YM6dlYwJhv8k7lEC3Iq69xqsYDXEohpkiAn7hNzzbCXonViWeXCzNIi83hlRdOplmLmUNt76iSaYwIk3jgf7nfA8kOhSW+BzPumBWX/+DB3yhO7u7bbzbnBQI5I7soGzUT1tf2qf/eYaZORCke SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2018 13:43:05.7840 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e9fa18ec-5485-45b4-0c0e-08d61ca37ffb X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4290 X-Mailman-Approved-At: Tue, 18 Sep 2018 09:57:51 +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: Anson Huang , David Airlie , linux-kernel@vger.kernel.org, Robert Chiras , dri-devel@lists.freedesktop.org, kernel@pengutronix.de, Fabio Estevam , Shawn Guo , linux-imx@nxp.com 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_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));