From patchwork Thu Oct 12 21:15:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 10002931 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 2AC4660325 for ; Thu, 12 Oct 2017 21:15:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BA7B28ECF for ; Thu, 12 Oct 2017 21:15:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1027328ED3; Thu, 12 Oct 2017 21:15: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 73FC728ECF for ; Thu, 12 Oct 2017 21:15:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A6BFD6E973; Thu, 12 Oct 2017 21:15:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0049.outbound.protection.outlook.com [104.47.36.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id C24586E973; Thu, 12 Oct 2017 21:15:29 +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=u9WX0B5UMsKpIBk5lXOPgzLnTOrkK1fOc7wukTuE4Rk=; b=peIlHM9dqKlBb1MAdeAgLTaYLpT2D44992e35fWHWVJVpSKRVvQWs8KTGhWn42YmNMWih4pXR2+kx9zWut9hwB9yYQZzTXQgAuvGS9AZQn/lu8d+QZrzh4fn3kvtlpGD/EIk84BOHDXTtiqZdCZlTjz4g3hoxyELJeIhaMYNz3o= Received: from CY1PR1201CA0024.namprd12.prod.outlook.com (10.169.17.162) by MWHPR1201MB0061.namprd12.prod.outlook.com (10.174.98.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 12 Oct 2017 21:15:27 +0000 Received: from CO1NAM03FT003.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::203) by CY1PR1201CA0024.outlook.office365.com (2a01:111:e400:5b9a::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.21 via Frontend Transport; Thu, 12 Oct 2017 21:15:27 +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 SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT003.mail.protection.outlook.com (10.152.80.100) 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; Thu, 12 Oct 2017 21:15:27 +0000 Received: from SATLEXDAG04.amd.com (10.181.40.9) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 12 Oct 2017 16:15:23 -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; Thu, 12 Oct 2017 17:15:22 -0400 From: To: , Subject: [PATCH v2 1/6] drm/amd/display: Use DRM new-style object iterators. Date: Thu, 12 Oct 2017 17:15:06 -0400 Message-ID: <1507842911-16975-2-git-send-email-sunpeng.li@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507842911-16975-1-git-send-email-sunpeng.li@amd.com> References: <1507842911-16975-1-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)(39860400002)(2980300002)(428002)(189002)(199003)(50986999)(16586007)(76176999)(316002)(6666003)(97736004)(189998001)(81166006)(86362001)(2950100002)(575784001)(8936002)(81156014)(8676002)(106466001)(47776003)(48376002)(305945005)(50466002)(36756003)(33646002)(53416004)(356003)(101416001)(110136005)(2876002)(68736007)(54906003)(105586002)(2906002)(50226002)(53936002)(478600001)(4326008)(77096006)(5660300001)(39060400002)(86152003)(5003940100001)(72206003)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR1201MB0061; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT003; 1:mPEJF0P5ik0p70g6CAM+iLZdATahP08RQAYByWER6h3tWN3YRhT0ZAd2LE/eKQYU4zjI6jpDiDKqZnGYft3EJ/o0VYVChCW2rd9MTjK4cjEM7R8WCmvlJpbnXgkZtMdC X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 237d4ea5-9c1d-44f9-091a-08d511b65c9d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:MWHPR1201MB0061; X-Microsoft-Exchange-Diagnostics: 1; MWHPR1201MB0061; 3:YBCx7BvwomGeKAXjBht2KIIPnzbQcBWhnHPli+7T8ok4GGKweZDIybMhifWjFTA3H0B5xyvzz5uDPi87W/TvUbMEUzuSOBtlUE/i7uPrZAB1HcTGhTK3v/JCOCKyI0A9XNYs/GYEfyy/maeS9wxpQp+83mtCs7miPQzrAorV86BJO+4IqAdFrlMn7aAN/24uoiBmierK5Df5Op28+JrHUTFkz2GI7W1zB/iMGwmz1+/bJ4xA9rT6dzvcF//nqk/IjYtpJllnFiBIIBNl/4Pu1c3mHCFmve9qExyvM7titzp6nMYMB6PmuVgqdrENysftCq8aLMH6ECisKZ/gvUyzLdbdvfsKn6R3B2rvyQ1l0QY=; 25:wvdphjaV5K2Bcd6Rp+i+F1nGN3+tS2CRYthqnaCJwaBuHM/KAdReVjxa6T+Rnry4H5jK7z6GGB5IrPB4BOafl212r8+sQ4DzxGzYFma73bJ0jEBctmB9XLNlMcfymYR0AzeMtgCG9/7Tbmox5anvPvoUBgNxsd2XEGPVoi0dnroEtPjmd+qPP5QSEb3P8kMBsF+xeguuVF8vdSx/XY7Y3hcRaQFtCYglCk4X6XuB/7HWXNkHhbeviCaU03HAGEIfopmhr5LOuhipxJe98g3CzHkKF1VvRSMOmud/otVoIWNLwMfOdpw3hdmIP7z0JipJ0qrIP/hbDU/XYKX5AJKnZg== X-MS-TrafficTypeDiagnostic: MWHPR1201MB0061: X-Microsoft-Exchange-Diagnostics: 1; MWHPR1201MB0061; 31:xVv/NpG4KDFxlxnsybH955HGXHVehiu/Nz2i/hJFCPohrLiOKYCvs4UEsDV3inNQJfrOlmwrbTkD4K5UPPZ08a3j5B89jt2hNMk9BkfQAgVVH6Qxuv18yYBiVknuXNJSFL67b/z41EoZv5fthNlwx2vsThLOGf6vFJwZyYhZ7YOWSOkK18MFhI4cU6bRySqXJH8MC7QssbpOmNh9NLkt8fUm8nY+quOBpPEuDVKujBo=; 20:udOyE/JNu5BbkAyDTPog7RuiV12JyP4z7cgAuBQLBryCNQPR9LS5hzc05VjbRp39QvgbAwdB3El/vPaCwMbnev5ZgFUvdYtoEt1h+iQNz47XAgQgoBN8pdsrO+v5dXPVLXGCNrEqN6R5+x79IpBDG68VvvjfYnN9w9s5RPbPvHXvSiEGnAzqkwkGVPDbPEGGdIem4TXO2exoZroppqAC+EamfsGZN1LAn1tqI6ESB78j49N8QkIf+hDTWnLeb82JBFPH/i/8xBo0Nyn/1qWD2hIvPVJkDiTt+NyvFHJHG71e/zJQNE1tEbswH3rCYGMb7aOV9lEIV9jVASe/hRqJiP9eIvZ/hcbYikhSrLujCgpRaWO0NyCySbvBEKmpvM1yvj6kmKYLA+zE5EZFgM1mhA9wEJnisB1THPphWDko9Gonhy5p6zs8uqx/YmPDwHcBeIuVRUfXGVVBpi7VcnHks297i3ejopA9/Y1TjVClqYrSDVKxsSTzUcP/7TCOoPyr 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)(93006095)(93003095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123558100)(20161123564025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR1201MB0061; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR1201MB0061; X-Microsoft-Exchange-Diagnostics: 1; MWHPR1201MB0061; 4:d3JJ24qdclyu6+XMQIclZPluW+Ypu09MKnAGR1irUWTrRjEoMGQXVdd/Erg2hVfaThM+IFWi/EjzGhcOL7pGQkGf/3yjJjZPFE7H3Wf0vFPM3VliDx66kNE10dt306r72fZw5dd7BOjTzyj7zKgZqlIkR3ibPfXW15zKqPGZNp0DViDaKk0xGXOq0/HZt9pk//7KGkyFi0Hc/bBiQpYi+Oz/hVXfRddTXOC7ggVFCfsv2eWXbYiKCF8PSWDwr9LAQrft9BlHkHYm7IxbmqyyglTZAonIUeaOg3Q6mTOtP58= X-Forefront-PRVS: 04583CED1A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR1201MB0061; 23:H6Bz9cIHny7EycgBrI0D2Ry/g8AGza4VuGAnPn/?= =?us-ascii?Q?BGadUTegJ64XMSRvuhIvFVZcE07sKfKhTN/62wdxsI/QwZuPUKngrx0TLFGi?= =?us-ascii?Q?qE6G14eyFy+Aa+/lQsIB5nalh4XJDYOgwxnfBPAFBpMYY81W6MdiyEJWxoEw?= =?us-ascii?Q?JdFkdD2vbbBVDAOpCREtANAdyK4MnAU0YNrFY6earnO6ZgMRZgiokXfg+C0J?= =?us-ascii?Q?jiEaBsyPWWD12uRoY2UylKLf7sxgz1k2KYAc0g4Ofoy1PLWgHJ6N5VPhjLe1?= =?us-ascii?Q?5tvj5gnybq6M8BEBKFe03DiRsKMz3GKPBrLAfnfVQBf2qYtLTMdZu7XpfsmW?= =?us-ascii?Q?T61fv2Sk6tLegDESoaeaZuf1cm1WaFgqRYEbOHuLB1fDyZrvYKXGuN0snIpO?= =?us-ascii?Q?wnMftdLyuxwManj3Gx0rwNrCyCJpRGRM66kUj1SvV81HBJbxX5G1f/xWsnnX?= =?us-ascii?Q?AsFVJF8JU3luJJ5UNjLZYeALNB5kq9xQc7J8sX01fise4ygdx8rTVZyxXibg?= =?us-ascii?Q?FiVhihj6Q+yt600XcvszmLp14WZ/Ugvrw01szdUQswyVJB6ZlzLtmhfpp6vY?= =?us-ascii?Q?7GAcvvGlVR/uSJ0PSiw0Hrz/lXtrxCqMG3OKC4ArQ11nCBa0JfK6kXvFewuA?= =?us-ascii?Q?SKRybmSyRfSSPx8iWWkBS3Dwr5xhgKR7uc4X86ducLgz5rVan5+TGz4S5t4g?= =?us-ascii?Q?4ci01use0++FzqqZGFlTrizNVCXwxO4m8/6wjJ1vS8zLUmAqOMNfPa8wezpQ?= =?us-ascii?Q?3xN6Crgp1or7/RFBgJnMYiE4o4PTDDBrmz8lULSRc7pBleAzBiG82R+o/NVi?= =?us-ascii?Q?FWxRATZz3icCouArKgnEYIsc4adFe8bp3xy5XtExS1gfF+r5ypr5ezz11DZH?= =?us-ascii?Q?ALDLR0k6CPruUx/ayzHoe5yXoReKO7B4vr+gtaOx8dqIrjU+BYcdlcZjgvIm?= =?us-ascii?Q?0t+NMq1Nl4QOTKeS/L+iwpJ6MaioaVzfYuVFLLKkZXSiUqDdEwx76Ga1fhKi?= =?us-ascii?Q?2Nq/Bif76b35WYHacHio4ZzavW7oRLIwS+93IjDZXarwBuNLUkevbI9tn5wq?= =?us-ascii?Q?5BIZiWY7xFqTj/wvgIoYv9a2D75jCX1GJrPmmzd602SMfJJOHUgmgkx1u0aH?= =?us-ascii?Q?joeinGUVpA57Owz8l3k2meOb7FqhO85wAxOLBvINXikDnAOAx+PnQuQ=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR1201MB0061; 6:vuGCFpHCPNY2NS/kUTL24/pQYMzZiokRyL9Z1emteiq4zNsha72jiCQbhRslaMpAAFAC7UPajp89LN8zhNAfX8hSs+Z7Qjf2YqzK925eauxCUz57WuIZqG4V58zij5qv5k52+WSzhSsX+fv7TGsuxCqeJSLy+pq5GVk0K8clalDgudooy/yepL8h2PJoElB86xR677i7fjiWOH7jW6cwLrqExRrzWiJD32hTcw6F99wkxpawXCT1gLMtiRKryTJvsLyjdr8QelButhSCXXt4Ze2k8+BCTbAabBIFtxsB/+XOLOVprqY1Rer1qoU/s5ahjPTeihonezBXef2ljC7NfQ==; 5:EGr+/x8RM6VQvIjj5JAMhXrqSwXfwXqfkJ7Zjvogr2wrq1Eb8dahmvQZ2WtRZKs5IgNSlFwBHkV0bTMD6lA0hv7fYK9HyYQz7OdyRZhZj5QisLWM8gA52J0dvZlmyftqr+/CEqx3/p0ZkZM81i2YQ0OurChf94ll/fwWa6BvE80=; 24:gBingx9bTexemOiq7stLXztpudyWIReCv9sewzzEj3V05mQFo2467wmv0FJjAcCgp1YI7vr2Opaq/CHHdRTyZdexxJRcNBvVE+rl3r5/zcs=; 7:s34wvypAs/qFDR1n8Y8EcswD2ciN6zHxpcAHV5P2U5ZsKlyMDe+GdbUFztXg1pw7b5AxfJ4H8PT5nP8Q8GVHOxaURQRpojSuoc5vk+Trb7FsXNp1rj7pYk0PGlrHQp0EagETJl5ADZqIL8TYW247+/emHXnCcv2sueQLKRsngGJHeiS6dSSguBjWHwJsSVfRMyL55uvxFLzQvcg7z0c/PpFC6CzuKoYX3H3kfDmtddE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR1201MB0061; 20:sur1qnHxmdXhRi/yFx9LB21Aw9abErIkGpUqfIJtLXTWl0nBB2unhUponqm5AHCHZHiZjIDaea1rJhrzWeYJIXCSiwPZGDyreN3bx1AAxvYR3vs0KN3Ofb0JyJGBBOW1WPqhF6ZN9uYCtJLoq/hZdCLwH4f1SXkOZh0aAo1nlAyyVkCLRitJi1cw33XNcBOA5AqFXlQo9cE+U7WmLNZ9Cizuq4VDW9MpGFTauAsEWeag2Ixof0cLfj9mqnDe3Wi2 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2017 21:15:27.6277 (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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0061 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_* List of affected functions: 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. Signed-off-by: Leo (Sunpeng) Li --- 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;