Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2390293lqp; Sun, 24 Mar 2024 17:19:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUXraCeGaypjw4PO032G9ita8CoxmAB9qjo3MVZwPATLz1UK+1KK+8DKa2lkawF/GYcYEDNVGSrfEcka0AvyJG12Kuh4FrzV5cJcxbDRg== X-Google-Smtp-Source: AGHT+IECOeYzXp0ZarYkwjexIAFl1ndvwBoCNuhWJpK9nBFiqrp+AfBi93LHoSMj/O4IAAN8BdKH X-Received: by 2002:a25:9388:0:b0:dcf:3ef2:6182 with SMTP id a8-20020a259388000000b00dcf3ef26182mr3640510ybm.0.1711325959747; Sun, 24 Mar 2024 17:19:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711325959; cv=pass; d=google.com; s=arc-20160816; b=En4Wi83RVEU0gSrBzn9YKPp+7RQfcJQTZUjmZVyM4GCGhGZAz8CYJvQCIpN+E/RdSA /uLVPQQETRGP7mGwS4csoW4zqsdc8UiKTlLBfLoBDb5ByK93mx9XBZkyXYzsMEtXi+7Z DDuEckWlFiDGe90hN/Fyea3tLUJyL0e+b1lyCb7bloeSLcl2Rb5JVOyI6Ziun6fxkZNU NZMeIc2WhQHk9gOx3xhQeBDzKim62pcC9DdZ5BF8KSJSKQalHYL2wfZm2LOcEVQnwbkP xAq9lD8U9Fr2AKHAgO/pQR+LY7lJDOy0MNc32gP1GOW5jOm0nNuzexpJTylGB1Q8yPgA Sxkw== 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=cj9FcxLM9rg2PVopuBZvGofWQ6JzthAEJZKhp4Rusks=; fh=mcs2eJK81y7a8Lo+s4C+J+/Z98bbHAdQdct3DGrYd/I=; b=KHoBgNh0qLe35vPnLwamomWRYQPDEdKsSzzh6kELmpY42dc5nK+arganj5uY7oz6nH a+SvZy37IP/ZESu0Trpi5sOOVvR4QvSuXjVKj1ciDsyJUQahu4XM4CPfHRhnTMPA+WYk K/19OseRk1eARzAOpIWiEGO36KGICx9USdpd5KXOMy9PzUrrcOqviMWEBulkRvWOXbEI Jz/zT9pHaG0xBB0d9aK5X0WhN6CaZT/VHNm32rd8/Ci3EimHVBPaHASmKAr0SJyZmoLC urBKXKjzo4D1yN//o1dJIEXEW34GeChspEkeY+6uXYanG6/Fbi8fROEAZuSRvC4xKsi0 QUjQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EfsHZz+H; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113366-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113366-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id jq15-20020ad45fcf000000b00690db58ef98si6499666qvb.402.2024.03.24.17.19.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 17:19:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113366-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EfsHZz+H; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113366-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113366-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 77F041C232C1 for ; Mon, 25 Mar 2024 00:19:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DF78219CAD1; Sun, 24 Mar 2024 22:42:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EfsHZz+H" 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 07A0F19D1C7; Sun, 24 Mar 2024 22:42:47 +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=1711320168; cv=none; b=H3D9lhdsbLi/U/UyB6yVYVa2qo1UcdoKD1V7qgMkcljRyhBayLEWZe0Zyfci63D3UEm6NTBbofKABOW68r8Z4dFA99YrAhLlpoDVWnbBFjZzxfjjokp9YjiYBBlrv9EaGep4VgwlYMrpIKhMNLIlOec+tGHr6lYqtgQm1nU3Bds= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320168; c=relaxed/simple; bh=8QWRa1+vjMcnTr35RblFxDEGqdPXm8uDkirWh1Tav+E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a/2Qg0GzD7A2E7eKGb2FXnA1aWJ4nqehzaCfpSwrCNbbD/Veu8TN/jUWKtB0BlbIe78FOH5SMcsymT4Hr563w6q3peJibBwiXsbCLRMQEDCACK6FRUEQ8Bmif9RspFAWBAuT9VN9U0T6RIqjYhYZnkyr0TFzzmEfjXuya3jc7t8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EfsHZz+H; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00276C433C7; Sun, 24 Mar 2024 22:42:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320167; bh=8QWRa1+vjMcnTr35RblFxDEGqdPXm8uDkirWh1Tav+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EfsHZz+HJILrl9yRz9wjkSY/u9qO8SWbCOqLHusRTI31sLP2ua7Crr1bMnbO3T1IK XdEaqrScpW13OmyEA/lD5E2+/9eigd4HP/14lLa9b0TfDIGlKqw2YAX1T1V8qS+P+f ckExO6dg6DMkSniTVESvILfRtA0zEv59AE8nOb44RN24I4F1Hm8gMjw4DtjwcBcDMq IQVZH+HUiztD+oPW0nSMcLQGHDXCISzfn5BIEXv+nZqgPFi/ghXF4tbzHK9FLA+rpY 1CGohahjtVvF5zbM5JDwtuBSmwCh2vsx+j/3un5Qwy9/q+xH+C4W+0eSoHNnPC+VUg anETYYjLtYrHQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tomi Valkeinen , Aradhya Bhatia , Sasha Levin Subject: [PATCH 6.8 475/715] drm/tidss: Fix sync-lost issue with two displays Date: Sun, 24 Mar 2024 18:30:54 -0400 Message-ID: <20240324223455.1342824-476-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-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 5f838980c7a11..94f8e3178df58 100644 --- a/drivers/gpu/drm/tidss/tidss_crtc.c +++ b/drivers/gpu/drm/tidss/tidss_crtc.c @@ -265,6 +265,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