From patchwork Fri Dec 4 15:11:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 11955107 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=-11.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,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 C6E4CC1B0D9 for ; Mon, 7 Dec 2020 08:58:07 +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 94F5E23108 for ; Mon, 7 Dec 2020 08:58:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 94F5E23108 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 A19286E81A; Mon, 7 Dec 2020 08:57:27 +0000 (UTC) Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by gabe.freedesktop.org (Postfix) with ESMTPS id BC6316E17F for ; Fri, 4 Dec 2020 15:11:45 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 404C4580146; Fri, 4 Dec 2020 10:11:43 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Fri, 04 Dec 2020 10:11:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:content-type:mime-version :content-transfer-encoding; s=fm1; bh=qZIeITZCCeO2FBytN2Glg/L3iF hw1qYWc7AxJW2/6xg=; b=U+dGlXefvdkajgvQHYWZTEil/+dN8HUlH3q9zlH1td rV625lld9WWn2j3JKm2H32nvBE4YxU7uIsWQxjtyp0iiCiNK/0//3jt5RbQqOZqc g07hVJ8VKI+DRMUIDWT0HLutHsBD+PghpHv2GsKz2IaVvMpvLbsWVxKMfkKP+eeE FZOOExBmDU+5gmltCJSi0s83Q67AJXCySPZEpBzxFVzd12LMUyx34lOGggQGbz+X DdRAdcQsoDlCB1Ylq59TqS6A019Pxb5NmXgUID05+jtW9jVAKZoj0aFu0WtA8Gnc AjeS3FrAnVcOAdIrEVrYSPlgPMJP8a5+0RX9kbMjgAIw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=qZIeIT ZCCeO2FBytN2Glg/L3iFhw1qYWc7AxJW2/6xg=; b=HgBEKbtkcGf+k9wP/6922r Jr/pi7uTeg7FzDFgk9PTUiLdvNEt2+xYtdMa6CJzyK2Trehwn/6/1WsCrH0QPRIX GmFEucb8ukdnKJVsILE0Wq+ekU7W3ABYd3O9W7+9XWx7cj8RFISKRE9xrTsHvydx VEoCg7UaNPYCqKDNkjdJGOxrWr0FZfOdxNCbsQxulKyFKWmio0/fkVOIgLX2NV3X F8sqT4oVSwkLe4mZ/0l+PquoQWL4+O9TvvO3rrVLi4osBu6H54JGzR5k8tVjsBlq B9D95nPyTvQZIXjWgEs6Gbtmhy/c3polX/Ywj+nqNyrqtY2soHht+QFyDZ3xopPQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudeikedgjeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffotggggfesthhqredtredtjeenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpeetieekgfffkeegkeeltdehudetteejgfekueevhffhteegudfgkedtueegfffg feenucfkphepledtrdekledrieekrdejieenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh 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 C7F4D1080068; Fri, 4 Dec 2020 10:11:40 -0500 (EST) From: Maxime Ripard To: Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Mark Rutland , Rob Herring , Frank Rowand , Eric Anholt Subject: [PATCH v2 0/7] vc4: Convert to drm_atomic_helper_commit Date: Fri, 4 Dec 2020 16:11:31 +0100 Message-Id: <20201204151138.1739736-1-maxime@cerno.tech> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 07 Dec 2020 08:56:49 +0000 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: devicetree@vger.kernel.org, Tim Gover , Dave Stevenson , dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Phil Elwell , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi, Here's a conversion of vc4 to remove the hand-rolled atomic_commit helper from vc4 in favour of the generic one. This requires some rework of vc4, but also a new hook and some documentation for corner-cases in the DRM core that have been reported and explained by Daniel recently. Let me know what you think, Maxime Changes from v1: - Addressed the comments from Dave and Thomas on the documentation - s/last_user/pending_commit/ - Check that the commit is not NULL before waiting on it - Fixed a compilation error on an intermediate patch - Drop the assigned_channels variable redundant with the in_use variable Maxime Ripard (7): drm: Introduce an atomic_commit_setup function drm: Document use-after-free gotcha with private objects drm/vc4: Simplify a bit the global atomic_check drm/vc4: kms: Wait on previous FIFO users before a commit drm/vc4: kms: Remove unassigned_channels from the HVS state drm/vc4: kms: Remove async modeset semaphore drm/vc4: kms: Convert to atomic helpers drivers/gpu/drm/drm_atomic_helper.c | 9 + drivers/gpu/drm/vc4/vc4_crtc.c | 13 -- drivers/gpu/drm/vc4/vc4_drv.h | 2 - drivers/gpu/drm/vc4/vc4_kms.c | 248 +++++++++++------------ include/drm/drm_atomic.h | 20 ++ include/drm/drm_modeset_helper_vtables.h | 21 ++ 6 files changed, 172 insertions(+), 141 deletions(-)