Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1006226imm; Wed, 8 Aug 2018 09:10:48 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxDFxBf7qI+ufja8CjABhHC5LYApgphgDS09LNqE73Dce1XFGreOTZd8duqeoOoRhr/CGXS X-Received: by 2002:a63:8f53:: with SMTP id r19-v6mr3160712pgn.17.1533744648123; Wed, 08 Aug 2018 09:10:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533744648; cv=none; d=google.com; s=arc-20160816; b=S+zY/wAAcxt45wXnhnPXumTFW7JN5kJppJYeZDKma9SyaPjyZ2KDpb1sCjCTlNZNBf AcMXA949Yzyn3VZyR7UAKqpWOIvRfbbe9zZqSKugwJ9+GVDz+RZQUb0ZK8l7oocltndc oBcnk01HRQ+F399/bkrgzZmMdKjstcsEUr4p2LzDgCfLZJBTPs1wmFqAfTtYWsA+agp8 iMWUI0eK7HFUDzJKSf44/G+Kb5Wst5vXyt4jnazIO9hLvPQsNaSICrE0p1QvVv/dRkTx /Al+hxgmqiE3zQJ9JbGyd8zYsaJyvEkdCp8SLCFDUnvXxAUKXl3aedYRDJpwq/zFRP2h yrVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=cTE1j8BGjhCZ8z3SdfPwlXJdSA2Wtao+NQ+Q+0lN8PE=; b=SkDouApefLtNva95rv8N8tXn2pOX8vySHZSE3njXIwYw+2OBfOu87w8a7Dxe90T8Ww 6F86/vSLXMzMJrDU3HEzHJGrBU0ZagiOcJzGZ6virgiJ++dv5/Dmq2ZWR9voCUqZ8v3I 5UGpAZ81lrA77dR5KxgxoAKizjyoWwDiEWg0KqDQgS3JEE7hztMJZucWZRXRkMJISrBt kvfI37Yw/y/JJuwybMOmfqaxGhiziFI55vboke0gFF5zuYE7EXJptob5V1pyiaiCu91A 4sXjZgqlySfsai76IhCi3NlI/h+GDYnezPxHxAoIjK9qWBee4xGS8Mff3zNFeflWD2qV iPrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=ezsAgSuW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 30-v6si4507325pgt.678.2018.08.08.09.10.33; Wed, 08 Aug 2018 09:10:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=ezsAgSuW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728133AbeHHS35 (ORCPT + 99 others); Wed, 8 Aug 2018 14:29:57 -0400 Received: from mail-eopbgr40068.outbound.protection.outlook.com ([40.107.4.68]:40736 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727386AbeHHS34 (ORCPT ); Wed, 8 Aug 2018 14:29:56 -0400 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=cTE1j8BGjhCZ8z3SdfPwlXJdSA2Wtao+NQ+Q+0lN8PE=; b=ezsAgSuW59mmUtIasMtDjW9ds8PSadbXLtVP2KtI8Sb1SAypmdh/03wrMMG9yykGWcONZGPzsNRZaoOpJJ55AeNhXtr6GQGRwuu45bLdV1yx2/2MVQbOs3RmToxXoh9gmkSMYWBXYIcFfzp0/6wuU7pEqg1n/ZYpJIm+E6Hyums= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=leonard.crestez@nxp.com; Received: from localhost.localdomain (95.76.156.53) by VI1PR04MB4301.eurprd04.prod.outlook.com (2603:10a6:803:3f::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Wed, 8 Aug 2018 16:09:28 +0000 From: Leonard Crestez To: Stefan Agner , Marek Vasut , Shawn Guo Cc: Philipp Zabel , Robert Chiras , Fabio Estevam , Anson Huang , dri-devel@lists.freedesktop.org, Dong Aisheng , linux-imx@nxp.com, kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH v4 1/5] drm/mxsfb: Move axi clk enable/disable to crtc enable/disable Date: Wed, 8 Aug 2018 19:08:58 +0300 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [95.76.156.53] X-ClientProxiedBy: DB6PR02CA0004.eurprd02.prod.outlook.com (2603:10a6:6:15::17) To VI1PR04MB4301.eurprd04.prod.outlook.com (2603:10a6:803:3f::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1bf0034b-2334-4404-87b8-08d5fd495242 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:VI1PR04MB4301; X-Microsoft-Exchange-Diagnostics: 1;VI1PR04MB4301;3:1CXoTL0BWH21EwuCrwzl1W8qHGo/GjQrCPzdS8wIZpqrypHPZ1QcrdEf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00JJp4ZWv48BPYPkzPdm8SAO8g4CnkFkHdKlLA4U3rdPrBCoso5WX1fe0+nuiM/XFmoX2SraEnKoz75Ud8xckKX+7BCuSBE0sn5uA1J4uiDB5N9dKOqJH2w19UUTmLka5WtkG76RZPcI872D7p0rUj/B5+BFDm6ToAhqt3BSdVctcbSBj6zXO47ZopdNaifkxRca11ROFByeBdRud+GXkSVximVp4cM64jM13CDEhJhXszcFN1Ni1sjmjMA88exR9oPJj2+bcyoR3uLlJQ2Ob3Qgx8NtY1HY4Bf02W4b7zU6;4:z2J9lSLShTezbALpxorne2uoOfr/SIoE8r0ZLMoDrjD5ETqx4qIwi5+aMAlCvsrg6b2Fzt65uXE8ZKUgi5IqL5xEzhPteYSxGVsHjz7wu7XPomnVo865mAPYBR8H/iELH5UwcjUTEFQM1mcpHJkxJuLsbSQEjkBJhKjPGG1Zxs1nW7G5JFLFDLvdNUtvzHlO6sG3hVOuryUO1n39UV6/NfJC2ikSpXq9FVdgbrZMqjQrao9pwf1DfALmx9wKQe3h1Ffw9klNNYsPzAS+Cx4nwjy28BviLWa40hYUErRQXK3yiv3OuZrDaitKV/FKhxdI X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:VI1PR04MB4301;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB4301; X-Forefront-PRVS: 07584EDBCD X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(39850400004)(376002)(396003)(346002)(366004)(136003)(199004)(189003)(66066001)(7736002)(76176011)(47776003)(6512007)(81166006)(68736007)(81156014)(25786009)(8676002)(6666003)(110136005)(54906003)(36756003)(14444005)(305945005)(106356001)(105586002)(53936002)(50466002)(6486002)(97736004)(48376002)(86362001)(4326008)(3846002)(5660300001)(26005)(486006)(16526019)(186003)(316002)(2906002)(16586007)(6116002)(6506007)(44832011)(478600001)(8936002)(956004)(11346002)(2616005)(50226002)(386003)(446003)(476003)(51416003)(52116002)(118296001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB4301;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;VI1PR04MB4301;23:fJT+Rii10Ok82ttUxh6BrIsfJno1u/ScY6JpYs1Tv?= =?us-ascii?Q?TPuEzhJXwhMCF6RakVg8h6bui3LI/0S8BpGbmK81oR4KDSRmfRLPAtRUlWYb?= =?us-ascii?Q?1q5qbEj9vzQbsdVopxNEZCuXQhfYEX9ibYQ+zfjbsyxOd4E3PkdotWUCbDfW?= =?us-ascii?Q?XmpaTcFn9FasNkJmMtwh6EcVsUzJg2ZNoiVNM/JeMqLtB03qNd+OsU4n/2+f?= =?us-ascii?Q?Q9nnWyoqMtsBdrbS331U6PqpWX7ehWfPM5OL+i5PWKmGYtTShoWXIPTuhMKj?= =?us-ascii?Q?XIoGMHQ+fv0mOARLB9zjYtLfMeWJ624cLWyG50RqqS0jF3JiARB384InVqqw?= =?us-ascii?Q?BIS2lipxvxmxk+P5uV+RQLzQj2e5dJrGgNcVnpLmZvaBeE6sG0WVvG6oqx8x?= =?us-ascii?Q?ySbVlKfxSEpesILPO+vkotHyJr4KuOZK72GWdu/6lJWySKndtFTMoqe5kM0o?= =?us-ascii?Q?yOQazESkHxrrJcBkJO3AduNUQPlEJzHiukWHnUEFjrdirRIFPi+JjwFMhh6c?= =?us-ascii?Q?rdkiCaI6PnR5JEx4kBqhuedRlLPa7B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QW0v4D3Sku2fOktWir+zInex33Vg4TEFu4959b+0QVMNNJxV5wNJWw/IE+q+FzJB96Xeh72w SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2018 16:09:28.4199 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1bf0034b-2334-4404-87b8-08d5fd495242 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4301 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The main axi clk is disabled at the end of mxsfb_crtc_mode_set_nofb and immediately reenabled in mxsfb_enable_controller. Avoid this by moving the handling of axi clk one level up to mxsfb_crtc_enable. Do the same for mxsfb_crtc_disable for simmetry This shouldn't have any functional effect. Signed-off-by: Leonard Crestez --- drivers/gpu/drm/mxsfb/mxsfb_crtc.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c index 0abe77675b76..e4fcbb65b969 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c @@ -127,11 +127,10 @@ static void mxsfb_enable_controller(struct mxsfb_drm_private *mxsfb) u32 reg; if (mxsfb->clk_disp_axi) clk_prepare_enable(mxsfb->clk_disp_axi); clk_prepare_enable(mxsfb->clk); - mxsfb_enable_axi_clk(mxsfb); /* If it was disabled, re-enable the mode again */ writel(CTRL_DOTCLK_MODE, mxsfb->base + LCDC_CTRL + REG_SET); /* Enable the SYNC signals first, then the DMA engine */ @@ -157,12 +156,10 @@ static void mxsfb_disable_controller(struct mxsfb_drm_private *mxsfb) reg = readl(mxsfb->base + LCDC_VDCTRL4); reg &= ~VDCTRL4_SYNC_SIGNALS_ON; writel(reg, mxsfb->base + LCDC_VDCTRL4); - mxsfb_disable_axi_clk(mxsfb); - clk_disable_unprepare(mxsfb->clk); if (mxsfb->clk_disp_axi) clk_disable_unprepare(mxsfb->clk_disp_axi); } @@ -206,11 +203,10 @@ static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb) /* * It seems, you can't re-program the controller if it is still * running. This may lead to shifted pictures (FIFO issue?), so * first stop the controller and drain its FIFOs. */ - mxsfb_enable_axi_clk(mxsfb); /* Mandatory eLCDIF reset as per the Reference Manual */ err = mxsfb_reset_block(mxsfb->base); if (err) return; @@ -267,23 +263,23 @@ static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb) SET_VERT_WAIT_CNT(m->crtc_vtotal - m->crtc_vsync_start), mxsfb->base + LCDC_VDCTRL3); writel(SET_DOTCLK_H_VALID_DATA_CNT(m->hdisplay), mxsfb->base + LCDC_VDCTRL4); - - mxsfb_disable_axi_clk(mxsfb); } void mxsfb_crtc_enable(struct mxsfb_drm_private *mxsfb) { + mxsfb_enable_axi_clk(mxsfb); mxsfb_crtc_mode_set_nofb(mxsfb); mxsfb_enable_controller(mxsfb); } void mxsfb_crtc_disable(struct mxsfb_drm_private *mxsfb) { mxsfb_disable_controller(mxsfb); + mxsfb_disable_axi_clk(mxsfb); } void mxsfb_plane_atomic_update(struct mxsfb_drm_private *mxsfb, struct drm_plane_state *state) { -- 2.17.1