Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1255770pxb; Thu, 23 Sep 2021 23:45:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEgCl/QZoDMhNTcfsVY5M9Uy/Xc/C63/d/h3bkyCF0uvHBC/bgMAG/C2vNGiBg/2Saxicb X-Received: by 2002:a17:906:3fc1:: with SMTP id k1mr9791197ejj.44.1632465958870; Thu, 23 Sep 2021 23:45:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632465958; cv=none; d=google.com; s=arc-20160816; b=bW6IUPHnogkiNP3DMgn6eLwPJ0jH6zdB0j5OnBd9BNO+kjE8cpN5gQ7mYenPhxZKqn stWesPRL86GIO4BFhRuzeA75aO4v+vPqu2piODgTtRVmQ59XRPbKyDqvBQSYeaSW+2vh NolN/fVxLoQiwtasRExTbDoNdOC8tBCVnRMazUPxJMgKOnxq9yanJG/BOlq9n54aqaxZ vHmwnx7xzk6xgYgWKV/DPagx9O5aXEzhEZdxFDZPK1vZ2oTUZYHp4V6Ry429A00ap62u d9X7uZnTVvgq0K+Ko44CWtZUEEs1ozGGPsEf6k6lZUgdIfk5fUkk7FRw3LP5X53Cr5BL HFvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=bjZP3Lgut5mp9xuokNNwrS2cdV0t8bE34sMk9sGPssk=; b=tjzfvAdkxNj/vSYG7uyEC3JjLJqFioMS+sxnzfriSW1xOqCRpCODuAMypfReY2m+vq DHIvtd1YynuhGDd5P4vmY+ga+bgapvHWuGZ518ZRcy3YVB13jyNXUDF3ErPXn6hMJRnS tFI9RgksgXd5rOBVGOPHlIIvmLWcUEP4rpIbT+c9ZMLxsGD0zI2NACFzzvvUCDPGudmu jRPsDVTmz1ZwwGzD3v6OedyMwqnjZN+mPJmkJgHNATOBkncylkSvKx48B3H8wp0Apkjm Qs50AAqw8HZDYdJ3QFta2UfdBBwhShfJKcz0oxyN+XzBPIv3ScwLJCVoVsqz4d0HSiz/ PrjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@u92.eu header.s=fm3 header.b=Zl94LhRM; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=WlnJxQQe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 7si8072468ejk.598.2021.09.23.23.45.13; Thu, 23 Sep 2021 23:45:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@u92.eu header.s=fm3 header.b=Zl94LhRM; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=WlnJxQQe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244299AbhIXGpQ (ORCPT + 99 others); Fri, 24 Sep 2021 02:45:16 -0400 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:43199 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244295AbhIXGpO (ORCPT ); Fri, 24 Sep 2021 02:45:14 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id 353BF580B91; Fri, 24 Sep 2021 02:43:41 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 24 Sep 2021 02:43:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=u92.eu; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=bjZP3Lgut5mp9 xuokNNwrS2cdV0t8bE34sMk9sGPssk=; b=Zl94LhRMGC48/RwmRjA3LvtvLrQ8T Xu5750J5s/5x8KQMAJRqV/VokYfVb4eyo5JUgpQktTx0dyK13OCvxGsECwSwSTki GR0h5StpeupfDBPT05yTF4FsaHsSpa2K0bsqStTRrHGXCmFA+/GrmC4XAHzBiJOL P+5QAHdOoC6i84D0qU5hXdX1F154w/svTpKIYCk8h1lUE0olm9+V/2tekhgb403+ PiZaWvIueRDUpboKjly8rlYmHk2C/GJEcERj3Yh48jG/TyBvxr3QehG5BUri1KYq j0vwAzOUrtrjHRY04PGOooWWaIcSFywkzAYy+M/5DxYJIsE/kyTFXeMcw== 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= fm3; bh=bjZP3Lgut5mp9xuokNNwrS2cdV0t8bE34sMk9sGPssk=; b=WlnJxQQe r/yYLIu2eGfj4+jRQIenuvmRAJfnGKzyoRpXEid0iNcWZOIVmsyps1Xh8Kj8+xQD KGHIoq3vJJy06/vNmqLBKpwhnCvAg4BIJQq3zvSoh+oKS6jWSJUlTmU6DeFrnYdm dCyjvOaNIJvPhNFMc/1OQQ8CAYTUwy45Ocl0OnBn66Xx9kqaAEO6LgDQxCWkvS0q HE4sRMq37SRRJD67El1srPYvqlqf0M/hAvtlhOsGzDbj3PFtKYOdMey6S8bUtQBu aAmU3rlqLsL0QCJmSjRxIWZr1PqHkK1F04PR5oSFeoY7TpFQsdllkqVebu5AYqSe SZWZrfg7TV0/pA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudejtddguddtkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefhvghrnhgrnhguohcutfgrmhhoshcuoehgrhgvvghnfhho ohesuhelvddrvghuqeenucggtffrrghtthgvrhhnpeekleekjedtheejheekfefggeevvd fgueegffeuveduhfehueegkeeijedvvdejfeenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvvghnfhhoohesuhelvddrvghu X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 24 Sep 2021 02:43:38 -0400 (EDT) From: Fernando Ramos To: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, sean@poorly.run, linux-doc@vger.kernel.org, amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH v2 03/17] drm/msm: cleanup: drm_modeset_lock_all_ctx() --> DRM_MODESET_LOCK_ALL_BEGIN() Date: Fri, 24 Sep 2021 08:43:10 +0200 Message-Id: <20210924064324.229457-4-greenfoo@u92.eu> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210924064324.229457-1-greenfoo@u92.eu> References: <20210924064324.229457-1-greenfoo@u92.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As requested in Documentation/gpu/todo.rst, replace the boilerplate code surrounding drm_modeset_lock_all_ctx() with DRM_MODESET_LOCK_ALL_BEGIN() and DRM_MODESET_LOCK_ALL_END() Signed-off-by: Fernando Ramos Reviewed-by: Sean Paul Reported-by: kernel test robot --- drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c b/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c index cabe15190ec1..abda52f09b09 100644 --- a/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c +++ b/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c @@ -5,6 +5,8 @@ #define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__ +#include + #include "msm_disp_snapshot.h" static void msm_disp_state_dump_regs(u32 **reg, u32 aligned_len, void __iomem *base_addr) @@ -99,20 +101,18 @@ static void msm_disp_capture_atomic_state(struct msm_disp_state *disp_state) { struct drm_device *ddev; struct drm_modeset_acquire_ctx ctx; + int ret; disp_state->timestamp = ktime_get(); ddev = disp_state->drm_dev; - drm_modeset_acquire_init(&ctx, 0); - - while (drm_modeset_lock_all_ctx(ddev, &ctx) != 0) - drm_modeset_backoff(&ctx); + DRM_MODESET_LOCK_ALL_BEGIN(ddev, ctx, 0, ret); disp_state->atomic_state = drm_atomic_helper_duplicate_state(ddev, &ctx); - drm_modeset_drop_locks(&ctx); - drm_modeset_acquire_fini(&ctx); + + DRM_MODESET_LOCK_ALL_END(ddev, ctx, ret); } void msm_disp_snapshot_capture_state(struct msm_disp_state *disp_state) -- 2.33.0