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: 338496 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=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 87E79C19437 for ; Fri, 4 Dec 2020 15:12:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5973422B3B for ; Fri, 4 Dec 2020 15:12:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730438AbgLDPMa (ORCPT ); Fri, 4 Dec 2020 10:12:30 -0500 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:60739 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728626AbgLDPM3 (ORCPT ); Fri, 4 Dec 2020 10:12:29 -0500 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 Cc: devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, Tim Gover , Dave Stevenson , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, Phil Elwell 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 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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(-) -- 2.28.0