Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp5855597ybn; Sun, 29 Sep 2019 07:09:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRlmMBmkLmDtBNdNyWYBYFtApKMC0+zgag6jICAyz+CT4MFyOEr/ykDtihPWpSaI2BIvPu X-Received: by 2002:aa7:d692:: with SMTP id d18mr14493209edr.95.1569766142531; Sun, 29 Sep 2019 07:09:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569766142; cv=none; d=google.com; s=arc-20160816; b=UZCTEMv1dCLuFynhCQxjOvNnMbX7t0jCyMqWwj0uEKHpg+WT4B2gDeNtv4UbKWJGJN cOaNOFg4Exn9H91dfptObdPXg7bCOLoa36d9Un6MP1h/QSUgWL3tS8EymN0ZkH/VBbkf 2SCttPE15e0sbIsY9PgbhnZw1B6G5Qv2/QB80LqD7RnlvSWs3gX0T9VEJc+LCM9+O4rp iZoAJ9DOBZlxA4P/OExT4HS6rdCTn76ERSofXFV+/hoqph8G7qbIqt++GB19PQoW/TTn ihlyxDO/thgb//lsjrdfU3Hgf4HGQswEfbPYSHBQTnTr23yG0dld00FJE7y3DSF5xTJ8 pAYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Shc2PkqktWgn6kC85ujdMSab5Nr04NPZKYhhTGt1Z6E=; b=Vrc9dG58DEvyqoPBI24dgPjXIp2R4RwbfjJH0bNa4bir4hwQwBdQKPiNCOSOWaS+dq KXGQcH4HxHotJ0/UE/y6FO8nazHz8i8CU6L4tCqsW93IvK34N2kBBI+Tr0PSYe2TPXaa qXgcWnZNaVhwe/FlJOR+nhaje8IJHzru141mR5FWqJ02fa4zQMiQeIRXkoxmJSoPRn5M UEXkq8DzFKMRyr5nLktC30pMPvfVIlijRQbSgSB8CNhLmFxOkszgHI06Jt8VduWJIljS RJAFjKb7QXPz+pMK7xvyvvbmiAI389Gs4Q71emZFIXxoij8R6+cJvZU2Kbj1F5FXVAqg R1iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="ga/9oN/L"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h2si5112359edw.29.2019.09.29.07.08.38; Sun, 29 Sep 2019 07:09:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="ga/9oN/L"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729369AbfI2OA7 (ORCPT + 99 others); Sun, 29 Sep 2019 10:00:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:42998 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729244AbfI2OA5 (ORCPT ); Sun, 29 Sep 2019 10:00:57 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9752E2082F; Sun, 29 Sep 2019 14:00:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569765657; bh=0ypLSC/KcmwjLgn3ht6PIFJ6s8BN10R4v6dsLwp00z8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ga/9oN/LnA0XE4kzQ9i1O1dAnFRA24WdDxcl7V1gvHkqPyuI3uo66jDiYhl+se+n+ 2vw7qmSMVeQhLoVMbzkv3eV4v2smc/m1WpLUC7hcqt9oGPnRiTiyxhetIqFJlR7nA/ 1ZDuCukxxzGir6lV/PKrBtY/I9pSDAO5fw+ZBx5g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicholas Kazlauskas , Alex Deucher , David Francis Subject: [PATCH 5.2 07/45] drm/amd/display: Skip determining update type for async updates Date: Sun, 29 Sep 2019 15:55:35 +0200 Message-Id: <20190929135026.938374147@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190929135024.387033930@linuxfoundation.org> References: <20190929135024.387033930@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicholas Kazlauskas commit 43d10d30df156f7834fa91aecb69614fefc8bb0a upstream. [Why] By passing through the dm_determine_update_type_for_commit for atomic commits that can be done asynchronously we are incurring a performance penalty by locking access to the global private object and holding that access until the end of the programming sequence. This is also allocating a new large dc_state on every access in addition to retaining all the references on each stream and plane until the end of the programming sequence. [How] Shift the determination for async update before validation. Return early if it's going to be an async update. Signed-off-by: Nicholas Kazlauskas Acked-by: Alex Deucher Reviewed-by: David Francis Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 27 ++++++++++++++++------ 1 file changed, 20 insertions(+), 7 deletions(-) --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -6788,6 +6788,26 @@ static int amdgpu_dm_atomic_check(struct if (ret) goto fail; + if (state->legacy_cursor_update) { + /* + * This is a fast cursor update coming from the plane update + * helper, check if it can be done asynchronously for better + * performance. + */ + state->async_update = + !drm_atomic_helper_async_check(dev, state); + + /* + * Skip the remaining global validation if this is an async + * update. Cursor updates can be done without affecting + * state or bandwidth calcs and this avoids the performance + * penalty of locking the private state object and + * allocating a new dc_state. + */ + if (state->async_update) + return 0; + } + /* 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 @@ -6840,13 +6860,6 @@ static int amdgpu_dm_atomic_check(struct ret = -EINVAL; goto fail; } - } else if (state->legacy_cursor_update) { - /* - * This is a fast cursor update coming from the plane update - * helper, check if it can be done asynchronously for better - * performance. - */ - state->async_update = !drm_atomic_helper_async_check(dev, state); } /* Must be success */