Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp934853ybt; Wed, 17 Jun 2020 18:20:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrwHS1vzbiW3cR8M7pBtATAwhyCFIAZp/PPL984b2Ds+KPqunwI65jQ3SiuAhDULvGFTeN X-Received: by 2002:aa7:c69a:: with SMTP id n26mr1821952edq.2.1592443202370; Wed, 17 Jun 2020 18:20:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592443202; cv=none; d=google.com; s=arc-20160816; b=Vw32RRHLlYHeGwdLb2XXTzD5W+So+7sIo404RdTRnhldOzQ6u3javnhGWknhwvXiYW 8SdVviSm7ib1ruRJndwbfZEihsI2vVGZDhTK4S0lJP62OGGodCyecsuDt+Dcz+FF1ahB 083G9fyD+jvEylN1wtjX/mwofWmQtAc8QjjTtIleCkx023kyNMbyok9nOOhH/i7Fq1Za wpT6DviCwdxXz18sMVSHv/Jn3cQ55nTELHmOIT33ONxHGGZ7t/6Hmzb4z3CC6TOUnGeM KShPS/gPtWaoA2x/vDviAhpQp+8ZyQqGv/9huyg3dK6jSY2xsyd9e5/x2A2PZ2nSVdFV DqPw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1erMEXoXBCDcb1E8KY69LI0dbQ4yQONpJz0vgn3fi24=; b=aDsgY7H7Zq18bpT2q3XG1n97cx4Ameikj34aCzXzqbRc691mqDznTVHD21mlH6U4Cn 2+ylZIh0E5eoa6MnHZfwMPGbBgLKTU8wI8EsdXgvvFTvhnNSEf0USxWmiX9jNK8wcDHr EZpZCo4q6aUjSR7bEsPVR81PWok/X0UGVtuOfG8g1VBHf7zf/GUxL5VfnNU8G7kzoAJ2 SdPcGcEAyp2O+1EmFNGxO1kTYXDyJ3Z6rLxBpof0isAObVgTPGfXaj+VJXa7vXZFjYsh EAoz7AUfc6xu3hOEG5d5q1HCHNsFO1veMQUmLP2aggkfY9jfwm2vfXu2YPWo/eGuDlRG kJAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DnVJ46bF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m10si957733ejc.104.2020.06.17.18.19.40; Wed, 17 Jun 2020 18:20:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DnVJ46bF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729864AbgFRBSA (ORCPT + 99 others); Wed, 17 Jun 2020 21:18:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:45152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729444AbgFRBPL (ORCPT ); Wed, 17 Jun 2020 21:15:11 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B7BD4221ED; Thu, 18 Jun 2020 01:15:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592442910; bh=21amvfPGX3hDybz2dRXi+ckX1IpZeShBQQLLp7v3wQM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DnVJ46bFKVS9PRyMS+MKqgFFv5Rw74IdNnUMm10xMfvfX5WC9QrMGTwvNjMFnbDhK smKe97Zets8J4ysvnBx51cu+8G+XqeenZNAFgoFXBdjOb/O6dqYAt7D1/TqbtbA+i9 ZnyaGJ5TOmosZ91oytSH6P2AEzud+yqOTSDM22mI= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nicholas Kazlauskas , Hersen Wu , Alex Deucher , Sasha Levin , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.7 329/388] drm/amd/display: Revalidate bandwidth before commiting DC updates Date: Wed, 17 Jun 2020 21:07:06 -0400 Message-Id: <20200618010805.600873-329-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200618010805.600873-1-sashal@kernel.org> References: <20200618010805.600873-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 [ Upstream commit a24eaa5c51255b344d5a321f1eeb3205f2775498 ] [Why] Whenever we switch between tiled formats without also switching pixel formats or doing anything else that recreates the DC plane state we can run into underflow or hangs since we're not updating the DML parameters before committing to the hardware. [How] If the update type is FULL then call validate_bandwidth again to update the DML parmeters before committing the state. This is basically just a workaround and protective measure against update types being added DC where we could run into this issue in the future. We can only fully validate the state in advance before applying it to the hardware if we recreate all the plane and stream states since we can't modify what's currently in use. The next step is to update DM to ensure that we're creating the plane and stream states for whatever could potentially be a full update in DC to pre-emptively recreate the state for DC global validation. The workaround can stay until this has been fixed in DM. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Hersen Wu Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/core/dc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index 47431ca6986d..4a619328101c 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -2517,6 +2517,12 @@ void dc_commit_updates_for_stream(struct dc *dc, copy_stream_update_to_stream(dc, context, stream, stream_update); + if (!dc->res_pool->funcs->validate_bandwidth(dc, context, false)) { + DC_ERROR("Mode validation failed for stream update!\n"); + dc_release_state(context); + return; + } + commit_planes_for_stream( dc, srf_updates, -- 2.25.1