Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5649629img; Wed, 27 Mar 2019 12:25:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUWvE1jyKL2HrBVmqicPCVk9vkvj6TCaTZ4BCTvO9yBFlap7JIt0YqztRdtyu5AGO55dLs X-Received: by 2002:a17:902:781:: with SMTP id 1mr5524017plj.300.1553714757751; Wed, 27 Mar 2019 12:25:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553714757; cv=none; d=google.com; s=arc-20160816; b=aGTNzHo66wZqoVgRumk7fm97U2GHbPI7EhHUb4x0k6GdLJeC4rW/wSYZc27ccosbvN U6p35NrP36mmA2ZqDlp9DMKgpBtR1loK7HdeXdSjgvXW2slfydkCSUDT09OZ4bMEPm1F STTTnu3GaMHC3+uIKwA3yI5/0Uz0ZnM7uNnJ8+6Ws8B7vYNBMur7CCNfrYlUqG1ViuG8 SjfTCdwqzkZ4bJa9D5vRi5NbD1NLBA7Wtf7M4VRidzs3BvO9QKHhWDvYevl/eXP0QK5d 50Xc0134aXat/bGnhhImfMagVhv7Y4+0ODikhmh1NupGxAc/nd0XvpEB3hWl1cBguq0b WxwA== 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=/xWOpAzUZR4EFOHcyGKCI+riy2auYdIhAKn663nwqNA=; b=qc2Vxv1/294Z2Cl27ofHP1K9qLSmBJm5q1zXpJQ5rRPIjsnqZAp8qf/3LE/QXs2ySH 08BBu60+VV3j9oV90hWRJFlEPHgf4995hjk0EcPf4R8NsX+5AdqHebVqhISEOxwInqJV JnzaUhP02kzbbLrYq7FIxcKUAL3VT960PQyi1eXifg4cxe6rG1GoSDSGnLv6KgYsxCsi B+EzFhpd4g/+FzIpIeLYskJlIBV32EdD93FhOrQmAuIcGNVm+PKRVoULUkazllSL/PVq uHNWlsiiCAtmGxG3o73s6v2NNC5g7WAxLfyxZI03swObtjSOniyZfNMC70EtGWm1G+Xc YwHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=I1jCiQ52; 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 d9si21334711pln.403.2019.03.27.12.25.42; Wed, 27 Mar 2019 12:25:57 -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=I1jCiQ52; 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 S1732555AbfC0SF0 (ORCPT + 99 others); Wed, 27 Mar 2019 14:05:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:46488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387672AbfC0SFW (ORCPT ); Wed, 27 Mar 2019 14:05:22 -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 EDCC92063F; Wed, 27 Mar 2019 18:05:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553709921; bh=Bo7BmLm57a00gi9w6JjkHgzSbD/QgUcwRa4zFbDUc2A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I1jCiQ52p/aGPguWKt+7bmca/4Zr6zvAnVGn5kG7rPi3ejYIGGcrrWpR+f5iyfBUW bXco/LFXAVTjp8fTzW1McIIyKPPJEx9RNmr7wDS5T1BwngmfRoMGDrzXu6DdbVKQjx FC3SxnIEsnw2ok/duIdbJdwRvBMi9kly54Nl96EY= 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 114/262] drm/amd/display: Clear stream->mode_changed after commit Date: Wed, 27 Mar 2019 13:59:29 -0400 Message-Id: <20190327180158.10245-114-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 d8d2f174bcc2c26c3485c70e0c6fe22b27bce739 ] [Why] The stream->mode_changed flag can persist in the following sequence of atomic commits: Commit 1: Enable CRTC0 (mode_changed = true), Enable CRTC1 (mode_changed = true) Commit 2: Disable CRTC1 (mode_changed = false) In this sequence we want to keep the exiting CRTC0 but it's not in the atomic state for the commit since it hasn't been modified. In this case the stream->mode_changed flag persists as true and we don't re-program the planes for the existing stream. [How] The flag needs to be cleared and it makes the most sense to do it within DC after the state has been committed. Nothing following dc_commit_state should think that the stream's mode has changed. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Leo Li Acked-by: Tony Cheng Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index 5fd52094d459..1f92e7e8e3d3 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -1078,6 +1078,9 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *c /* pplib is notified if disp_num changed */ dc->hwss.optimize_bandwidth(dc, context); + for (i = 0; i < context->stream_count; i++) + context->streams[i]->mode_changed = false; + dc_release_state(dc->current_state); dc->current_state = context; -- 2.19.1