Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2678353lqp; Mon, 25 Mar 2024 06:28:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXvBjlikhbQ4jpdYV1PpYdDVVwu+C2NxRpfH3lxYSElMVY3U2vMpYFLDsDUqGm/MO6Wr5u/Dda0jlmJ74omA+SFd+L1NVapQNisrQiKhA== X-Google-Smtp-Source: AGHT+IHqadXmjJCMYaNdK0064/ma+zfgDAZ+No0um6zn1TqXV5p6mV30YwKbcTqMOnekNTfe1Ts5 X-Received: by 2002:a17:90b:202:b0:2a0:5318:d99 with SMTP id fy2-20020a17090b020200b002a053180d99mr3654714pjb.4.1711373316348; Mon, 25 Mar 2024 06:28:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711373316; cv=pass; d=google.com; s=arc-20160816; b=W1QyZJnBJH7EKiz7CG8M5PG93qaj/HagAf5pXCKlGXClTo+KZDpzWIGHnL6TVmMz6+ fu1NTNHJRrSTV6r0GlTR+zufbDCBQYhgoIPhkeBqesO3gy5+4hPAQh8wgzVkrc0bom/4 fegS0Rs6T4sKVOp/kT8jDH27GvcNZRv9KgaZgDEqrKyI1zpXyMULEFwQjmLuuDpqJGL9 LuqrAkZsVPMbd8AOlnwZz1FdBAkcGvAVjqWduIGyi05V2lkpaLcDQ+7oB4qg5U1SAVmA VbLPQjbGQmyDy0RnTRoViRk4j7mVnnvOBDlR5BGAcmzb7bjfFgPul89JUHAVRjXBFkDk 0QzA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=O99wYmmnwUVI7rKT0+mt85O+Ja4Hx1PnspZHUkBOzWg=; fh=mcs2eJK81y7a8Lo+s4C+J+/Z98bbHAdQdct3DGrYd/I=; b=rpF12anr6LsMOEDCbWoVGhEpkMNWNhVSS8JqsfnTAltIRmIOztJbJYo9VCUMQeDaha 0aXArrITPyfvqTpyGarCMK4hU0sVIDLrXAE6yi4T7sB4PtKd7XqZGwF1j+W79Gr8tPJv oVfz2VdISOcvy56ez8rpCzByQ7lX/VZfrIMVphWfCXwW5UYFN7bqhRai6CVxhXOM4Or/ gW1BQqtkcD8g2IB1Sx9aBBOzKeGZ/FWId6BMvOd7q6gMR/Rf4inuJQPpWW2jqy4OrYOs zff0w1/WM4ZmnCgoXvZQRstD/rE8PB5OgXUt0TBf1pY3lT4s/teuEu2v1svql0PLLvMB x7EA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WMbuhpnf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115504-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115504-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id f5-20020a17090ab94500b0029bb6ed5c4esi8520625pjw.82.2024.03.25.06.28.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 06:28:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115504-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WMbuhpnf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115504-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115504-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 927B6B2EE10 for ; Mon, 25 Mar 2024 11:08:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E0072365BA; Mon, 25 Mar 2024 02:41:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WMbuhpnf" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4976F1EC62E; Sun, 24 Mar 2024 22:55:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320944; cv=none; b=rYTK6cKtQUS742cIYpsOZfSd7hWJ8ndIZvLXBoA/kZE2e8DEIoaswrpRRLLElBW1mlany9poBBNYbtF1WmIeyJDCH/g8oXbvm5GZaGXBH4CbuDU9ZUkqidU2XclOGcMH20iIv1j+Y52vTkRMw+/6AV5/9ORqigWFypcxIFW4aQU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320944; c=relaxed/simple; bh=R0o9mtiY+b9wcMRZccfj/l4j7rw/QnFthxmzKd6U52Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Jcq8NG4kRFxDTkdO1IElCPLhWbm7bLq4qgLPYReuhcyy6H22q+iWxrm8O1D2ECwPf2KwdxtFCbZG0gxxS3HuRiBsfu1Zmyzq0naAHzDEKFR5eZ9tO1YHuDS2n66XQ1M1l5oDRYq4hw2XI3jCZFSFQvIZPEwyMeoZzoEyfo4Dod4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WMbuhpnf; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B5B8C43394; Sun, 24 Mar 2024 22:55:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320943; bh=R0o9mtiY+b9wcMRZccfj/l4j7rw/QnFthxmzKd6U52Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WMbuhpnf/CDWGWhcdXwaN2ppQ/eujmnzhi8IzMMJMe+71rFRpCA35zCQsyjqk6zZt JxTbUlAkOo7XwFDymcJhwneEgEkcksUrxJRYI4myn2rhBVTTNTC140Wi50pvRkFByV nXvQExkHIIM3ZkCHzQ+pReUdUDvVl/iU1VCzzo45260458tZm9ShxZipWkkVBE2COT aZt4EvuIBK2zhop3BQsdYxo0JeEV1BccXoDKR5byMchgT1a8LiI48bFBw/LiV0N9Vz a9oNd4pZSDPfiXuGKS++C8CYv0HNl2xN0WpZkLOUc+fiwp+Ex4iCXto67ZRK3AChRe 9tT6cYvaWR4zA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tomi Valkeinen , Aradhya Bhatia , Sasha Levin Subject: [PATCH 6.7 506/713] drm/tidss: Fix sync-lost issue with two displays Date: Sun, 24 Mar 2024 18:43:52 -0400 Message-ID: <20240324224720.1345309-507-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324224720.1345309-1-sashal@kernel.org> References: <20240324224720.1345309-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Tomi Valkeinen [ Upstream commit c079e2e113f2ec2803ba859bbb442a6ab82c96bd ] A sync lost issue can be observed with two displays, when moving a plane from one disabled display to an another disabled display, and then enabling the display to which the plane was moved to. The exact requirements for this to trigger are not clear. It looks like the issue is that the layers are left enabled in the first display's OVR registers. Even if the corresponding VP is disabled, it still causes an issue, as if the disabled VP and its OVR would still be in use, leading to the same VID being used by two OVRs. However, this is just speculation based on testing the DSS behavior. Experimentation shows that as a workaround, we can disable all the layers in the OVR when disabling a VP. There should be no downside to this, as the OVR is anyway effectively disabled if its VP is disabled, and it seems to solve the sync lost issue. However, there may be a bigger issue in play here, related to J721e erratum i2097 ("DSS: Disabling a Layer Connected to Overlay May Result in Synclost During the Next Frame"). Experimentation also shows that the OVR's CHANNELIN field has similar issue. So we may need to revisit this when we find out more about the core issue. Fixes: 32a1795f57ee ("drm/tidss: New driver for TI Keystone platform Display SubSystem") Reviewed-by: Aradhya Bhatia Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20240213-tidss-fixes-v1-2-d709e8dfa505@ideasonboard.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/tidss/tidss_crtc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/tidss/tidss_crtc.c b/drivers/gpu/drm/tidss/tidss_crtc.c index 7c78c074e3a2e..1baa4ace12e15 100644 --- a/drivers/gpu/drm/tidss/tidss_crtc.c +++ b/drivers/gpu/drm/tidss/tidss_crtc.c @@ -269,6 +269,16 @@ static void tidss_crtc_atomic_disable(struct drm_crtc *crtc, reinit_completion(&tcrtc->framedone_completion); + /* + * If a layer is left enabled when the videoport is disabled, and the + * vid pipeline that was used for the layer is taken into use on + * another videoport, the DSS will report sync lost issues. Disable all + * the layers here as a work-around. + */ + for (u32 layer = 0; layer < tidss->feat->num_planes; layer++) + dispc_ovr_enable_layer(tidss->dispc, tcrtc->hw_videoport, layer, + false); + dispc_vp_disable(tidss->dispc, tcrtc->hw_videoport); if (!wait_for_completion_timeout(&tcrtc->framedone_completion, -- 2.43.0