From patchwork Thu Mar 18 16:13:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12148533 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 591B3C433E6 for ; Thu, 18 Mar 2021 16:13:45 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 B6F2264E1F for ; Thu, 18 Mar 2021 16:13:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B6F2264E1F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AB38D6E911; Thu, 18 Mar 2021 16:13:41 +0000 (UTC) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0C18E6E90D for ; Thu, 18 Mar 2021 16:13:36 +0000 (UTC) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 94922165A; Thu, 18 Mar 2021 12:13:32 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 18 Mar 2021 12:13:33 -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=fm2; bh=YwTMjG3rZyCS1OsU1SfsayiBq+ 7Wkm9LEwu3OUhJoMU=; b=arusMg/Q6JcfJwvNKUgWgeF23Ow8D+NGzLL4UowZVs FQmHUXA0tJv6zJ7jZcEbMZCndLNgyblpetDJY2SlnVERo4ALW1NAjHY6q6beVPCL YrsVjvfrKpQDxOK4eQod1WH4qI5MaQDlcpp7g9WH7viqCjGooXSNaPpdqW40Gjah M/cm38FEoNU0VicAPrwxY4GhMvplGlh/QsHeBT9H4GRrcBMFoJUacUlg5ZpJ9e/b AIwW18DJNZsI8gaVVUXyCZHFQJyUw03E+ohDS53riHwHQMbeqoUMtYUagW8W0yn4 7kDeF8O6gtlF3hFSd/X3GTOaYzOzVy6HVnVaqv+3cTFw== 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=fm2; bh=YwTMjG3rZyCS1OsU1 SfsayiBq+7Wkm9LEwu3OUhJoMU=; b=Ok8cm7C0lCo8+e28EvhStU/vGIsttAURH vLiVZSN1dxUJsHN9LstJYhEwwNU33m+JhmXs0P7gfoIxMPa3O7Nu446YngUVcrdx HASGiWHDAiZ5ovVAagc1dK5h462NjDeW5MdN/4ioz72Mcz8V7Lf22I6mJGmz8plr oxB/73kNv70HtS0HeA6sqpjtaKS8iHZ9sDFXCzi+f3avpIWQyGNND/WyOBpqBjXd grAKh/lK4p5eI5MfVKj8i7Y8vM1tlE+XQdPQT/INKWlvBiYT8Mj6inqivS9w4g7o rqubHKds6ebCCxY0hLdXC+J33wp+nOGbk78AL9iwS5UvPBwcKGLLg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefiedgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhmvgcu tfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrthhtvg hrnhepjeffheduvddvvdelhfegleelfffgieejvdehgfeijedtieeuteejteefueekjeeg necukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh 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 E498F24005B; Thu, 18 Mar 2021 12:13:30 -0400 (EDT) From: Maxime Ripard To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/3] drm/vc4: plane: Fix typo in scaler width and height Date: Thu, 18 Mar 2021 17:13:26 +0100 Message-Id: <20210318161328.1471556-1-maxime@cerno.tech> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxime Ripard , Dom Cobley , Phil Elwell , Tim Gover , Dave Stevenson Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The vc4_plane_mode_set function still accesses the scaler target width and height using the older register layout while it was updated with the BCM2711, and the proper defines got introduced when we started to support it. Fixes: c54619b0bfb3 ("drm/vc4: Add support for the BCM2711 HVS5") Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_plane.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index eb37d7f8a118..3fdc32244b59 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -912,9 +912,9 @@ static int vc4_plane_mode_set(struct drm_plane *plane, if (!vc4_state->is_unity) { vc4_dlist_write(vc4_state, VC4_SET_FIELD(vc4_state->crtc_w, - SCALER_POS1_SCL_WIDTH) | + SCALER5_POS1_SCL_WIDTH) | VC4_SET_FIELD(vc4_state->crtc_h, - SCALER_POS1_SCL_HEIGHT)); + SCALER5_POS1_SCL_HEIGHT)); } /* Position Word 2: Source Image Size */ From patchwork Thu Mar 18 16:13:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12148529 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 964DEC433DB for ; Thu, 18 Mar 2021 16:13:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 ED26D64F01 for ; Thu, 18 Mar 2021 16:13:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED26D64F01 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2E5F26E8B2; Thu, 18 Mar 2021 16:13:38 +0000 (UTC) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0C69D6E90F for ; Thu, 18 Mar 2021 16:13:36 +0000 (UTC) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 144C7163E; Thu, 18 Mar 2021 12:13:34 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 18 Mar 2021 12:13:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=f77bYtXtR1JAq Gy9vKp+1f5NYtzy9q+DPTKS7F2HKaU=; b=ClXW8SolVFvAiOAVu5f0AKLVtrbNM GWv3mgSoix5P6v4T/ybbVbnxdEJDxR+oOOwUUma4zSLzoN9tHV+QuoSe5zwoT53h MI+JnedwuXwBc3zeNYwWBV/M2/AuqiWuW1G1MG80mfmY13BnkG0uwp50XPrModHp VzzCXZirQsLCiokNT0ukVh7QTSmjzpS0OJTVaRtUI9BWHH5ygwFxTVqYSFbAEP0/ M8rduqMYG8aV6874e3octF8tL+6ERX4YsdFytzPB1Xmr0jPwZ9D05a04YDVwRdDr 8auek3IZecN5DBuNkbDcUns27avghFfMQ/QpeOf2idvXTYezVb0bLcYbg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=f77bYtXtR1JAqGy9vKp+1f5NYtzy9q+DPTKS7F2HKaU=; b=nGK04mpe WLgoMO6y3/jxoTn0e7bWnrso4MB9PmQN5xtfZGTpfnu2svGcnwOGaU772FYcR7/M Czi//YNQo9uDzxmHx3KkbwYcdC7zwQa0tylQ8rxJBe9iyFVHJthvrPW9CVYyYk+w 3ecd4+KknLoOoA4Jgme2X57waS4meVNT93aOsgP/DK4cHBYO/vJse0IC3g+4VdC3 47J98j2Es0+0rVYoPayiYddQDb/fr7DlRXG47uRbxNMupwvEkkfqW1gUkyyqoT5o vh2FuFchJwIDDXDRHG8ZX5f3PkyL6g0Ji8VOtbp5BvE9/BrhXoBmFMcEgMCPhL93 VP4WskRbAoIIFA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefiedgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh 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 443FB1080054; Thu, 18 Mar 2021 12:13:33 -0400 (EDT) From: Maxime Ripard To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/3] drm/vc4: plane: Remove redundant assignment Date: Thu, 18 Mar 2021 17:13:27 +0100 Message-Id: <20210318161328.1471556-2-maxime@cerno.tech> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210318161328.1471556-1-maxime@cerno.tech> References: <20210318161328.1471556-1-maxime@cerno.tech> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxime Ripard , Dom Cobley , Phil Elwell , Tim Gover , Dave Stevenson Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The vc4_plane_atomic_async_update function assigns twice in a row the src_h field in the drm_plane_state structure to the same value. Remove the second one. Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_plane.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index 3fdc32244b59..0ad1862c5ad8 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -1135,7 +1135,6 @@ static void vc4_plane_atomic_async_update(struct drm_plane *plane, plane->state->src_y = new_plane_state->src_y; plane->state->src_w = new_plane_state->src_w; plane->state->src_h = new_plane_state->src_h; - plane->state->src_h = new_plane_state->src_h; plane->state->alpha = new_plane_state->alpha; plane->state->pixel_blend_mode = new_plane_state->pixel_blend_mode; plane->state->rotation = new_plane_state->rotation; From patchwork Thu Mar 18 16:13:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12148531 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 E3873C433E0 for ; Thu, 18 Mar 2021 16:13:41 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 9D0F964E4D for ; Thu, 18 Mar 2021 16:13:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9D0F964E4D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8865A6E90D; Thu, 18 Mar 2021 16:13:38 +0000 (UTC) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0BE516E8B2 for ; Thu, 18 Mar 2021 16:13:36 +0000 (UTC) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id AA2831640; Thu, 18 Mar 2021 12:13:35 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 18 Mar 2021 12:13:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=b/RnXpPizO/eW WDLfpsKMhw6rY2ky9U0twz7YpMe1tI=; b=M7CGYzr4LqZcasHeX+1il4K495AfT hnGJH1Fxd69Bb9FbTTesrYS13R4zqueFSWSpDEKg0GqJkvh7Ga4RryAbNiTk4Ewm CBjPPsU5gWDuVtYfV6Q3Xi3drW1Xap+x95Ou0nWhrC7WSHwUagN85QmpKIGvMJxM s6tn+pfD0MmAtQcP+f1v8Oe0QBFQaJtUWdLcyc1wRfKQbph4zlIwY7hr5RIKaH6u F0OE6n5Msb6TMF9CWTao9BLX9ONBjTBVt1Behh6qL7O51OLkDvciuyWa7gZPj9q3 c0LDCWXcYE7YfVoiiE1hWrEZmutX9lqn7LfudFvutdR/4craa7zKQGh5A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=b/RnXpPizO/eWWDLfpsKMhw6rY2ky9U0twz7YpMe1tI=; b=ICK00XJU /RdcVFOI1A7m0Sf9gWFs0kOh4G4SNYwlvFvbtBh7K9qHF0pZEhmxRtUDlRmMw/b9 sbuTU4Jy6mUo+Vbp5tP/p37kE0rNGhNjOxjVxHv7fq7Lo/ymDz5k2I5vQgdYja6a AEbsah9KL5e3t4u254MO+wyoBCzn3SXoqyBs4lbMi5wyJjQRoUbMas5dksjI4v1L AbBknmuGcJWyweXnfOzn6qvtZ6K2+Yh3hI+QlFcOF18lYsHJDarkL7KlKNs0mL08 o7quJE2XmhcrKeXctFZKVvIrpvn7FWBJ3W5g8+t81YWvtL4v/Qj1+QnV/rF/mN5k askPqEJZ1FzP2w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefiedgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgepudenuc frrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh 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 DBFF0108005C; Thu, 18 Mar 2021 12:13:34 -0400 (EDT) From: Maxime Ripard To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/3] drm/vc4: crtc: Reduce PV fifo threshold on hvs4 Date: Thu, 18 Mar 2021 17:13:28 +0100 Message-Id: <20210318161328.1471556-3-maxime@cerno.tech> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210318161328.1471556-1-maxime@cerno.tech> References: <20210318161328.1471556-1-maxime@cerno.tech> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dom Cobley , Tim Gover , Dave Stevenson , Maxime Ripard , Dom Cobley , Phil Elwell Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Dom Cobley Experimentally have found PV on hvs4 reports fifo full error with expected settings and does not with one less This appears as: [drm:drm_atomic_helper_wait_for_flip_done] *ERROR* [CRTC:82:crtc-3] flip_done timed out with bit 10 of PV_STAT set "HVS driving pixels when the PV FIFO is full" Fixes: c8b75bca92cb ("drm/vc4: Add KMS support for Raspberry Pi.") Signed-off-by: Dom Cobley Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_crtc.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c index 269390bc586e..76657dcdf9b0 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -210,6 +210,7 @@ static u32 vc4_get_fifo_full_level(struct vc4_crtc *vc4_crtc, u32 format) { const struct vc4_crtc_data *crtc_data = vc4_crtc_to_vc4_crtc_data(vc4_crtc); const struct vc4_pv_data *pv_data = vc4_crtc_to_vc4_pv_data(vc4_crtc); + struct vc4_dev *vc4 = to_vc4_dev(vc4_crtc->base.dev); u32 fifo_len_bytes = pv_data->fifo_depth; /* @@ -238,6 +239,22 @@ static u32 vc4_get_fifo_full_level(struct vc4_crtc *vc4_crtc, u32 format) if (crtc_data->hvs_output == 5) return 32; + /* + * It looks like in some situations, we will overflow + * the PixelValve FIFO (with the bit 10 of PV stat being + * set) and stall the HVS / PV, eventually resulting in + * a page flip timeout. + * + * Displaying the video overlay during a playback with + * Kodi on an RPi3 seems to be a great solution with a + * failure rate around 50%. + * + * Removing 1 from the FIFO full level however + * seems to completely remove that issue. + */ + if (!vc4->hvs->hvs5) + return fifo_len_bytes - 3 * HVS_FIFO_LATENCY_PIX - 1; + return fifo_len_bytes - 3 * HVS_FIFO_LATENCY_PIX; } }