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) {