Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1255720pxb; Thu, 23 Sep 2021 23:45:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeKv6NH1xTivaC/ZhKWIWhsIyBdcCezwzOeqTtr+2CKJyZ3gWykGQe/33aww8QYdtMrtwm X-Received: by 2002:a17:906:314e:: with SMTP id e14mr9520765eje.165.1632465951992; Thu, 23 Sep 2021 23:45:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632465951; cv=none; d=google.com; s=arc-20160816; b=a9+vCRmxMQugglHJ1FUSG60Sgs9NzBUy2UzNj4Il4MYnb3EC7jdG3Tnl8J4LGP/teq xgbEIgqUWsUYT+gBEJIEVRPn1A3ioTTBJdKr1OTD4VtQttmeSBStwjb5Ys6ABy3r7Zqr CzmuoRpgpYly2hs+4pz0g1tgjLhnUQ2SWhiePfpIj133WSQa8N4AGtc9u1nPtxJVoSdi FD8nVrxt1WR+NQw64B2wIFpdASOdw4iFpaWXDNN00GoPcuje1CaKQlKgaohlw9JT9iP2 KseqN4WsSdnlbzFn9LbheuRQ8nsW/vRMz9//q1OTjlHm4GPuSbnUB83cEiCtu8ZoPHHG /gBA== 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=OqazDwlqGLeCW8on6jqoWGyiDynRUp/lRFNar3oIuVo=; b=PD2T3VZPLMf62wzfabaHurcNGniisPXD5fqp1xAcokLnkISHuguMfgVl9DGnhalglP x6MISFkr4bg3i9moTJhuZsJTgU9W7y85+po933wu483ih86ZckPVDAAXvNwfWL35o7rH 2HCQiHszB3xlVD5KmMDark9nlwZ327NEdUM3pC9yox3h3D5JWR5WMeFr9uW9U0R1xFqe CxpzQOWF/7De17ZB6KsrwTDw+dVyGGHAOs4CeC5q4q/GX8MjW3XRwH9Kon1ejajq7MkX MybRTWSClWSgwN4wUTl4hegZO1R0tM+l5ASwuwTlgBd7NITAcTl8kzETBh503O8mCyQl tTBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@u92.eu header.s=fm3 header.b=o8MLSu9Q; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=gCMmZ3ir; 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 bi14si8161261ejb.441.2021.09.23.23.45.05; Thu, 23 Sep 2021 23:45:51 -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=o8MLSu9Q; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=gCMmZ3ir; 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 S244287AbhIXGpM (ORCPT + 99 others); Fri, 24 Sep 2021 02:45:12 -0400 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:45365 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244279AbhIXGpL (ORCPT ); Fri, 24 Sep 2021 02:45:11 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 6BC92580B75; Fri, 24 Sep 2021 02:43:38 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 24 Sep 2021 02:43:38 -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=OqazDwlqGLeCW 8on6jqoWGyiDynRUp/lRFNar3oIuVo=; b=o8MLSu9QdD7+d0xFbK6ipk/Ys89+s dECh0OLqHpqJw9/xEm4jDEv4tUEC9dmKMoc8wyg1uiWV64j0+xaeKuV+0ZY03S/V w8B+yBTJtDAR8WEsT260qhHlWMh38brPgw3tdz75srfzOWWt2YS6U3sM3CN43jXP Yro9iBszUWHdc2cNlSGvgNaS8UPU0ycA7dma1L85sUGULcDB983kdCf6w5fY/WBm /n+4Sz54heyS/xssLXRgH3qyMAbZ4x59lnBefAZmWSmPme+2qWNA8PJcbqt4bJ5g /x6VL7Z8rc1eD8lWEtZIKp+cgG3APoc/MdzEovAdxqspf33hIwgZNKlIA== 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=OqazDwlqGLeCW8on6jqoWGyiDynRUp/lRFNar3oIuVo=; b=gCMmZ3ir sjbJ+n/GKUO15m5PqyWcNa95tcVr9fWEv/qs5fkX+GET4AoUotETXkFCnhUqkZCM Rao+5e8s8e5RZ9QnYVQJIO1JVjkYbUdHDhrHazGnQ2c2J9lze1c9mskr0gt0rvnw P5hxOrczVb4KI8Yu67i7f2H2HrYkip6n3oAf7LgqDdMcVeJ+apunja9XhbBwFLCq t4/DiD1ZBuUl3BXzVFtXzb8Bwo087GbYavKqiQqqnIj4t2CoXi3bRVeKdk6xOmmM hFtmrH6nLFC5BItzCQUJc2ZviQaYL+gtpzB9YZRU+iKp4pHfgez9k7Y3iKXP4dGl 1eGLDJkLJWHaDQ== 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:35 -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 02/17] drm/i915: cleanup: drm_modeset_lock_all_ctx() --> DRM_MODESET_LOCK_ALL_BEGIN() Date: Fri, 24 Sep 2021 08:43:09 +0200 Message-Id: <20210924064324.229457-3-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 --- drivers/gpu/drm/i915/display/intel_display.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 134a6acbd8fb..2bf01416d656 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -43,6 +43,7 @@ #include #include #include +#include #include "display/intel_audio.h" #include "display/intel_crt.h" @@ -13476,22 +13477,13 @@ void intel_display_resume(struct drm_device *dev) if (state) state->acquire_ctx = &ctx; - drm_modeset_acquire_init(&ctx, 0); - - while (1) { - ret = drm_modeset_lock_all_ctx(dev, &ctx); - if (ret != -EDEADLK) - break; - - drm_modeset_backoff(&ctx); - } + DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); - if (!ret) - ret = __intel_display_resume(dev, state, &ctx); + ret = __intel_display_resume(dev, state, &ctx); intel_enable_ipc(dev_priv); - drm_modeset_drop_locks(&ctx); - drm_modeset_acquire_fini(&ctx); + + DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); if (ret) drm_err(&dev_priv->drm, -- 2.33.0