From patchwork Fri Oct 13 19:29:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 10005733 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 3A87A60325 for ; Fri, 13 Oct 2017 19:30:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C6D329128 for ; Fri, 13 Oct 2017 19:30:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2128F2913B; Fri, 13 Oct 2017 19:30:32 +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.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 406A129128 for ; Fri, 13 Oct 2017 19:30:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1CA1B6E258; Fri, 13 Oct 2017 19:30:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 80082 seconds by postgrey-1.35 at gabe; Fri, 13 Oct 2017 19:30:27 UTC Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0053.outbound.protection.outlook.com [104.47.37.53]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3BF756E249; Fri, 13 Oct 2017 19:30:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ZO+SCW7hna47drvzY+Ddsmg44qKmDOHOpJUup+HxBbY=; b=GFRpdq7I9O6GSYVQht3+TzqaTOO+pdUjzXeFSDe2vbg/FcGo6G3jZd3mis/oyNY+RFAPe8LhdnvhJGm93Yh2Q9MNh1vQR+rnCxxopxz3X+/b7HscunI4iCwBQ998WugggcOTzZgcHyN2IU3OsiiPUT6B0kND+y3WStnd4yeSwu8= Received: from MWHPR12CA0069.namprd12.prod.outlook.com (10.175.47.159) by CY4PR12MB1445.namprd12.prod.outlook.com (10.172.71.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Fri, 13 Oct 2017 19:30:24 +0000 Received: from BY2NAM03FT025.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::205) by MWHPR12CA0069.outlook.office365.com (2603:10b6:300:103::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.56.11 via Frontend Transport; Fri, 13 Oct 2017 19:30:24 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by BY2NAM03FT025.mail.protection.outlook.com (10.152.84.232) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.77.10 via Frontend Transport; Fri, 13 Oct 2017 19:30:24 +0000 Received: from SATLEXDAG04.amd.com (10.181.40.9) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 13 Oct 2017 14:30:18 -0500 Received: from leodev.amd.com (10.180.168.240) by satlexdag04.amd.com (10.181.40.9) with Microsoft SMTP Server id 14.3.361.1; Fri, 13 Oct 2017 15:30:17 -0400 From: To: , Subject: [PATCH v3 1/6] drm/amd/display: Use DRM new-style object iterators. Date: Fri, 13 Oct 2017 15:29:30 -0400 Message-ID: <1507922970-22877-1-git-send-email-sunpeng.li@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507842911-16975-2-git-send-email-sunpeng.li@amd.com> References: <1507842911-16975-2-git-send-email-sunpeng.li@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(2980300002)(428002)(189002)(199003)(81156014)(8676002)(33646002)(478600001)(106466001)(81166006)(72206003)(4326008)(48376002)(53416004)(8936002)(50466002)(5003940100001)(5660300001)(53936002)(77096006)(39060400002)(2906002)(68736007)(97736004)(189998001)(305945005)(36756003)(6666003)(356003)(2876002)(47776003)(575784001)(86362001)(316002)(105586002)(2950100002)(16586007)(54906003)(110136005)(76176999)(101416001)(50986999)(86152003)(50226002)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1445; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM03FT025; 1:f4RkBZo10ln+8aFqmIlTnGFx7E2nq9v9+BNFi5PM+BOZRaaPQwtWsuAJk125fM+77EV3+6rcDPzGycpfY89sDp0Jz/fZuGctTsc7J2si8RtCAtySVd1s3Z0cHsI639GW X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a111eb46-adda-420b-11d2-08d51270d9c7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:CY4PR12MB1445; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1445; 3:D0SI5W0AYWN/YdUOKnpwsFywMMjdoOCV++88oAu6CSKsN3GKatmeyN1bZ5kxrGKSvoev7U3s+28VLlfTtnz/5dd7LCRQz4VQhvB+gyP7g+MTX1jtCUnTgEsgcfRyswThEE2vQQ3dsSzf8oOc9S4a0YziplSEUcB72Ug7Zkzbb4OY8Fr/W4PQ3gX4vEqUPM3IECYHBaBodVBV7bEUZGSnL/nvNuaVf9Zxp8Uudk+j5PzVZIuLI4xUA5H6GNiAW2rwhU0QPdGh8PMMTeKyGJ9TW6TIqT+qJ/VGLF/HE9pMSO2+6DKVZwK4Dw3nJ6ehjedEehfDQsrGvVcTIWbeK4BEBRLMUtEeHOIHCCUBrs65ioE=; 25:1IN89iNZEt6mvMgkI1yM28JgkkENrfSJlGBxY96k9FfQJkfJMxPETQPJjDizemamh9Zy+Eo4iSsrKsdhQcELOyvg4KJdOTjURhP/5B4/Ie0vgu9NyigP2KK6g1blYsob0OTnAy4OEMJUAd935AMeHtijyc48eb2NEguJ4O/ip9D8Iz0HwNPkR5vPrJaSFibfr4DmJSt4FiwC8OQxFQEvxu1w3WNwBg5wMniukdU+i/jZ1ZnJZmAL3xlY9EzhYz0JIJ1O6gIhKbdwuaPs2U+MIuJvC8K0rz1X/3Md3pVNBDkqeCHecUpwFxTCue0PapQABrK4EUnvKtwLH0wRgjK3yw== X-MS-TrafficTypeDiagnostic: CY4PR12MB1445: X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1445; 31:aYONxQaoB9FxdtAA8EUBQXIs1Oez4sGa+auo2Fnc5DyxnIUS1uzLhgn+XhWGq2cBvWOPWFKkNJaWu0S/TYJC8nhCEgj9JH1V8m382vkA6tijGAw1+0IkLiGQMZMdTu6tefyzs2aIX8vNE1btXBTbT/r9Vl5l2KpRghv8vzKZVsQeBOCQAhgUUT0i0o0PeoBJDd7N/Q0lFL5TW1syT1Uw5pkGLGK7VzhK0zvvg52C9Mk=; 20:XiuS3eb9jL/cjm7/5sb46OkvZogovn9OgWQrMDcWgOmgGezUJuIQb+7P2y5YLSUQIq46ABSnK6Ql142dPH/9Y8Bp2oM8Y7mN9PVhFbYC5PHJbaw7i21IxIA0yBjDiRtfVQBj0ZgCXandTUioc5U+4m9KyJtSppcZxAcyfWSA3j9rgId0x70pBLIwpUuIjl8IvuRbflvBQtxLQy7006Sc1CZd1N8g8XhV0XQoqjXv7brbb+VUVmMNqMpJfFIEjHada/D4Pg4gDFuTGEPALq2dUZ4A372UfEFPY6UXobkyIyvj4fUV9h/5ci5fXJcN8Chdgyo1IAKt7yboCEu8+y6uFmope2PoWTTxYoAf1k4I3Rj/CFaMrFOqES6swym/hQ/joEkd9qNKn5YqnSdWGXHvIXHRvAkd+Qnwg6GmrDh9yf0auJseTP6it/m3yPALI1etqBxL3rhFNMz73ROX5i4R6KVGMW1Vs9dvNe2wzV1ygeV0EfBSa5zKr19OKKIfJR2e X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93003095)(3002001)(100000703101)(100105400095)(6055026)(6041248)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR12MB1445; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR12MB1445; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1445; 4:ThN/vYR1T4zxGP2BUOE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/7Q==; 5:TgRRizoXkEqzC1HMgcer7GGJkUCC3A6SR0rtlsM3OXUC9cSmG/f8PRYV7ShQaGGHun+k7qsQZrBw35DUR7rqfmZRgY5r8QR3lWcuGYyzBzVU3wcyKfBwuFfNUVbOJLb5CN/HLwfEKSAw6ax74i7nSQ==; 24:NRuw/sYJ2gfsQdXcVDap+Di6j8aAsdiibUY5uIQXu2O9X4r1beVFgRIQhEsW62VbFDPeL+ib7Rsqr6/qY0SAVfcqEPxVKVxv0MPFF90sqZo=; 7:7eGC5XTou5P90Rd9mWnuEGzQNRJHhxQKP+x+hg5SrX/GxqVnT+WDZWDd+wL1FUnM/YsCaWzNhYKnoMlBG7l5FLb4tXVuxyZIKOIqxVkORAfxIV6lFROywhWvi2g6RpZClgeMeuTjIXOc/tvjB6s1j6AzZyEQBIMQC5oqwIBUP2c37wFtm7DFf5lcwBdEi5QyWIwPVRcPEQVR13ckIyRBCBkUuW/kdNBvw2mjdnpLzYo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1445; 20:MXPwbXDFk8ii7V6LRwStBH5mAtbgnlHkmn7X6VLiMVBivrnIILLxDOQ81h3NOMNb5+YFQ9MjdG88344otvHt2kgMa3loQg0wYKtrcTJ29TwGPhlphpuh9BXOFvQeAcWm6GNNiPsw1HIKyYrhPo8t8k+d5a+PA0l7UlLpV6Hq0dErb+5kbbRBNHtIiRt39v2yhIYBBrdXRIx3BrpYoHmOjEueH8tQBmUKW4rrzCuBw1Bom2XeRcyOLP87RtRS0TTy X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2017 19:30:24.0413 (UTC) X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1445 Cc: "Leo \(Sunpeng\) Li" , dri-devel@lists.freedesktop.org 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 From: "Leo (Sunpeng) Li" Use the correct for_each_new/old_* iterators instead of for_each_* The following functions were considered: amdgpu_dm_find_first_crtc_matching_connector: use for_each_new - Old from_state_var flag was always choosing the new state amdgpu_dm_display_resume: use for_each_new - drm_atomic_helper_duplicate_state is called during suspend to cache the state - It sets 'state' within the state triplet to 'new_state' amdgpu_dm_commit_planes: use for_each_old - Called after the state was swapped (via atomic commit tail) amdgpu_dm_atomic_commit: use for_each_new - Called before the state is swapped amdgpu_dm_atomic_commit_tail: use for_each_old - Called after the state was swapped dm_update_crtcs_state: use for_each_new - Called before the state is swapped (via atomic check) amdgpu_dm_atomic_check: use for_each_new - Called before the state is swapped v2: Split out typo fixes to a new patch. v3: Say "functions considered" instead of "affected functions". The latter implies that changes are made to each. Signed-off-by: Leo (Sunpeng) Li Reviewed-by: Harry Wentland --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 32 ++++++++--------------- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 3 +-- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 9bfe1f9..cc024ab 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -570,23 +570,15 @@ static int dm_suspend(void *handle) struct amdgpu_dm_connector *amdgpu_dm_find_first_crct_matching_connector( struct drm_atomic_state *state, - struct drm_crtc *crtc, - bool from_state_var) + struct drm_crtc *crtc) { uint32_t i; struct drm_connector_state *conn_state; struct drm_connector *connector; struct drm_crtc *crtc_from_state; - for_each_new_connector_in_state( - state, - connector, - conn_state, - i) { - crtc_from_state = - from_state_var ? - conn_state->crtc : - connector->state->crtc; + for_each_new_connector_in_state(state, connector, conn_state, i) { + crtc_from_state = conn_state->crtc; if (crtc_from_state == crtc) return to_amdgpu_dm_connector(connector); @@ -3890,7 +3882,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, unsigned long flags; /* update planes when needed */ - for_each_new_plane_in_state(state, plane, old_plane_state, i) { + for_each_old_plane_in_state(state, plane, old_plane_state, i) { struct drm_plane_state *plane_state = plane->state; struct drm_crtc *crtc = plane_state->crtc; struct drm_framebuffer *fb = plane_state->fb; @@ -4024,7 +4016,7 @@ void amdgpu_dm_atomic_commit_tail( dm_state = to_dm_atomic_state(state); /* update changed items */ - for_each_new_crtc_in_state(state, crtc, old_crtc_state, i) { + for_each_old_crtc_in_state(state, crtc, old_crtc_state, i) { struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); struct drm_crtc_state *new_state = crtc->state; @@ -4113,11 +4105,9 @@ void amdgpu_dm_atomic_commit_tail( new_acrtc_state = to_dm_crtc_state(new_crtcs[i]->base.state); new_stream = new_acrtc_state->stream; - aconnector = - amdgpu_dm_find_first_crct_matching_connector( + aconnector = amdgpu_dm_find_first_crct_matching_connector( state, - &new_crtcs[i]->base, - false); + &new_crtcs[i]->base); if (!aconnector) { DRM_DEBUG_DRIVER("Atomic commit: Failed to find connector for acrtc id:%d " "skipping freesync init\n", @@ -4151,7 +4141,7 @@ void amdgpu_dm_atomic_commit_tail( } /* Handle scaling and undersacn changes*/ - for_each_new_connector_in_state(state, connector, old_conn_state, i) { + for_each_old_connector_in_state(state, connector, old_conn_state, i) { struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector); struct dm_connector_state *con_new_state = to_dm_connector_state(aconnector->base.state); @@ -4205,7 +4195,7 @@ void amdgpu_dm_atomic_commit_tail( } /* update planes when needed per crtc*/ - for_each_new_crtc_in_state(state, pcrtc, old_crtc_state, j) { + for_each_old_crtc_in_state(state, pcrtc, old_crtc_state, j) { new_acrtc_state = to_dm_crtc_state(pcrtc->state); if (new_acrtc_state->stream) @@ -4218,7 +4208,7 @@ void amdgpu_dm_atomic_commit_tail( * mark consumed event for drm_atomic_helper_commit_hw_done */ spin_lock_irqsave(&adev->ddev->event_lock, flags); - for_each_new_crtc_in_state(state, crtc, old_crtc_state, i) { + for_each_old_crtc_in_state(state, crtc, old_crtc_state, i) { struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); if (acrtc->base.state->event) @@ -4402,7 +4392,7 @@ static int dm_update_crtcs_state( new_acrtc_state = to_dm_crtc_state(crtc_state); acrtc = to_amdgpu_crtc(crtc); - aconnector = amdgpu_dm_find_first_crct_matching_connector(state, crtc, true); + aconnector = amdgpu_dm_find_first_crct_matching_connector(state, crtc); /* TODO This hack should go away */ if (aconnector) { diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h index 630e6cd..1c55a0b 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h @@ -228,8 +228,7 @@ void amdgpu_dm_update_connector_after_detect( struct amdgpu_dm_connector *amdgpu_dm_find_first_crct_matching_connector( struct drm_atomic_state *state, - struct drm_crtc *crtc, - bool from_state_var); + struct drm_crtc *crtc); struct amdgpu_framebuffer;