From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E216FC43461 for ; Thu, 17 Sep 2020 12:18:09 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8ED5C2087D for ; Thu, 17 Sep 2020 12:18:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dHDl4HaE"; dkim=temperror (0-bit key) header.d=cerno.tech header.i=@cerno.tech header.b="AosdZroo"; dkim=temperror (0-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="modBebaj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8ED5C2087D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=gtIFJXPh787Rv+vGsbzF9zV35XJZF7o9A6QSneKL9v8=; b=dHDl4HaEhbS/gkeIFU4My23dI4 d8bJe7sFRd24iFTUBSGUcz3n1+7rO4/Fz9hZbv4ECF56t4BfZxYe0O9WFkR9UtEqIxKiNn76iG65H K4BthBMOTrOQFNZ6s0hYUwice0JH82PD7q87q8q05BEtL7UsOFS2RfZ1UTLHsfOk6ZyD3307ai/P3 BNSysGfTyc+XcocCd7TXhi4n66vSorrc3CNZ2pigSyKAny4czkId9Qt7k+BZ0zUtQMsXOAri72hES 7ehJ6oP19/oeqshU2EnAhQIoJDIblci1gKv9ZygynwBYNJ3p0ETh2LEXdV+F1rG+65f2Vm8f0hCKG uCMdXpfA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIsq2-0001w6-Bw; Thu, 17 Sep 2020 12:16:34 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIsq0-0001vD-9k; Thu, 17 Sep 2020 12:16:33 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 477ED9C2; Thu, 17 Sep 2020 08:16:28 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 17 Sep 2020 08:16:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm3; bh=A3z+Nrk/yqKWEBPZ/sOK9Hn/BV h5Mhww/f/Scl+4Gts=; b=AosdZroopcWZK3EINVOoP3zmm7xXLkpIahEcHHd8R6 vg7+biTDe+B8k0JsuGCnSbVFY0AxzuH9wk/cbTUAnL8Rks3j9P/l009BT/oIJ5CS sJ47BCO+h+t0H8RBKLG7tXo8xxEGD+xfCGigAj8quWR10167IZrDB8oesXdEtVsJ 2MPlkQ/jcqjb1qkj8rT+7KBtjJzp4RbVxJHhteF2FvgvDKbLqUkAL7d49s8mj8IK P2+vTAhojX1Dau+mgDBnP0YN6yO/OK8VuJeQ3BCNRNY9+N2ZXxEU78Qjb4iZPtiL EK8X4Rt1HMVjKk9c+PFAmAHvrp/DunsYoS/qWv9CtHPw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=A3z+Nrk/yqKWEBPZ/ sOK9Hn/BVh5Mhww/f/Scl+4Gts=; b=modBebajn6WYpznrGA5ccX3hOy7YZtfLr RYacCAkTRoVw4cS57sWXGILYFKYd8xnFeGcPWUyHJspOmFLJ/EcXAbn0XpqnimQI MmPxldqhZ1dOq2XQpfwKziQbCsBY1dq+V0vlWmSYER672sD2Xb+KAzbseHDSf6Ij TKHqN09xeTsg9T1hVIPh77nnzmJRSr2yKmFNU4QKYqcBK9/YjUDVNH8TOiB8G12Q IGNWUNhCVmjVHCjTFQu64jOPEQGXYdoKLyB57wqF0OnTRp1W3xDqD3mcDaHqfzJj 36xWEpAndsLIPL2s3xooZsL6eKYZsykus1l+bXAPy2FSQcTCQLljw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrtdeggdehudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgggfestdekredtredttdenucfhrhhomhepofgrgihimhgvucft ihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtthgvrh hnpeejffehuddvvddvlefhgeelleffgfeijedvhefgieejtdeiueetjeetfeeukeejgeen ucfkphepledtrdekledrieekrdejieenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 0CD853280065; Thu, 17 Sep 2020 08:16:25 -0400 (EDT) From: Maxime Ripard To: Eric Anholt Subject: [PATCH] drm/vc4: hvs: Pull the state of all the CRTCs prior to PV muxing Date: Thu, 17 Sep 2020 14:16:23 +0200 Message-Id: <20200917121623.42023-1-maxime@cerno.tech> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200917_081632_589530_738EC36A X-CRM114-Status: GOOD ( 16.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tim Gover , Dave Stevenson , dri-devel@lists.freedesktop.org, Hoegeun Kwon , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Phil Elwell , linux-arm-kernel@lists.infradead.org, Maxime Ripard Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The vc4 display engine has a first controller called the HVS that will perform the composition of the planes. That HVS has 3 FIFOs and can therefore compose planes for up to three outputs. The timings part is generated through a component called the Pixel Valve, and the BCM2711 has 6 of them. Thus, the HVS has some bits to control which FIFO gets output to which Pixel Valve. The current code supports that muxing by looking at all the CRTCs in a new DRM atomic state in atomic_check, and given the set of contraints that we have, assigns FIFOs to CRTCs or reject the mode entirely. The actual muxing will occur during atomic_commit. However, that doesn't work if only a fraction of the CRTCs' state is updated in that state, since it will ignore the CRTCs that are kept running unmodified, and will thus unassign its associated FIFO, and later disable it. In order to make the code work as expected, let's pull the CRTC state of all the enabled CRTC in our atomic_check so that we can operate on all the running CRTCs, no matter whether they are affected by the new state or not. Cc: Hoegeun Kwon Fixes: 87ebcd42fb7b ("drm/vc4: crtc: Assign output to channel automatically") Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_kms.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index 16e233e1406e..af3ee3dcdab6 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -620,6 +620,23 @@ vc4_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) struct drm_crtc *crtc; int i, ret; + /* + * Since the HVS FIFOs are shared across all the pixelvalves and + * the TXP (and thus all the CRTCs), we need to pull the current + * state of all the enabled CRTCs so that an update to a single + * CRTC still keeps the previous FIFOs enabled and assigned to + * the same CRTCs, instead of evaluating only the CRTC being + * modified. + */ + list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { + if (!crtc->state->enable) + continue; + + crtc_state = drm_atomic_get_crtc_state(state, crtc); + if (IS_ERR(crtc_state)) + return PTR_ERR(crtc_state); + } + for_each_new_crtc_in_state(state, crtc, crtc_state, i) { struct vc4_crtc_state *vc4_crtc_state = to_vc4_crtc_state(crtc_state); -- 2.26.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel