Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp5853994ybn; Sun, 29 Sep 2019 07:07:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVrXYs02HbbTL+soJDsdpWKq546WWrvjJgzTGWw6FyjB+5B1d/9TaRjNwX/N2fHqzVgR3L X-Received: by 2002:a50:8a9d:: with SMTP id j29mr15135839edj.283.1569766044057; Sun, 29 Sep 2019 07:07:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569766044; cv=none; d=google.com; s=arc-20160816; b=Pxcnl01vpQuohNHUxg7bIJJ458FI1A6tj8bRCu+Kumpv6xfWoH6Ys5o7XRQKBIpGbN /8ZZ4K5/J8D2xe5Hr9Ji8bzv8xGw2n+0tW6tZxhMUtMComQYmzsvsan1dS9vgRsEeQnN U+6f2jw1tuR+pduDfxbLAvtuA5QrldptP7tANfsvP2gE9klPTTxo1oRJ2wTsM+Vi7Yo4 pCP6HNQ24m/j6CLOGt1LyPsEzopg9uxgRPM7k5tE+EEdwfX5k7BeRSZrhBW+K4zcI7a7 pq3vXjnhwZpnyHJjSm5Qx5xg1dXI/Vclxq+EUeD2bFJMUu27NZwnXVH4lJGv+slxAgnR uXXg== 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=Azt+ZnKqfeljoxE/H3rqcRrrdJDXtSpslw6I4ovmSNw=; b=E+osATQ0a8Bcjg9DUMLdYHwX4tTgdWyWLM0W6O+STIpDa+upRydKQU4wgh+JUOCh7D bn+FO+bssU5CiDCthtTDve+DWSzZ1t5f9DdhAL8g2OGtPKP6PZ2+N0752Bv8IEkgbaUn 9ro3x/4w/z8oud5iwhIGH0lpe5PGO94NP0+rsBtafuS1omenVQydv3XTGVZ2TPiNma+o wmdTb+YaNVfm9iXFmbZTkJKNSTojXx5tTwvSq+Lw9PLCVVTwxH3BQzIeLtgiL2UEt2jz Zr+Uu5mXcMXMrB6A4UNjHvMklZCIEnWkoWQMJ5YWS53Ui8XBHfmPOHG6sNfNbycjwKps En6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IAhAv2bA; 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 f17si5399953ede.380.2019.09.29.07.06.58; Sun, 29 Sep 2019 07:07:24 -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=IAhAv2bA; 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 S1730365AbfI2ODf (ORCPT + 99 others); Sun, 29 Sep 2019 10:03:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:46714 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728809AbfI2ODe (ORCPT ); Sun, 29 Sep 2019 10:03:34 -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 D9AE32082F; Sun, 29 Sep 2019 14:03:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569765813; bh=xiOUHBKHsvXvkss4dduRDk/CwAhsptPTvK2WdmB5jcc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IAhAv2bAM2YbGLyWj/LEfzDeDWmaCBY5LR2jvy7LLZBKGucIHDZxKCqcg0vdxKBY6 wRD6yDdOGmIhqJYe3OqbknvXWLVFmfej8lw670CdKgKa580MtugAj7Nkaqapx8Pn+1 yh5qXBe4uKj6ZgP23ksNmiVzmdl4L0i+1gyLxBUI= 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.3 05/25] drm/amd/display: Skip determining update type for async updates Date: Sun, 29 Sep 2019 15:56:08 +0200 Message-Id: <20190929135010.311865952@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190929135006.127269625@linuxfoundation.org> References: <20190929135006.127269625@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 @@ -7274,6 +7274,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 @@ -7326,13 +7346,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 */