Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4022307imm; Mon, 6 Aug 2018 15:13:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfqXq0u7sRupoxQlrrc2OHfbSKNRCOO4ETqsA3lsBxSoSAgCJXqPBX0fHcSWwFNCY37XecC X-Received: by 2002:a17:902:e28b:: with SMTP id cf11-v6mr15647089plb.86.1533593617691; Mon, 06 Aug 2018 15:13:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533593617; cv=none; d=google.com; s=arc-20160816; b=hYkZNWd7G6pbJfZvNGZb2ZdyjGGD2zepQKmTfLSzx6G2HCYgs5oF9ZnilDQ0EfytZf L1/c2nURJ4rv4ZXR2HyaPo/pi3XQCdheocSZ6kVaDsju/2cnIyKZCREhon3rtq8iajnd JlhmN43IdInsxvRElLGcD90y9Z5FH4TIB4MdwzN9EX7ijJW3/IkK8Po/R7QEabmmgfVz 2YfkRyinwyJsQCb3DU6QkNCBkXKPqdRi7ZpoexRmulpLLDEiXg/aEZSdYSKsZj+cUlzu Umz0L1Dmqci32gykxft6sEK7+XyIwlPhcH1XR5P9t4r0wtCnLnufWNb2Qus3CEnipLtD U5ZQ== 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:message-id:date:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=jlRQX6NHRvF9Y8f8GQQqDP1Z4wdKXfI4mS8zvDE+9LY=; b=Pm+XTimVQGYM5Pjs45ohCGVmJLVZVQaG5uYfxAFpRmnXQUYR/ted6kQsL/KP5qg5Lb MIqpYCac6Vzx5ahhC/P8RntIyhKwsi9DJ01VvPuM2qt5ln3uPK9/zYWfUYZZljZpZ+Q6 Yzx4CVTZD/OQSmUKeqoayBufYFtjtNwXWP0h8oaiYj/AxDyNfysD3PfReIBK7qw5nnxr owmEyCkMOF/phEJAoqMr3QWFu/y85C68OxwMG9YyMF0PItI7ZTe9Cz/oX+QwWT7v9KgC OWqqe5rX6wUW0YsQuU1iac9IqSFjxikruaViIQbU+8305FAM7qJpEGwgYpOClEFWb6QQ 938w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=ohuMRbw5; 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 x7-v6si13787205pgi.465.2018.08.06.15.13.10; Mon, 06 Aug 2018 15:13:37 -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=ohuMRbw5; 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 S1732647AbeHFVmB (ORCPT + 99 others); Mon, 6 Aug 2018 17:42:01 -0400 Received: from mail-eopbgr40050.outbound.protection.outlook.com ([40.107.4.50]:22570 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729976AbeHFVmB (ORCPT ); Mon, 6 Aug 2018 17:42:01 -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=jlRQX6NHRvF9Y8f8GQQqDP1Z4wdKXfI4mS8zvDE+9LY=; b=ohuMRbw5wKON+6S539AGVFXHw0uoxmgm4tg4wjeiRYadx1KfiSY+QHulb+93tkl+PutmjIRfkGB1MxAtHKtIlArzI+9eUA246H8dHqwMjBggJLZs7ZvC6rWHwLyarl/qPv4rhwFlKmGknhRzGQcS7pfyZPpcEIMc+rLsqBhd3jw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=leonard.crestez@nxp.com; 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.1017.15; Mon, 6 Aug 2018 19:31:24 +0000 From: Leonard Crestez To: Stefan Agner , Philipp Zabel , Marek Vasut Cc: Shawn Guo , Fabio Estevam , Robert Chiras , Mirela Rabulea , Anson Huang , dri-devel@lists.freedesktop.org, Dong Aisheng , linux-imx@nxp.com, kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/4] drm/mxsfb: Fix runtime PM for unpowering lcdif block Date: Mon, 6 Aug 2018 22:31:06 +0300 Message-Id: X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [95.76.156.53] X-ClientProxiedBy: DB6PR07CA0162.eurprd07.prod.outlook.com (2603:10a6:6:43::16) To AM0PR04MB4290.eurprd04.prod.outlook.com (2603:10a6:208:67::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f1376168-0a6c-4947-7384-08d5fbd332f2 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:AM0PR04MB4290; X-Microsoft-Exchange-Diagnostics: 1;AM0PR04MB4290;3:qwdOH9GP+UimPc6KS0Kl9iTNsz9y5Z/PzlM/fZ2tnyatf4Bphil8EZXiSskof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uyeTHuXEbPrc3Z03Vwt5y1y2RB2xwApC/Z3oN+E6a/V00JcI0tlKYXYUNY70dMlujynh9FDgDJjBTZsAtsKVkvzJfXYkX6PJMS/aebxGXtUC8QhdYCrU1cNFjbblhwgx72icj/A/ymuuoFVdvbsC2MjwFuRsAdqfcWxCKVT8N/S11BZw9IqzhhP2L3+2bMHSQl6fo53kgZM/3mHpcxgvglAvI5ZptcEKQ+CGUtyV8vKpdGch0KRegETejE5RyyOYdGKtNkKp+a6sLBxRMjLL2h8pEv6lLouNJ/3MNDA2gB;4:fmMULWiODw4BuIfd4WBAGLPz2c04S+IQw1ziLptVMk8ckQYfmNSqO+PRqGbeKqQjoGzTdHfj4ZIOiT+PXQFPlvJkYOEFsgG2fjU1a/imRsA2NMX4mtxLI1wKhKcJediq/X9ai8J/XWNMiRkX3I4ZLc1KySgG/2tRjT3WeibnTtyf9VACKhyiRWyudj3AIQEtL1mrE/tFOJvyzrWjq0Fpd9RdY6MDe00Vg96EirB1F0q8QxHgxy0Jil65hiN9v26F5BPq+jLYV0AYQJSv3vPaVzkxr9U9Z79aooVD1ByaEsnv9x2RjxGlq5gNh6IXQM1G X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:AM0PR04MB4290;BCL:0;PCL:0;RULEID:;SRVR:AM0PR04MB4290; X-Forefront-PRVS: 07562C22DA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(39860400002)(376002)(346002)(366004)(396003)(136003)(189003)(199004)(486006)(86362001)(50226002)(316002)(6486002)(68736007)(14444005)(386003)(6506007)(2906002)(6512007)(6306002)(50466002)(51416003)(5660300001)(478600001)(6116002)(16526019)(3846002)(66066001)(25786009)(26005)(47776003)(305945005)(44832011)(186003)(8936002)(52116002)(476003)(48376002)(6666003)(2616005)(4326008)(966005)(54906003)(8676002)(105586002)(81166006)(53936002)(7736002)(97736004)(110136005)(956004)(106356001)(81156014)(16586007)(36756003);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB4290;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A: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:hrBHMVBSfn7RAPc39ZmK7TTJ++6haUe8O4M1WlX9K?= =?us-ascii?Q?HP6nTHnUqeSpTu66MvLlu+lAF5JgIpXOEEhec+sIZWrmm/laC09bHeTBFgPz?= =?us-ascii?Q?BzaFVUBUmO+Uw5sOPiwQiKcRHdg9t3wxPQ1Xsx4M3G/PkktdS0HzvFfZ2m2Q?= =?us-ascii?Q?BbH5xhhntAY3JQB4dQdXfE09hgDejLV8nIZ3eQucoXSUUeJzBSZthBB7tiqG?= =?us-ascii?Q?v7MQt/UGtLmjY883GZgoQBb+ux6CxycQf3zaTbVTwefIv7DqvCFE4ZNU3RgU?= =?us-ascii?Q?wC+iR2xlrJBIQ2QK3eEAaLZXDzW80tCaqsaQx/35uHKSL7jporQIEu8wmzmv?= =?us-ascii?Q?4MA0DLesYMGBbWAxmVx+cptK9TvMFv7MmVTFm1lainlH7ld0AlQummeDrsex?= =?us-ascii?Q?C56lXJrtHNnO+mWs/khVm1xZbMa1bdkMso8RAaWFYwMpv2q2mqCP7iCGQMYd?= =?us-ascii?Q?IOJeSQS/KsDN+AO8rCMRx+7OiQYlqy+GWXBxxO3CtSmoEtPnzXQ/2GxBQlxJ?= =?us-ascii?Q?3TQtqLJOHM5NiRC4NexyKX54PTFPy5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De3RkDXP4bI5aiizSMP1mtpgz0XJhbFCH5Ljm4p2sVO220O SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2018 19:31:24.2706 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f1376168-0a6c-4947-7384-08d5fbd332f2 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4290 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adding lcdif nodes to a power domain currently does work, it results in black/corrupted screens or hangs. While the driver does enable runtime pm it does not deal correctly with the block being unpowered. Changes since v2: * Split into multiple commits. * Use #ifdef CONFIG_PM_SLEEP. * Switch to drm_atomic_helper_commit_tail_rpm Patch 1 was split because it's useful alone. Patches 2/3 could maybe be squashed. I'm not sure patch 4 handles vblanks correctly. It does not replace patch 1 because there is still a small window between enabling the pipe and the first atomic_update and also somebody needs to write to NEXT_BUF. Link to v2: https://lkml.org/lkml/2018/7/17/414 drivers/gpu/drm/mxsfb/mxsfb_crtc.c | 42 +++++++++++++++++++++--------- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 40 ++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 13 deletions(-) -- 2.17.1