From patchwork Wed Oct 11 14:24:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 9999967 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 EA49C60244 for ; Wed, 11 Oct 2017 15:58:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC42228A9B for ; Wed, 11 Oct 2017 15:58:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0B0E28A9F; Wed, 11 Oct 2017 15:58:38 +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 3B76A28A9B for ; Wed, 11 Oct 2017 15:58:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8BC316E6D1; Wed, 11 Oct 2017 15:58:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0058.outbound.protection.outlook.com [104.47.42.58]) by gabe.freedesktop.org (Postfix) with ESMTPS id 57DF76E6D1; Wed, 11 Oct 2017 15:58:36 +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=+oVQ7g6COAXNumFWksNNUtrP3mCm2mIsWZu5Xysa0co=; b=yW4z8FFpA0aN0N1+jUN8t/WUxqjTDCd2RFVGsU8FvqxzJYOB3um274FqAYIfQyfsVK6g8A6BG8El2xZ8qzk79f5imwGn3XJ2SisahoMX9fLnMDkNl1Hn/FQgT1Qt2tBtsi7ql5kEsXJV9/kHmY3FFe5PbWlE+rC7f8L8QvZVK7Q= Received: from BN6PR12CA0041.namprd12.prod.outlook.com (10.160.47.27) by MWHPR12MB1455.namprd12.prod.outlook.com (10.172.55.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Wed, 11 Oct 2017 14:24:48 +0000 Received: from DM3NAM03FT056.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::204) by BN6PR12CA0041.outlook.office365.com (2603:10b6:405:70::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.56.9 via Frontend Transport; Wed, 11 Oct 2017 14:24:47 +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 DM3NAM03FT056.mail.protection.outlook.com (10.152.83.158) 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; Wed, 11 Oct 2017 14:24:47 +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; Wed, 11 Oct 2017 09:24:45 -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; Wed, 11 Oct 2017 10:24:44 -0400 From: To: , Subject: [PATCH] amdgpu/dc: Use DRM new-style object iterators. Date: Wed, 11 Oct 2017 10:24:40 -0400 Message-ID: <1507731880-5843-1-git-send-email-sunpeng.li@amd.com> X-Mailer: git-send-email 2.7.4 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)(39860400002)(346002)(376002)(2980300002)(428002)(199003)(189002)(77096006)(305945005)(33646002)(4326008)(16586007)(5003940100001)(101416001)(53936002)(6666003)(478600001)(48376002)(72206003)(50466002)(2876002)(2906002)(54906003)(110136005)(86362001)(5660300001)(8936002)(81166006)(8676002)(39060400002)(36756003)(50986999)(189998001)(316002)(50226002)(81156014)(105586002)(106466001)(97736004)(86152003)(68736007)(53416004)(356003)(47776003)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1455; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT056; 1:8FpRxzyncr7/akwm8/S0SSCmM9mWIzUgs6tCTUWpbdF3j5A+7n0VXJXZPnJA0qK3T3R+kjziKuoWbQSWNUGHCSqi4LYuvsP0z2OUxRwfiSPeVcMTDbMHTxr5hUZXL/Iv X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ea9f343d-1a20-49fe-0dbc-08d510b3d34e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:MWHPR12MB1455; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1455; 3:Fy5PYLkChF9I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DHpdAu0DY3RUBjcSM/bXlTqL8uxgqqHPn4009HAziR23BU8c8aTyr2IW+R9kjh/AVBSVOB07u3Y2QMBzH1WeZSwbdnd/1OJANQQFjFAlHeF6AWHI7O5PB4k/n1cuyX/CEXp0RkjwqoMTJF3i9yTD2v6FidpiTSS9XCPWC830mCMu9bqKi+aATcbU6Q6VMiltjLtIJ7Tm6AEteDKSD35cT5XBtE3R339MHj0ctCNiZNkdxaJ2B+LRuxrPSVTv2jBm6czCF9Fsrnam2+Lft1TRuRgUzdF036J6BA+y+kHdXFHlCfsDeqk0Ay84EUszvP7h5XscF3d/tCdn8DWlLnPP5FYSgNswA8X053eZieaLID/Odq5dXU1D+u0rJXEFGU1WBe33MPoTSEpclyVx+4FonYCGtW5JoPizbZTLpqCkSiW6rG 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)(5005006)(8121501046)(3002001)(93006095)(93003095)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123558100)(20161123562025)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR12MB1455; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR12MB1455; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1455; 4:iywyczT74eeJhpw5ym6YsjovIvM/vk0FaR7LXISkMbCfCugElixcfMh8c2db+h5KmMVdQ/rQrdb1s8XkTcCNOsS0A4MQ1Q7/CG3Bq/Azlgcv6eBy2zjWnZ1+qQdu+VxIfFBha+84gexuqtdLe0C/s7241nNe3tEz0ZYyQlYAeMgsgaoKE6c8FDaru+wvN2f2Wbb7BLZupynl9bBULd5psK7O8iE/nxY17CsppIfVy7YPkXcHpF3D0i6+vUJ25G3/JPebtcorr39BOj4LnQrCh3BAhkeUYSgbPRWm4hurrQA= X-Forefront-PRVS: 0457F11EAF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR12MB1455; 23:LsTVxZbjorCmyad5Fvf1YjGJ0yQvNgRfKoQQ+gnd3?= =?us-ascii?Q?hOEnVsP+deKhEYwY035VpR8YUFAmVkLyBibMk/agWV9C5O0n/ETO+1/MbHuT?= =?us-ascii?Q?OUHLn+W5MDhUI+mxAN0Oc4uyzFerN28DXx8Ij97XhlnB51YhHwkJ3/EQO1Hd?= =?us-ascii?Q?+fShdfyaxKdvxzhLysxN/jR2KD3YJ2kikvhCQ8frwkD5G+lEBaRlhlpp5It7?= =?us-ascii?Q?tGZrsHo9DDqyRYMBHH9No9lV0ni0Re2SvHZMfjIn7U6DCDqOkgxvkTF39PeP?= =?us-ascii?Q?0YwqvO/2jBDOedfb/jazDofIH18lqXhLI42KhaZbY76QPt4CunXPddc2MD9b?= =?us-ascii?Q?iT+0U+DXZKAtKEkMEBuDX+mqGBJTuWThhfgyg8TBZkTBKXaJ/LjhFMLfNkTN?= =?us-ascii?Q?USMy5m2A3koXWMJEr0HsUgKiaH3NI+j2g8Q78Z/fo2lW4y7kCic9pjwlDQ0U?= =?us-ascii?Q?j0jSCrpNdAJ3ZVvpPjJWq2A+x4G/xjm/VUufb2iQHMmN/fheJXuj4FR/o/ch?= =?us-ascii?Q?Uyzkyz1Bhe6CQum1jllLxmvzSSlBWDnzO51scdUk7qi3MqNUjhclJSPtNa9/?= =?us-ascii?Q?g089k7oK2kCOSKU43sWtnHa2Kwt2cjRlrroY4V4sJlpE/uCQqWr+4/YfUkvN?= =?us-ascii?Q?t9D+scupm1Y3ju4Cq9T6SlgQ4HlocTwnlKC6/22KusvGRr2uasKYUURPCBCn?= =?us-ascii?Q?Y6XEnpyRxmDyt2wDAC+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jAXv4Q/fBQ2m9FsPDx08JrYVlKLa5G6Fki6E=; 7:dWQo36McHlZ5JevWMIBh0IkTPd6QNkxqU3k2H50go99ZtqW5XHbiqBn3uu8kqxRquyg58dpXG72R9brX2i3DP0NHrxTQEOqO7ke+eR20hFbboh6+POesRRh9fOIxOttwE6fXPfGk6HRk+0H91JNaiKftF9q7OtepiMDV+uCA+zbPFKALNBJjD4PLLToD+jCEpCHIg7zWaN4zArq+JLgPDBgxgsBH/n4KQWzROMLgtKQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1455; 20:06/QTeg0DAXyCEAFpKRoTOlVQkYA6puxH+OXQAVnuY4LV/i3CUme51JuPfHt9L6zuByaX7zYFCYUJ/9TF/bVh7nkmMD3vioWhr7KpVXY0vsOuRzEvM1ZpfTO7iy8tp9SJNIhnKMyPeWWXir25KzZRBs7mohAO4hUqmT23N8tsHXnqGp+AQsTnFN6BnPWdFylQr6ooR8ttqUW+hugGFfvdmA4JF5f0vkE0UBpEoo8pfAGn/BC9ikTU9Dautoqq9uv X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2017 14:24:47.0435 (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: MWHPR12MB1455 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 Also fix some typos. crct -> crtc undersacn -> underscan Signed-off-by: Leo (Sunpeng) Li --- Hi Dave, This patch goes on top of your fixup for new api's patch. Please feel free to squash them. Thanks, Leo drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 38 +++++++++-------------- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 5 ++- 2 files changed, 16 insertions(+), 27 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..9394558 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -568,25 +568,17 @@ static int dm_suspend(void *handle) return ret; } -struct amdgpu_dm_connector *amdgpu_dm_find_first_crct_matching_connector( +struct amdgpu_dm_connector *amdgpu_dm_find_first_crtc_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_crtc_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", @@ -4150,8 +4140,8 @@ void amdgpu_dm_atomic_commit_tail( } } - /* Handle scaling and undersacn changes*/ - for_each_new_connector_in_state(state, connector, old_conn_state, i) { + /* Handle scaling and underscan changes*/ + 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_crtc_matching_connector(state, crtc); /* TODO This hack should go away */ if (aconnector) { @@ -4715,7 +4705,7 @@ int amdgpu_dm_atomic_check(struct drm_device *dev, if (ret) goto fail; - /* Check scaling and undersacn changes*/ + /* Check scaling and underscan changes*/ /*TODO Removed scaling changes validation due to inability to commit * new stream into context w\o causing full reset. Need to * decide how to handle. 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..c1b77bd 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h @@ -226,10 +226,9 @@ extern const struct amdgpu_ip_block_version dm_ip_block; void amdgpu_dm_update_connector_after_detect( struct amdgpu_dm_connector *aconnector); -struct amdgpu_dm_connector *amdgpu_dm_find_first_crct_matching_connector( +struct amdgpu_dm_connector *amdgpu_dm_find_first_crtc_matching_connector( struct drm_atomic_state *state, - struct drm_crtc *crtc, - bool from_state_var); + struct drm_crtc *crtc); struct amdgpu_framebuffer;