From patchwork Fri Aug 26 07:30:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 9300911 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B2075607D8 for ; Fri, 26 Aug 2016 07:31:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A72A129565 for ; Fri, 26 Aug 2016 07:31:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BA492956B; Fri, 26 Aug 2016 07:31: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=-4.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,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 4829729565 for ; Fri, 26 Aug 2016 07:31:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AF8836E16B; Fri, 26 Aug 2016 07:31:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0081.outbound.protection.outlook.com [104.47.41.81]) by gabe.freedesktop.org (Postfix) with ESMTPS id C6FB36E1CB for ; Fri, 26 Aug 2016 07:31:20 +0000 (UTC) Received: from BY2PR03CA049.namprd03.prod.outlook.com (10.141.249.22) by BY2PR03MB1880.namprd03.prod.outlook.com (10.164.114.20) with Microsoft SMTP Server (TLS) id 15.1.497.12; Fri, 26 Aug 2016 07:31:14 +0000 Received: from BN1BFFO11FD050.protection.gbl (2a01:111:f400:7c10::1:117) by BY2PR03CA049.outlook.office365.com (2a01:111:e400:2c5d::22) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.599.9 via Frontend Transport; Fri, 26 Aug 2016 07:31:11 +0000 Authentication-Results: spf=softfail (sender IP is 192.88.168.50) smtp.mailfrom=gmail.com; pengutronix.de; dkim=none (message not signed) header.d=none; pengutronix.de; dmarc=fail action=none header.from=gmail.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning gmail.com discourages use of 192.88.168.50 as permitted sender) Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD050.mail.protection.outlook.com (10.58.145.5) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.587.6 via Frontend Transport; Fri, 26 Aug 2016 07:31:12 +0000 Received: from victor.ap.freescale.net (victor.ap.freescale.net [10.192.241.62]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u7Q7Uqod006560; Fri, 26 Aug 2016 00:31:09 -0700 From: Liu Ying To: Subject: [PATCH v4 6/7] drm/imx: Use DRM_PLANE_COMMIT_NO_DISABLE_AFTER_MODESET flag Date: Fri, 26 Aug 2016 15:30:43 +0800 Message-ID: <1472196644-30563-7-git-send-email-gnuiyl@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472196644-30563-1-git-send-email-gnuiyl@gmail.com> References: <1472196644-30563-1-git-send-email-gnuiyl@gmail.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131166702729936135; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(189002)(199003)(104016004)(77096005)(8936002)(73392002)(4326007)(229853001)(61266001)(2906002)(92566002)(33646002)(55446002)(50226002)(76176999)(5660300001)(586003)(68736007)(50986999)(47776003)(97736004)(2950100001)(8676002)(87572001)(105596002)(81442002)(19580395003)(6260500002)(82202001)(189998001)(36756003)(2351001)(86362001)(356003)(76482005)(48376002)(106466001)(81156014)(305945005)(110136002)(19580405001)(5003940100001)(73972006)(626004)(81166006)(7846002)(87936001)(50466002)(83322999); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB1880; H:tx30smr01.am.freescale.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD050; 1:mLpLJTJZgjFtB2bEdbXg8tbvlovKWxpLCGxcHTCD62YvIdufYQUJBakEYLZ7augk8URuUxvgVlosGDMiVQvk7pVbR8ywomf1KnKYIr/5PXRbQL+pSHIFcfF80M+YuEIPsiUJi8+yJheBx2wirZH1fkSYINrPgDiLyOmAxC4Cjr7/a/xPSsc4kAgz48O5uHbuzxKeTdEgOpJ7NF7VIUwbSkPk1nsY6+wDuG5b9OmzCB/hezcPWIsLTVDMx1wfJ/j2U6Xi+09WecUzKQa7KIbct9f+zEvFxPx7JcFrwLiIc+aFMIzk5q2X+Sr++Hr5rpdByvi8VXz2fVkRmfQhMv311bX5oVrJ67iXWjTi8I1xN/S3Hbg8zmwEBCaEdgCR+ugHa/UXIeYxPCTN4/Kyug3foJj2I0HhQTXtuFDOgwDPiQReF5gbn5GQQ7hTSL9e/ATB9kLwL3NsVRJ2awd05tFO7DwQsxtsMRL85GExe9l1PbYycLmmeV/nBTrK7Kl/JbEqeyDoEUhbz/i2y7mzBjrgTC1hWFN62ToW4ahqk/D5v8t+5qtqt+qwllRRZSjOCXDxvylY1Dg7fDqmZt9ZRD7urQ== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: ec81bb6b-55f3-44ef-5ba8-08d3cd82f508 X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB1880; 2:T7NK8e6/MNvVdMgRJ1S+5L2JPnYVCM8pHJRchUv8BuQWCq1uU/hBR201wTVoUtnkl/mTO7CeQ8EuqaC/mY/rFJStH7qSeqxA3wzYLgxTutTh8gkmj5JZjn/MvH9QmKVs2Dhx1ZWHuLmh005sXlRohBSCNZ0NSdF4ubX1gPGz9PSIx0MALYO/4ub0+tPBjWZo; 3:P3Imw3Ns7uYNxGjzKSAH46DkAbCyMuWcNbRSML3iJcj/yyPStdKVHuerRcp3lF9JpJBfD2NhNA9ZF6vahpcBjwRMDDljxClm085gbpeGyu6CvSJdNnyCGQpVKfNqEi+ta3MWSofsDKBHoLUIQyfyRKELjJdE2baPL+ZtvdXJ0zE6j2YWtqxzLbd2t2WgwyQP4KJD1Q5G+Igvund09MExgLB2cj5BBUeJgX1gSxx7Lhs= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB1880; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB1880; 25:bsDYc2UiULr3VfqhIsWhfzUpIhH6B7m9aJWhq9G2/2E9Cm2tsvE/crJPvM6xRjihbbaGM/jc04GiskVXGgei4LJxEgCGdvbr2Tdh4P1Y3cJrPlccwPso+ZoRvuWBtcE6fXh+I7rPuOLoNAit3mm8Z+AT1CYJk/8AFpGucgRP8zMHc+On5c0nSLdmkmLyF+k99OKKdyB6n069QOgCvwdJZmvx8rr5LbYGgjgGMV+kfOhaVcoz0gbowq0tDrgcN7aoTxo1sjyan3yLs4YgkstGrVRDtKGEqCDZO8rMfO4UvGU0phJz/BvVUXlzSY32/ETXRx1dXzzGQ59J2tHKCL4w+jA0r/9Lhmv1sQwY4fCDnLsVJqdjB4CWqH6mOE84qAIgeKcBCm8JenUQsCFCBScnCr5UzNPPrQtfOoktF4ELyaLuTgSqGbKRkjl3Nz7v0zuKSRj84bjuzlrMnr9VGottM2juNZ0Lf+j3poQSNtSV9P2xGpyH9PfZoLS5idNWfqBqI4UPNGL6HEyw7Z9CZ8s9i/WXZGIk5ycdyi+fsNW4h1KI1kAYvkQLw0G2qPwkYIe2X8dchrecvMycHpXvPTJ6rDbjxt+Mp7n33C5tOfkW1w/7Kr3Zc1MUmevO8Qcdy3VQq27Em5RpShplw2MXmd3YhcFuCNDc7kFIAwYRyV4zKL/Sqat1NeLTuP7E06fTLnACL1oZQThi0r33j99R5XNMUQdzVLjrLYu1kOP0+DOLHfg= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13015025)(13023025)(13024025)(13018025)(13017025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:BY2PR03MB1880; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR03MB1880; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB1880; 4:3C/G+SNpp+CULudBalm6kApLFj/kYv58yk/5sHY/yo6sFJGadZbtgXP/JAdxO/zfXX96g/3/gxjDuIeMSv3UaQlGt9a2Ezen2G2EVf00nt7AHjPPmEIXFq78h54B6ksFvovtCoIekuDhYDir7WxyZGB0u6vNnF/C6VaR7GCtmY11yHKytlZoMJz7RUU9tk8h3DVqwccIOFAe4Yv7hUXMVX6/vaq9mcXE0BtpLHtlI5Q2nKAGkc3CA0CGJ3NV6zBE5c9GYNIT4TXXtsq+PuYZFzzuaedpVZNV3ZB7oAPIPf019DqouOm1ec40nTdGhaCRm1J3noLtghAU0seSeM9hbL+/5TysFuNHaexP05wI5dvr9H9KL817KBXj4wHCS7PzygIrIb7HdnD/vwDM5/Hdg2kFK9lVK8nOPHLIHOam2q+84bIuq1C+MQNCI7CRe8hBnQNBh9d8nWDFVm7wVFmxgRqYsmPrTvOMwe66PkQKpcR4ztxA5PNi5bd5lkiUEZck X-Forefront-PRVS: 00462943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pOlHJRM9LiyzRIgCLnnxfNPw SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2016 07:31:12.7908 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR03MB1880 Cc: Daniel Vetter , Peter Senna Tschudin , Russell King X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The IPUv3 display controller behind imx-drm needs all planes of a CRTC be disabled when the CRTC is disabled. The DRM_PLANE_COMMIT_NO_DISABLE_AFTER_MODESET flag reflects this hardware requirement. Let's use the flag for imx-drm. Suggested-by: Daniel Vetter Cc: Philipp Zabel Cc: David Airlie Cc: Russell King Cc: Peter Senna Tschudin Cc: Lucas Stach Signed-off-by: Liu Ying --- v4: * Newly introduced in v4, but some logic is picked from patch 3/3 in v3. drivers/gpu/drm/imx/imx-drm-core.c | 3 ++- drivers/gpu/drm/imx/ipuv3-crtc.c | 3 +++ drivers/gpu/drm/imx/ipuv3-plane.c | 8 ++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c index 56dfc4c..99fff6c 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c @@ -194,7 +194,8 @@ static void imx_drm_atomic_commit_tail(struct drm_atomic_state *state) drm_atomic_helper_commit_modeset_disables(dev, state); drm_atomic_helper_commit_planes(dev, state, - DRM_PLANE_COMMIT_ACTIVE_ONLY); + DRM_PLANE_COMMIT_ACTIVE_ONLY | + DRM_PLANE_COMMIT_NO_DISABLE_AFTER_MODESET); drm_atomic_helper_commit_modeset_enables(dev, state); diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c index 83c46bd..c3d5933 100644 --- a/drivers/gpu/drm/imx/ipuv3-crtc.c +++ b/drivers/gpu/drm/imx/ipuv3-crtc.c @@ -76,6 +76,9 @@ static void ipu_crtc_atomic_disable(struct drm_crtc *crtc, crtc->state->event = NULL; } spin_unlock_irq(&crtc->dev->event_lock); + + /* always disable planes on the CRTC */ + drm_atomic_helper_disable_planes_on_crtc(old_crtc_state, true); } static void imx_drm_crtc_reset(struct drm_crtc *crtc) diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c index 4ad67d0..6a48147 100644 --- a/drivers/gpu/drm/imx/ipuv3-plane.c +++ b/drivers/gpu/drm/imx/ipuv3-plane.c @@ -392,8 +392,12 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, enum ipu_color_space ics; if (old_state->fb) { - ipu_plane_atomic_set_base(ipu_plane, old_state); - return; + struct drm_crtc_state *crtc_state = state->crtc->state; + + if (!drm_atomic_crtc_needs_modeset(crtc_state)) { + ipu_plane_atomic_set_base(ipu_plane, old_state); + return; + } } switch (ipu_plane->dp_flow) {