Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1255646pxb; Thu, 23 Sep 2021 23:45:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFZiy/CjSCS73azSzTlfwpxlP9JNdSvbci4/XQy8LIX5U7u3h0AX9iWBIq6yO9WWoOopca X-Received: by 2002:a17:906:7811:: with SMTP id u17mr9274247ejm.562.1632465943073; Thu, 23 Sep 2021 23:45:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632465943; cv=none; d=google.com; s=arc-20160816; b=zkrUALKmbhe8NBZZ4cmcoaJ79/3p3jBFpxnhj0/ANgp353iEQ3krfp2UpWOuCAWmvP M7WFpKJH3vls9hx8EKiIag6JupzCT9ptHXWpZGTFOAiCkfMAbis8bxD2z20D/CTkvg2W KhC7PJ0TrwapK1VXPB4XOVAx/diNUkhUr6LnOW+dULSFqeGpLO9Jetkfx2vI/TYNabA5 nclIn5L/XSHyuV/651nGv9I7GEZzUKcih1GLyDfx851pCQnxbzDfedbbxUd/lP+2LDiY aizQ/hRCh1nvUrkdSft4g9pT3K8kBx9qO8g50qzbMgD8ac+huiv9Tm4+OeMpThF3U9wZ vBJg== 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=7drGizuMVrgy3XtFLhWzlftyWemSxaP+r0ayB6xLFcI=; b=wRwlgfrGc/jdYl55IrRCxTt3dt4sLrdtXQIxKfw1wb8hLi34MUeqshGxYkUHX8IyVE Fi3CACpcJQI5pYpLepWu18zHxdPO3tQguBdxrBqwzXF95A26YNIEIdgFeMAjcgB+pGxi j47cdFJAOq2mjp+W+acvWyHeehHaS2+OPMyjRYOnik/vFsf7X1q1MaDU7nF6cw/DB+s8 wGj4utiqI/q3JJpvUHoSdFbkwJG/nCu7Xuw6eA2EvIAjCS5SPK+Qp4BKRv7Ke3jOAWpP D70CnxHpDo3s46G6U1n09JrpHVl28zqookdD2h7igjArThuTI6WFaX5zCB3yDyKrhYdL FyLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@u92.eu header.s=fm3 header.b=aD9TvLou; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=IXPVXh70; 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 d15si7690109edj.560.2021.09.23.23.44.58; Thu, 23 Sep 2021 23:45:43 -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=aD9TvLou; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=IXPVXh70; 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 S244274AbhIXGpJ (ORCPT + 99 others); Fri, 24 Sep 2021 02:45:09 -0400 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:48127 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244182AbhIXGpI (ORCPT ); Fri, 24 Sep 2021 02:45:08 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id D5735580B65; Fri, 24 Sep 2021 02:43:35 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 24 Sep 2021 02:43:35 -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=7drGizuMVrgy3 XtFLhWzlftyWemSxaP+r0ayB6xLFcI=; b=aD9TvLouQJ44fgUO1XPrMKkRIVaAb TkeMf42dCy0G8Avl7izAaMwsP8xHiqzmKEl501aMgnO/jIJQYeIZvdTnQFuzn0Yr f2vwl87o/sm3wuAiTQ/4KZRM17zildKntns2gScaWUGpo932KZPmSX26aJto/BaD nPiOnR2cm96n9TUdOWxoPxHLynCE/ROHOjPac8uYKtj+nfeY8dDEzkVeXi5Z5b5w EJzqgluVmI1n0EQvYzTnFUnWRpN7pwjqJX8G4Qp5ipc0nHcH/GnFmG1X0Vp5UCF4 KvoRmzza0IFr/cvFT3fJEqT340YUZxAGh4AsmOJyX10GDrfJYs77JIO/g== 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=7drGizuMVrgy3XtFLhWzlftyWemSxaP+r0ayB6xLFcI=; b=IXPVXh70 M1FOF2LjVHnHz+7i1X8Ga5PgYZFv+Mt7qoKoL1U9AdYc1YdF0zPPG/bCgrydebVT Zy1uA8sQn1x33BcgTN0xBPIjHLhT89KeCNK21/ZExlfnGVtk14qWQATUVnZq0LPr UJ4iJJW/SF0+4kBa2BJx331mRPeH3yyuiDe1nyeKoSL+eF4zeoQvpiVxIxGYKy4a hWba/1ihUxNncw8P8vpVcE6jJ0a1xQYklFcvjY2EcA8TOMskIex+5MJhktBVwA5w +86g3CsTTbKQqQqE++BkKHmzwGEXjx21CSLFdmVtwIdb6Tc1SlF7hw8+9y1Eu0zy v1y/dBlmwIXkfQ== 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:33 -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 01/17] drm: cleanup: drm_modeset_lock_all_ctx() --> DRM_MODESET_LOCK_ALL_BEGIN() Date: Fri, 24 Sep 2021 08:43:08 +0200 Message-Id: <20210924064324.229457-2-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 --- drivers/gpu/drm/drm_client_modeset.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c index ced09c7c06f9..5f5184f071ed 100644 --- a/drivers/gpu/drm/drm_client_modeset.c +++ b/drivers/gpu/drm/drm_client_modeset.c @@ -574,6 +574,7 @@ static bool drm_client_firmware_config(struct drm_client_dev *client, int num_connectors_detected = 0; int num_tiled_conns = 0; struct drm_modeset_acquire_ctx ctx; + int err; if (!drm_drv_uses_atomic_modeset(dev)) return false; @@ -585,10 +586,7 @@ static bool drm_client_firmware_config(struct drm_client_dev *client, if (!save_enabled) return false; - drm_modeset_acquire_init(&ctx, 0); - - while (drm_modeset_lock_all_ctx(dev, &ctx) != 0) - drm_modeset_backoff(&ctx); + DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, err); memcpy(save_enabled, enabled, count); mask = GENMASK(count - 1, 0); @@ -743,8 +741,7 @@ static bool drm_client_firmware_config(struct drm_client_dev *client, ret = false; } - drm_modeset_drop_locks(&ctx); - drm_modeset_acquire_fini(&ctx); + DRM_MODESET_LOCK_ALL_END(dev, ctx, err); kfree(save_enabled); return ret; -- 2.33.0