Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5585189img; Wed, 27 Mar 2019 11:10:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhps8xXjAgPouGMeLvpGhVi9PQNR3bfirTNn9/ro8pkJ6CzLCTt13nGtXXwg2Ct0SovJ/L X-Received: by 2002:a62:39c2:: with SMTP id u63mr35793684pfj.11.1553710208060; Wed, 27 Mar 2019 11:10:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553710208; cv=none; d=google.com; s=arc-20160816; b=BiwZFTj1Xg8md7HdhelwmCnH4HIsU1QYy9ZatmlHvWYH6e4G1ghRqPoyz7fIClD5mu baGP63uBJJ2ilBGR36V2PILV2EfzMKd77k8wIzKsotIVHbLc6Uy6xTYe5iMaGZy3Esbf MYN1UPaAEbTEuR4wOkkNa5qZN6KX6cHcnR2WLQ9Dwo55cDb2d078zZ4XJOF3lxnl+L4B 1+cjsLOnKTqc3IjZx6NLIgLraHBoVVEii2UCbgE4+G2tKL0NjODj6qEtjQfSCdjG2BYS LaL36vDRbvu7HKYiFCpXAGN7Nha5bFD47OA54Vb/lwaktq/PVc3Tg/A24ThjO6TrAT3L wlqQ== 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=vKBKjTgYgccFBBMAxWZQbtUbcmCa9K6dmRh9L8wsP88=; b=ckWRAVarFDOTWbEH5WioxihhwXB6QUpmLEvUAj9L2ceLpkCBgutw37gnjzXDc7I4bW VJPxdvY01CskukeRrpS7OmFVsKHZyKdAa5Dy5NqdxaqeisdSLOIcYfazeRMYqKLOfpa5 euv/T7VJzKEu4JFkNA3wPjDtmbJIMm0zjD+KB3dyKTeQM9NbNWXAjOoZ7t1TwIXEXKaK 1F8wWc5rNlPVw2doQP0NSoB0PoP3DQfR95IReuLkuw133RtpFHFp1AIvO8kOAIXhTBVc NUuS48dMCThT33mHUyIX7mBl1hB8YUEmPbuihfryVZQhEj/EhEBOmGsTiADs++j2GuYR K7rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jiuOP88u; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2si19418819pls.31.2019.03.27.11.09.51; Wed, 27 Mar 2019 11:10:08 -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=jiuOP88u; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388180AbfC0SH0 (ORCPT + 99 others); Wed, 27 Mar 2019 14:07:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:49236 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388165AbfC0SHY (ORCPT ); Wed, 27 Mar 2019 14:07:24 -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 6ADC52063F; Wed, 27 Mar 2019 18:07:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710044; bh=PV+ZNkfna2MH+a+qrrQ54e+h3H+BE59K0deX1cA54vw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jiuOP88uKK9shC8pDY8B7DqVlQUaQJrz+Vv9JJy++u+QHfou9l4WFVZtK9zNkRVnQ rlFbMT1Jq5fnrC0PFOHZytiM9JToztQxEeNxamdWvo4WNQiLrw1jipP+qcwmFoY/L5 JX43bGZG1srTMzDHVro6HaH9TlOlpiSUDRGD2C3o= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nicholas Kazlauskas , Alex Deucher , Sasha Levin , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.0 171/262] drm/amd/display: Don't re-program planes for DPMS changes Date: Wed, 27 Mar 2019 14:00:26 -0400 Message-Id: <20190327180158.10245-171-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-1-sashal@kernel.org> MIME-Version: 1.0 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 5062b797db4103218fa00ee254417b8ecaab7401 ] [Why] There are opt1c lock warnings and CRTC read timeouts when running the "igt@kms_plane@plane-position-hole-dpms-pipe-*" tests. These are caused by trying to reprogram planes that are not in the current context. DPMS off removes the stream from the context. In this case: new_crtc_state->active_changed = true new_crtc_state->mode_changed = false The planes are reprogrammed before the stream is removed from the context because stream_state->mode_changed = false. For DPMS adds the stream and planes back to the context: new_crtc_state->active_changed = true new_crtc_state->mode_changed = false The planes are also reprogrammed here before the stream is added to the context because stream_state->mode_changed = true. They were not previously in the current context so warnings occur here. [How] Set stream_state->mode_changed = true when new_crtc_state->active_changed = true too. This prevents reprogramming before the context is applied in DC. The programming will be done after the context is applied. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Sun peng Li Acked-by: Bhawanpreet Lakha Acked-by: Tony Cheng Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 6d77fd966dbd..0040605cace8 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -4975,7 +4975,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, static void amdgpu_dm_crtc_copy_transient_flags(struct drm_crtc_state *crtc_state, struct dc_stream_state *stream_state) { - stream_state->mode_changed = crtc_state->mode_changed; + stream_state->mode_changed = + crtc_state->mode_changed || crtc_state->active_changed; } static int amdgpu_dm_atomic_commit(struct drm_device *dev, -- 2.19.1