Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2098142pxb; Fri, 17 Sep 2021 02:02:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZGPMoPjcNHgafE8v6yALI2RzCvmKzOjlzHfC6Umz2pB+pBq/3kN3VfHRhoemt/e+9YAlF X-Received: by 2002:a92:ca82:: with SMTP id t2mr7105246ilo.151.1631869353281; Fri, 17 Sep 2021 02:02:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631869353; cv=none; d=google.com; s=arc-20160816; b=j2c9qW1KtaZQqYIJXi6h4zeJWzixB+NBKr0KIZ4yERLKy7qIbTkh2IiwMG4jeaGY/l RUR9KnVpCtQBU1eRwqy6bt5fhnDKMtqa8P1NRvKQla0/mzG0amhGE8Fd5nLKwlpcSWNe 2SD9TshJWDp6UrkJXLrNzkgnqkewHoVURpy9XDNS4GMyLdayk1hF1YVCQupfw/lkA3oS RkgOUe5qgGeaaSPjLBubAKecQMPgMMejSYyHbClTR1nlwbpfsKoMgM/MyOOls4o/55Yv 3C/rcXCtp8tbMhi+NC+2mlJhuUK0EnAYvtW01UQT0fwiF6ZWRVQl5IBZIJLgxLjV6y3i Ln2A== 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=fnNE3/bpQJX1hpzoQSY26cMfUyUc1erwvXKd9/uTahY=; b=ug8h9ihaenu1mb8uyx13tIYw17CuCaLRx3CEgj3TJIZ7C1Lx74CYGbGQE5RXlATjK6 B9UYhPixIFvBMSDhUaSwDF5bvxVwqj/M0HmFvLYoS9H/RYo3w7Z0qxXKqFor9RTml57x lWKu8V+w5w6Em1zcS3CCsBoCy2q/8jaRrysZhJy1eRwORftkrqekDjMVCY0PxPbiKu77 7/z/rJ7ASZ42zmn6P4rSKAlHS/1fUSdwcLlON08DGDA70IxCYtKttZArL84QfIBkiZ8D OJ1pwWYDN+4OrEwOGbu6l5ia/gYaEDiXUKdjWRwXftjEzfGHi6KFvX5ZKWRZR0yUS0Ab +wow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@u92.eu header.s=fm3 header.b="iUc/J+Kq"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=qaZjebld; 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 16si4493531ily.161.2021.09.17.02.02.22; Fri, 17 Sep 2021 02:02:33 -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="iUc/J+Kq"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=qaZjebld; 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 S233283AbhIPVRh (ORCPT + 99 others); Thu, 16 Sep 2021 17:17:37 -0400 Received: from wnew3-smtp.messagingengine.com ([64.147.123.17]:36161 "EHLO wnew3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235533AbhIPVRe (ORCPT ); Thu, 16 Sep 2021 17:17:34 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id 199272B011E5; Thu, 16 Sep 2021 17:16:13 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 16 Sep 2021 17:16:13 -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=fnNE3/bpQJX1h pzoQSY26cMfUyUc1erwvXKd9/uTahY=; b=iUc/J+KqzYC/SOJ1n5Qm7Exfbz4e8 rQNcaAdvb37kMX1+R8W+Ry3SuLhIXvRxwqUoMd93OjAkpLFFxrlg/6N0mDnROBVF EtlGUMu3JTgyidP1spB854VFSskpiZI+gVBi4AKn7qcn1zVyDHHpGKlzk/3hCpmX WHzfRyCxzVX8ywpP5FWXviF8lCbA7vrzl3YI3cZ9ACSQfknxzHugVLIv934ftwcz i80XDh9GlU9FqvUiY7Q9KVG0JApM6tXKmg3axJmSwaM1/LrIGZgJIbZIoHYMsbuY ptPHU+v1Fk0tF6FklbPWc3JsltaWJ5/gm5gGz3SQyapjLAMV3NK3Td8cw== 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=fnNE3/bpQJX1hpzoQSY26cMfUyUc1erwvXKd9/uTahY=; b=qaZjebld CC4bFZrF8IIU/ploQNy+oGHZlHwai55D12mYP4YjZ2tsUMDwyWHTeYVIX4M60raF TMKKPs0YY/eFUWhGK7JdXmZXfpR3Rv5k69mjXjmDXpmawcDB24pOhEDsGQEQNwMM UaAj+uyH0fSgN7N6dN6cFVPwNpmIqzb7MwloYQyNaHP/R/zp7BL3jYtqVP/jx5HB MdChTSiVLpNI0Rhl0fI/9wftxdTdXbn6yxupIJUz1tQdDrNYo54sKW3uG+Rf8S7p UhtSFDAT65wh7LX0+DMOemIF8MbqOx6Ty0CkuD4KM9+78dl78q28upOeSXPVVXXG hyLEChyurmUjMw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudehgedgudehfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefhvghrnhgrnhguohcutfgrmhhoshcuoehgrhgvvghnfhho ohesuhelvddrvghuqeenucggtffrrghtthgvrhhnpeekleekjedtheejheekfefggeevvd fgueegffeuveduhfehueegkeeijedvvdejfeenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvvghnfhhoohesuhelvddrvghu X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 16 Sep 2021 17:16:09 -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 03/15] dmr/msm: cleanup: drm_modeset_lock_all_ctx() --> DRM_MODESET_LOCK_ALL_BEGIN() Date: Thu, 16 Sep 2021 23:15:40 +0200 Message-Id: <20210916211552.33490-4-greenfoo@u92.eu> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916211552.33490-1-greenfoo@u92.eu> References: <20210916211552.33490-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 --- drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c | 10 ++++------ 1 file changed, 4 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..c83db90b0e02 100644 --- a/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c +++ b/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c @@ -99,20 +99,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