Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id CB497C433EF for ; Fri, 10 Jun 2022 11:52:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4116110EBD4; Fri, 10 Jun 2022 11:51:59 +0000 (UTC) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7DCC510EC11 for ; Fri, 10 Jun 2022 11:51:57 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id CE8ED5C0121; Fri, 10 Jun 2022 07:51:55 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 10 Jun 2022 07:51:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1654861915; x=1654948315; bh=2o CqFfBN6r/lbT0HHl3bQsJYZZGcdGw0InLFP7cfkc0=; b=eJctbeYYJmF58o0BKn LvW1ZR3QW2+RsaNN7DJpMAOa+QSosnW9VvcDS+9gQb1knNr9Vu4db0MslIumjpOt T39MWqPtNLIgvbomL6abVCArViK1u1ZetXljKBEBwav7uJuK7kwaHRZafizl02Kt eRHe1yAHWbF56qA/vfBiNVXHfBATZiyNGDqbgiFifiEtkHnaMAkZsHodCyzpiZCC LR0baBVVfx8WGKEtUh9bcmIPd01/fMBCA+Zb0EoQF+5HL4ASdbwsI8zpNs05YKc7 DYPmp/byL6R4d1cS6eNeuNVoTPeayeURKZFl7GifmmSXIoxbtOAzl6gl7gA+934G yV2Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1654861915; x=1654948315; bh=2oCqFfBN6r/lb T0HHl3bQsJYZZGcdGw0InLFP7cfkc0=; b=nTBGfXlxJxG0V65YYzZpoP1aw9vT8 IDjVoiHJ5Ae4zeJjMCpnZoVi11szPOzobldE2YK6DEPSx2BuE1U7wrZPdrIUiymu WuQbxKPQyYeUKrglh9/ZEpfsG76kcbZSu6eknSn2qXSh73dxsK9SBQQM4CVqI76M j8eZAHKfcvdoDWoXjZoFCiAQyJFrG8KN3t7P7IshCbUM8iqGnk1gbuM9R9bng/uX X004PZah6rVrFFhifTOe5dYVerbmU5apvkY79YBYlVE5qy/OM06jlmip7LNi/rmy B9n63ZAzS0yzHAUB0S2mBTg3bsPGX3FLXGhxfCOFVCR33JcTj9GOU0NuA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudduuddggeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpeelkeefteduhfekjeeihfetudfguedvveekkeetteekhfekhfdtlefgfedu vdejhfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 10 Jun 2022 07:51:55 -0400 (EDT) From: Maxime Ripard To: Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard Subject: [PATCH v2 01/14] drm/vc4: plane: Prevent async update if we don't have a dlist Date: Fri, 10 Jun 2022 13:51:36 +0200 Message-Id: <20220610115149.964394-2-maxime@cerno.tech> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220610115149.964394-1-maxime@cerno.tech> References: <20220610115149.964394-1-maxime@cerno.tech> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: Melissa Wen , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The vc4 planes are setup in hardware by creating a hardware descriptor in a dedicated RAM. As part of the process to setup a plane in KMS, we thus need to allocate some part of that dedicated RAM to store our descriptor there. The async update path will just reuse the descriptor already allocated for that plane and will modify it directly in RAM to match whatever has been asked for. In order to do that, it will compare the descriptor for the old plane state and the new plane state, will make sure they fit in the same size, and check that only the position or buffer address have changed. Reviewed-by: Melissa Wen Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_plane.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index b3438f4a81ce..811a2d004cc4 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -1321,6 +1321,10 @@ static int vc4_plane_atomic_async_check(struct drm_plane *plane, old_vc4_state = to_vc4_plane_state(plane->state); new_vc4_state = to_vc4_plane_state(new_plane_state); + + if (!new_vc4_state->hw_dlist) + return -EINVAL; + if (old_vc4_state->dlist_count != new_vc4_state->dlist_count || old_vc4_state->pos0_offset != new_vc4_state->pos0_offset || old_vc4_state->pos2_offset != new_vc4_state->pos2_offset || -- 2.36.1