From patchwork Thu Oct 12 21:15:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 10002935 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 0AE7160325 for ; Thu, 12 Oct 2017 21:15:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF92528ECF for ; Thu, 12 Oct 2017 21:15:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E491728ED3; Thu, 12 Oct 2017 21:15:45 +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 21EF028ECF for ; Thu, 12 Oct 2017 21:15:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C98F36E982; Thu, 12 Oct 2017 21:15:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0067.outbound.protection.outlook.com [104.47.40.67]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3FBE26E982; Thu, 12 Oct 2017 21:15:42 +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=r5aOQTrvNsIVtZ+3CT9z8UBnhe3FWwpT4gueOCxP4RY=; b=LWrStfUZQKpO6EHi+YFR9DO0ziXyOm1AIu7dcb1/MrOxL6aKaD7xXjW8e0zcIiScDiwSXz4Q8vy7dE/fAiHPvnDoy7NPHjtj2fX6UAHh4ze5OjGPURNTepg2UvYYb1ixfkE2RyC1zjLkocEG3aLrhmf3CGCQVbETpWNuAHP6nJE= Received: from BN6PR1201CA0012.namprd12.prod.outlook.com (10.174.238.22) by BN6PR12MB1443.namprd12.prod.outlook.com (10.172.24.20) 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:39 +0000 Received: from BY2NAM03FT042.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::203) by BN6PR1201CA0012.outlook.office365.com (2603:10b6:405:4c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7 via Frontend Transport; Thu, 12 Oct 2017 21:15:39 +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 BY2NAM03FT042.mail.protection.outlook.com (10.152.85.47) 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:38 +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; Thu, 12 Oct 2017 16:15:33 -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:33 -0400 From: To: , Subject: [PATCH 4/6] drm/amd/display: Unify amdgpu_dm state variable namings. Date: Thu, 12 Oct 2017 17:15:09 -0400 Message-ID: <1507842911-16975-5-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)(97736004)(76176999)(50986999)(8676002)(2906002)(16586007)(86152003)(101416001)(110136005)(4326008)(54906003)(33646002)(72206003)(48376002)(81166006)(2950100002)(81156014)(5890100001)(106466001)(478600001)(47776003)(2876002)(50466002)(6666003)(105586002)(68736007)(189998001)(53416004)(53936002)(356003)(305945005)(5003940100001)(77096006)(575784001)(36756003)(5660300001)(50226002)(316002)(86362001)(8936002)(39060400002)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1443; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM03FT042; 1:mT5Px4EC9t+axW7bmfKWhoIlawk26C5p6wItr+ZLufc2gq+39jQXPenb39mqaNfgv7sbARK+qPwTapUHUb28o5F2P81JEW1v2tp0O/qPlgXEQRa6PNAODD3slVl2Sxhb X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 773eba43-4ddf-4174-8a1a-08d511b66340 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BN6PR12MB1443; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1443; 3:vfeoDvGWEWGJWNjSf2gGsdPdKbhpVnMHVJo3RPQL85S0gnFgkCfktSOoAMrfEE/1RaIhuqzAVZr74zjYiryFNDgKGi2y20zNfmHHu6fkiP/blYEyk7aOxpiG4U1TfOum1x4cohhtUJCvp6auBm2yWuoyOKj36Laqa6jTXgKLSe9mcP4+AyMWPbhHYmxccTq5Y7R/Q0KsmOPXHmujOs2t1Pciz6eFEXrX13syeKYFtPScL6Igd61iHY7AlTePsbC780TNql20kqiVcWLWsgMI4oAnmg3fALpI3EwcbJY4tzr7eGpJaR7rE95gXqigZvMFsnO1H7mkHH5yS1kS7EiwwZJUEOgzgnTBtaGoIdRLAAg=; 25:u4RpZYCIeXZjSBFVLYh3CBLIreFMzyOIEyqNz6b8LPjpmtCpNEwe5DbMh0gTBPFPdFqEfmgUm414ZZwi6Qx7+/XvHwgTa3tVGkRWjFYMa21yeCsCccJyr/bCvj6LmKDip9yNAqxSp2dIcD8kt7fnJzUmxUy6/5khF0BNwABd3OdFQ74VbiWND2xTiY6n1pz3wkUzbL1s7U5xCb5uGKGc4OqjBmj8orXDgOLbmd9VUoOeW7q6t+zsMELRQHUOL834NVcpjLAdFLmlRpO5NPt3QKtVQvp+cPZMsk27nruRMcD5v2QDsTEbPoT+AqPurbUbH4wtIUyxzpYw4WEj5Bs+bA== X-MS-TrafficTypeDiagnostic: BN6PR12MB1443: X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1443; 31:kfI8WGP1OuzpAo/xV7N50d2KeLq6C38Sk217Vhr1LU1cYiEp+dmtM4l8KDRAyvA/kjhCVC6PRQcrsYhGMJA5gXXf5lSHD8f2megJRFn1EJ9C/vT0Exlsu0njB1JLf8pOJh8LFSVa9es4N5xAEH5hSZDXSpz4QAflv8j5Nh0M2ihanTVDIpKnSRs2tLWAUGOR58unciOivogSvWghykbhbWlYZrMH3SrKeHgN+5pHTIQ=; 20:FWzR7QV3INVWk9P4Xl3bbDL/Ipxstz1Az3LAHbZRmh6nV/lD46RCEz4LxgMpQJgryTc++KA6EHRX5KvE5zdEqvy+3uSURQHKrXQxsbCOnkQZNncFs6CpVpmYJaXPKMtkyeaTBq66YpaGUQK51R6Qb6DA5z2seRoBLnED5gY8w+2zv1NQlzAf5TU5A7sQh/4qs/htetkZK+OFwiMubepc1zSF+jFAzn5lz55+LoxvP62ilNa+D1//K8+C/l274Er/gDOn6JuOIkiUVZmf5GmFk0kn6tCQHleHn+ZKjS6p7VOyixlP7s5YvttEXyiuAX75MGcaQ1sWXoUilLDmns4/Th4E/yUVjg3e9Tsey+Imfosit70lsfFAAU6icowQGv0+9hNTz2pfDobujlk+Nzq/dIT2DaUN7Qkx/m4YTx9R1XIl4ezZprxpb9cFE1jYIXrV+2hUU/cjhuhOJttzNOXNtDtFAlHiFkT8ScF1ufp50OJQYv4oPbDlz8ldzCanqtyy 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)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93003095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123560025)(20161123555025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR12MB1443; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR12MB1443; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1443; 4:I3P6U26PfTFZACAFu3euwepw5fyscCdm48qurb0YKz9OQW8vtMkpDmMfjhSqHKMktoXucsFGgIjs4az9+NDSdV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zYNYVaS6AXX1m4Qg==; 5:Q0ZOX9xBIvuF2ZyX9CIBOjvUcvS1bLt8iNcarjPArb9M54J2hInJxGUoShriTsXi9tKWIjuCcmHRLC0hUoGa7z656zrcqV5e5YCcwqLwtcyw0ATXJ1nOzahZ6CeFzISsMmTjmybLz2s7KIBmuzRyNN1LzlwZpEZcWPpoLCEeRl0=; 24:npKpPAhB7oR5Rm58TFqV5Oo+L+JV+ihHhbKjbOQlYopXn+o2D4GWuYc/w0fN8BNzGqOXdiO5Yt7MjNqgBaqsV9/2LYgnldR0qg+Pg1TpSUo=; 7:jaOoDZ7+VCIYHeHmwHkZB21TGtjtVaNHqyIX6Xz4xYWxoyNwFd8FDGuEfvd5EwCUoJP419bZgwSIWML/VpHG4UKJYXRr+eAWHyyZay9XkQpIjOj9NHH3C0V701tw8zOVI9XPz+BRHvxZOflPmgma7CxEovyfJImzcNKK7uTqxPQJ7cXgxtGVTi/YmCv4CAdPVmPPIG0dM52T0SLqHH9f4asIYl5/u8DWq6ZzmnuYXak= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1443; 20:k+tGrYARraCq/YHrTVGeJjbOLiD90KhH/F2A8jquDNRdX4MgLWzTOlu29u2OOafj7mgwJ/JM+EX3P10xJFa8OBxUX9GLh7YE+mvQD2mvPh2+XFOnZNECa01q2rW5yPnnAlJvoBgr8a0ZFJ6RDZ46IS1BRWOJgOo/seBmkuIZigBOVxqKYIRcHtT3mVLxMuQgsccKopP0P4eRHHbQuXvcJj2Op2st7m735tRkdAq2DCfVFcc6qs2dlw9n8D5Ip9JL X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2017 21:15:38.8124 (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: BN6PR12MB1443 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 dm_new_*_state and dm_old_*_state for their respective amdgpu_dm new and old object states. Helps with readability, and enforces use of new DRM api (choose either new, or old). Signed-off-by: Leo (Sunpeng) Li --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 137 +++++++++++----------- 1 file changed, 68 insertions(+), 69 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 fe0b658..de88ee1 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -3890,7 +3890,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, drm_atomic_get_new_crtc_state(state, crtc); struct drm_framebuffer *fb = new_plane_state->fb; bool pflip_needed; - struct dm_plane_state *dm_plane_state = to_dm_plane_state(new_plane_state); + struct dm_plane_state *dm_new_plane_state = to_dm_plane_state(new_plane_state); if (plane->type == DRM_PLANE_TYPE_CURSOR) { handle_cursor_update(plane, old_plane_state); @@ -3914,9 +3914,9 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, spin_unlock_irqrestore(&crtc->dev->event_lock, flags); if (!pflip_needed) { - WARN_ON(!dm_plane_state->dc_state); + WARN_ON(!dm_new_plane_state->dc_state); - plane_states_constructed[planes_count] = dm_plane_state->dc_state; + plane_states_constructed[planes_count] = dm_new_plane_state->dc_state; dc_stream_attach = acrtc_state->stream; planes_count++; @@ -3983,10 +3983,10 @@ int amdgpu_dm_atomic_commit( * the ISRs. */ for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { - struct dm_crtc_state *old_acrtc_state = to_dm_crtc_state(old_crtc_state); + struct dm_crtc_state *dm_old_crtc_state = to_dm_crtc_state(old_crtc_state); struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); - if (drm_atomic_crtc_needs_modeset(new_crtc_state) && old_acrtc_state->stream) + if (drm_atomic_crtc_needs_modeset(new_crtc_state) && dm_old_crtc_state->stream) manage_dm_interrupts(adev, acrtc, false); } @@ -4012,7 +4012,7 @@ void amdgpu_dm_atomic_commit_tail( bool wait_for_vblank = true; struct drm_connector *connector; struct drm_connector_state *old_con_state, *new_con_state; - struct dm_crtc_state *old_acrtc_state, *new_acrtc_state; + struct dm_crtc_state *dm_old_crtc_state, *dm_new_crtc_state; drm_atomic_helper_update_legacy_modeset_state(dev, state); @@ -4022,8 +4022,8 @@ void amdgpu_dm_atomic_commit_tail( for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); - new_acrtc_state = to_dm_crtc_state(new_crtc_state); - old_acrtc_state = to_dm_crtc_state(old_crtc_state); + dm_new_crtc_state = to_dm_crtc_state(new_crtc_state); + dm_old_crtc_state = to_dm_crtc_state(old_crtc_state); DRM_DEBUG_DRIVER( "amdgpu_crtc id:%d crtc_state_flags: enable:%d, active:%d, " @@ -4041,11 +4041,11 @@ void amdgpu_dm_atomic_commit_tail( * aconnector as needed */ - if (modeset_required(new_crtc_state, new_acrtc_state->stream, old_acrtc_state->stream)) { + if (modeset_required(new_crtc_state, dm_new_crtc_state->stream, dm_old_crtc_state->stream)) { DRM_DEBUG_DRIVER("Atomic commit: SET crtc id %d: [%p]\n", acrtc->crtc_id, acrtc); - if (!new_acrtc_state->stream) { + if (!dm_new_crtc_state->stream) { /* * this could happen because of issues with * userspace notifications delivery. @@ -4067,8 +4067,8 @@ void amdgpu_dm_atomic_commit_tail( } - if (old_acrtc_state->stream) - remove_stream(adev, acrtc, old_acrtc_state->stream); + if (dm_old_crtc_state->stream) + remove_stream(adev, acrtc, dm_old_crtc_state->stream); /* @@ -4092,8 +4092,8 @@ void amdgpu_dm_atomic_commit_tail( DRM_DEBUG_DRIVER("Atomic commit: RESET. crtc id %d:[%p]\n", acrtc->crtc_id, acrtc); /* i.e. reset mode */ - if (old_acrtc_state->stream) - remove_stream(adev, acrtc, old_acrtc_state->stream); + if (dm_old_crtc_state->stream) + remove_stream(adev, acrtc, dm_old_crtc_state->stream); } } /* for_each_crtc_in_state() */ @@ -4107,9 +4107,9 @@ void amdgpu_dm_atomic_commit_tail( new_crtc_state = drm_atomic_get_new_crtc_state(state, &new_crtcs[i]->base); - new_acrtc_state = to_dm_crtc_state(new_crtc_state); + dm_new_crtc_state = to_dm_crtc_state(new_crtc_state); - new_stream = new_acrtc_state->stream; + new_stream = dm_new_crtc_state->stream; aconnector = amdgpu_dm_find_first_crct_matching_connector( state, &new_crtcs[i]->base); @@ -4131,14 +4131,14 @@ void amdgpu_dm_atomic_commit_tail( for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); - new_acrtc_state = to_dm_crtc_state(new_crtc_state); + dm_new_crtc_state = to_dm_crtc_state(new_crtc_state); - if (new_acrtc_state->stream != NULL) { + if (dm_new_crtc_state->stream != NULL) { const struct dc_stream_status *status = - dc_stream_get_status(new_acrtc_state->stream); + dc_stream_get_status(dm_new_crtc_state->stream); if (!status) - DC_ERR("got no status for stream %p on acrtc%p\n", new_acrtc_state->stream, acrtc); + DC_ERR("got no status for stream %p on acrtc%p\n", dm_new_crtc_state->stream, acrtc); else acrtc->otg_inst = status->primary_otg_inst; } @@ -4146,9 +4146,9 @@ void amdgpu_dm_atomic_commit_tail( /* Handle scaling and undersacn changes*/ for_each_oldnew_connector_in_state(state, connector, old_con_state, new_con_state, i) { - struct dm_connector_state *con_new_state = to_dm_connector_state(new_con_state); - struct dm_connector_state *con_old_state = to_dm_connector_state(old_con_state); - struct amdgpu_crtc *acrtc = to_amdgpu_crtc(con_new_state->base.crtc); + struct dm_connector_state *dm_new_con_state = to_dm_connector_state(new_con_state); + struct dm_connector_state *dm_old_con_state = to_dm_connector_state(old_con_state); + struct amdgpu_crtc *acrtc = to_amdgpu_crtc(dm_new_con_state->base.crtc); struct dc_stream_status *status = NULL; if (acrtc) @@ -4159,19 +4159,19 @@ void amdgpu_dm_atomic_commit_tail( continue; /* Skip any thing not scale or underscan changes */ - if (!is_scaling_state_different(con_new_state, con_old_state)) + if (!is_scaling_state_different(dm_new_con_state, dm_old_con_state)) continue; - new_acrtc_state = to_dm_crtc_state(new_crtc_state); + dm_new_crtc_state = to_dm_crtc_state(new_crtc_state); - update_stream_scaling_settings(&con_new_state->base.crtc->mode, - con_new_state, (struct dc_stream_state *)new_acrtc_state->stream); + update_stream_scaling_settings(&dm_new_con_state->base.crtc->mode, + dm_new_con_state, (struct dc_stream_state *)dm_new_crtc_state->stream); - status = dc_stream_get_status(new_acrtc_state->stream); + status = dc_stream_get_status(dm_new_crtc_state->stream); WARN_ON(!status); WARN_ON(!status->plane_count); - if (!new_acrtc_state->stream) + if (!dm_new_crtc_state->stream) continue; /*TODO How it works with MPO ?*/ @@ -4179,7 +4179,7 @@ void amdgpu_dm_atomic_commit_tail( dm->dc, status->plane_states, status->plane_count, - new_acrtc_state->stream)) + dm_new_crtc_state->stream)) dm_error("%s: Failed to update stream scaling!\n", __func__); } @@ -4190,20 +4190,20 @@ void amdgpu_dm_atomic_commit_tail( struct amdgpu_crtc *acrtc = new_crtcs[i]; new_crtc_state = drm_atomic_get_new_crtc_state(state, &acrtc->base); - new_acrtc_state = to_dm_crtc_state(new_crtc_state); + dm_new_crtc_state = to_dm_crtc_state(new_crtc_state); if (adev->dm.freesync_module) mod_freesync_notify_mode_change( - adev->dm.freesync_module, &new_acrtc_state->stream, 1); + adev->dm.freesync_module, &dm_new_crtc_state->stream, 1); manage_dm_interrupts(adev, acrtc, true); } /* update planes when needed per crtc*/ for_each_new_crtc_in_state(state, pcrtc, new_crtc_state, j) { - new_acrtc_state = to_dm_crtc_state(new_crtc_state); + dm_new_crtc_state = to_dm_crtc_state(new_crtc_state); - if (new_acrtc_state->stream) + if (dm_new_crtc_state->stream) amdgpu_dm_commit_planes(state, dev, dm, pcrtc, &wait_for_vblank); } @@ -4377,7 +4377,7 @@ static int dm_update_crtcs_state( struct drm_crtc *crtc; struct drm_crtc_state *old_crtc_state, *new_crtc_state; int i; - struct dm_crtc_state *old_acrtc_state, *new_acrtc_state; + struct dm_crtc_state *dm_old_crtc_state, *dm_new_crtc_state; struct dm_atomic_state *dm_state = to_dm_atomic_state(state); struct dc_stream_state *new_stream; int ret = 0; @@ -4392,8 +4392,8 @@ static int dm_update_crtcs_state( new_stream = NULL; - old_acrtc_state = to_dm_crtc_state(old_crtc_state); - new_acrtc_state = to_dm_crtc_state(new_crtc_state); + dm_old_crtc_state = to_dm_crtc_state(old_crtc_state); + dm_new_crtc_state = to_dm_crtc_state(new_crtc_state); acrtc = to_amdgpu_crtc(crtc); aconnector = amdgpu_dm_find_first_crct_matching_connector(state, crtc); @@ -4428,8 +4428,7 @@ static int dm_update_crtcs_state( } } - if (dc_is_stream_unchanged(new_stream, - old_acrtc_state->stream)) { + if (dc_is_stream_unchanged(new_stream, dm_old_crtc_state->stream)) { new_crtc_state->mode_changed = false; @@ -4456,7 +4455,7 @@ static int dm_update_crtcs_state( /* Remove stream for any changed/disabled CRTC */ if (!enable) { - if (!old_acrtc_state->stream) + if (!dm_old_crtc_state->stream) goto next_crtc; DRM_DEBUG_DRIVER("Disabling DRM crtc: %d\n", @@ -4466,13 +4465,13 @@ static int dm_update_crtcs_state( if (!dc_remove_stream_from_ctx( dc, dm_state->context, - old_acrtc_state->stream)) { + dm_old_crtc_state->stream)) { ret = -EINVAL; goto fail; } - dc_stream_release(old_acrtc_state->stream); - new_acrtc_state->stream = NULL; + dc_stream_release(dm_old_crtc_state->stream); + dm_new_crtc_state->stream = NULL; *lock_and_validation_needed = true; @@ -4482,11 +4481,11 @@ static int dm_update_crtcs_state( goto next_crtc; if (modeset_required(new_crtc_state, new_stream, - old_acrtc_state->stream)) { + dm_old_crtc_state->stream)) { - WARN_ON(new_acrtc_state->stream); + WARN_ON(dm_new_crtc_state->stream); - new_acrtc_state->stream = new_stream; + dm_new_crtc_state->stream = new_stream; dc_stream_retain(new_stream); DRM_DEBUG_DRIVER("Enabling DRM crtc: %d\n", @@ -4495,7 +4494,7 @@ static int dm_update_crtcs_state( if (!dc_add_stream_to_ctx( dc, dm_state->context, - new_acrtc_state->stream)) { + dm_new_crtc_state->stream)) { ret = -EINVAL; goto fail; } @@ -4528,9 +4527,9 @@ static int dm_update_planes_state( struct drm_crtc_state *old_crtc_state, *new_crtc_state; struct drm_plane *plane; struct drm_plane_state *old_plane_state, *new_plane_state; - struct dm_crtc_state *new_acrtc_state, *old_acrtc_state; + struct dm_crtc_state *dm_new_crtc_state, *dm_old_crtc_state; struct dm_atomic_state *dm_state = to_dm_atomic_state(state); - struct dm_plane_state *new_dm_plane_state, *old_dm_plane_state; + struct dm_plane_state *dm_new_plane_state, *dm_old_plane_state; int i ; /* TODO return page_flip_needed() function */ bool pflip_needed = !state->allow_modeset; @@ -4543,8 +4542,8 @@ static int dm_update_planes_state( for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) { new_plane_crtc = new_plane_state->crtc; old_plane_crtc = old_plane_state->crtc; - new_dm_plane_state = to_dm_plane_state(new_plane_state); - old_dm_plane_state = to_dm_plane_state(old_plane_state); + dm_new_plane_state = to_dm_plane_state(new_plane_state); + dm_old_plane_state = to_dm_plane_state(old_plane_state); /*TODO Implement atomic check for cursor plane */ if (plane->type == DRM_PLANE_TYPE_CURSOR) @@ -4558,9 +4557,9 @@ static int dm_update_planes_state( old_crtc_state = drm_atomic_get_old_crtc_state( state, old_plane_crtc); - old_acrtc_state = to_dm_crtc_state(old_crtc_state); + dm_old_crtc_state = to_dm_crtc_state(old_crtc_state); - if (!old_acrtc_state->stream) + if (!dm_old_crtc_state->stream) continue; DRM_DEBUG_DRIVER("Disabling DRM plane: %d on DRM crtc %d\n", @@ -4568,8 +4567,8 @@ static int dm_update_planes_state( if (!dc_remove_plane_from_context( dc, - old_acrtc_state->stream, - old_dm_plane_state->dc_state, + dm_old_crtc_state->stream, + dm_old_plane_state->dc_state, dm_state->context)) { ret = EINVAL; @@ -4577,8 +4576,8 @@ static int dm_update_planes_state( } - dc_plane_state_release(old_dm_plane_state->dc_state); - new_dm_plane_state->dc_state = NULL; + dc_plane_state_release(dm_old_plane_state->dc_state); + dm_new_plane_state->dc_state = NULL; *lock_and_validation_needed = true; @@ -4591,27 +4590,27 @@ static int dm_update_planes_state( continue; new_crtc_state = drm_atomic_get_new_crtc_state(state, new_plane_crtc); - new_acrtc_state = to_dm_crtc_state(new_crtc_state); + dm_new_crtc_state = to_dm_crtc_state(new_crtc_state); - if (!new_acrtc_state->stream) + if (!dm_new_crtc_state->stream) continue; - WARN_ON(new_dm_plane_state->dc_state); + WARN_ON(dm_new_plane_state->dc_state); - new_dm_plane_state->dc_state = dc_create_plane_state(dc); + dm_new_plane_state->dc_state = dc_create_plane_state(dc); DRM_DEBUG_DRIVER("Enabling DRM plane: %d on DRM crtc %d\n", plane->base.id, new_plane_crtc->base.id); - if (!new_dm_plane_state->dc_state) { + if (!dm_new_plane_state->dc_state) { ret = -EINVAL; return ret; } ret = fill_plane_attributes( new_plane_crtc->dev->dev_private, - new_dm_plane_state->dc_state, + dm_new_plane_state->dc_state, new_plane_state, new_crtc_state, false); @@ -4621,8 +4620,8 @@ static int dm_update_planes_state( if (!dc_add_plane_to_context( dc, - new_acrtc_state->stream, - new_dm_plane_state->dc_state, + dm_new_crtc_state->stream, + dm_new_plane_state->dc_state, dm_state->context)) { ret = -EINVAL; @@ -4714,9 +4713,9 @@ int amdgpu_dm_atomic_check(struct drm_device *dev, * decide how to handle. */ for_each_oldnew_connector_in_state(state, connector, old_con_state, new_con_state, i) { - struct dm_connector_state *con_old_state = to_dm_connector_state(old_con_state); - struct dm_connector_state *con_new_state = to_dm_connector_state(new_con_state); - struct amdgpu_crtc *acrtc = to_amdgpu_crtc(con_new_state->base.crtc); + struct dm_connector_state *dm_old_con_state = to_dm_connector_state(old_con_state); + struct dm_connector_state *dm_new_con_state = to_dm_connector_state(new_con_state); + struct amdgpu_crtc *acrtc = to_amdgpu_crtc(dm_new_con_state->base.crtc); /* Skip any modesets/resets */ if (!acrtc || drm_atomic_crtc_needs_modeset( @@ -4724,7 +4723,7 @@ int amdgpu_dm_atomic_check(struct drm_device *dev, continue; /* Skip any thing not scale or underscan changes */ - if (!is_scaling_state_different(con_new_state, con_old_state)) + if (!is_scaling_state_different(dm_new_con_state, dm_old_con_state)) continue; lock_and_validation_needed = true;