Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2026810pxb; Thu, 16 Sep 2021 23:51:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNsy76F/dayfhO7kR3qtdYoTwDVWam8MnyQJUrdiNSPiGBrDlhyiBbqCAwKrMcUo+RFUyh X-Received: by 2002:aa7:c04a:: with SMTP id k10mr11222384edo.32.1631861470817; Thu, 16 Sep 2021 23:51:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631861470; cv=none; d=google.com; s=arc-20160816; b=edWB3FcoqhoHmQjuCLnXEmzuC5WcV1hBZTFvIVOIrGosG2GsUdpGf5VkxaAYBKJosK XErXv1RZqFl2TJLpa7qIPOB9wcYMLzw0NiDrJCM298wtc3OkKWVKnD0z1hcHlbT2Tfpp Dh56dZfm7FJ3cBf5QXqxZ+f6GNKOuqxbIAWTOohaBOIk/WFYAFa66XdtBAoKAzZGBsyQ 05hobQRkAMpgBiHhQlKje8q//nVNukZnEUGtPiWWDXC0lR2xru9q5TFxZbhS6o8iYv05 XyIvB0MFnsU4DOkjKNwtZBwvar83zJ0BDY6rolJ9/2vEUcTRf5xptCCg86GRNoUR5XlY q1BA== 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=THT3r23bRB3DOSyAiuVpoYppTCo9NOFvRLFcWAQJ5Xg=; b=SAiXBzeE0MCCoo6fqkVzBL+kVEPx7ZNFhKIN9nLHZxK8W+Hw3j+urDQrlmhuVuWFXe IFWluFlSvCB8SnPvrWOg7ISBn5g4Vwv4gSutO50jxPPPE6rz25fPVRpJ/cETVZGMZnSG oLEIZBBvwfzIqhLDG50B+4ZGQnULm/EzolNaMW16ASQpPHe4yrENVlK4YVVXnnzOVZkd MoofD5v5jbho5IAJK/xmPGoTss8lKN7sH2tSRh+tSjIXX/J6/9cNJ024CGGOdV89rrRM pZGRr1mWn+o6TTYj0bg+an8ltuL3w6iu5feo3QDnBaNSvFL4gjyraBZxInaC30L3nr/0 asFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@u92.eu header.s=fm3 header.b="fzPkV/sw"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=d8LkK8Bd; 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 de41si5577594ejc.244.2021.09.16.23.50.47; Thu, 16 Sep 2021 23:51:10 -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="fzPkV/sw"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=d8LkK8Bd; 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 S234453AbhIPVRe (ORCPT + 99 others); Thu, 16 Sep 2021 17:17:34 -0400 Received: from wnew3-smtp.messagingengine.com ([64.147.123.17]:53301 "EHLO wnew3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234500AbhIPVRa (ORCPT ); Thu, 16 Sep 2021 17:17:30 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.west.internal (Postfix) with ESMTP id 7CECF2B011E2; Thu, 16 Sep 2021 17:16:08 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 16 Sep 2021 17:16:09 -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=THT3r23bRB3DO SyAiuVpoYppTCo9NOFvRLFcWAQJ5Xg=; b=fzPkV/swvhkVUzk2HO/pxss5LUjVv rfi/aD58J9VRvld38mJVM01mniZ1GrY3QlwKKMf3C7MnMxp9+SXpfN/JKC5QgkPr Q5CgwrNnP3X0Fj6NmNKozImKZKdD/I+4/27dWneSQrbobkvKWiJIH7yNH/eVar1H ey2mSHiNzmOpBtAyl6HmkFinNFvCZeZzo637/NOLdEvN8oOwrWIQbuJu4osahaMq HPUM0uDodgEadgeXjoCAlUZzPbOkBQoxJ0vNHPOV0poFTZmofwwLWJCwLD883KGf RynggfEBlIl9IDFOeHeVYXzKEtNPK689/JjR92PoFEH+LYERvoAMTg2MQ== 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=THT3r23bRB3DOSyAiuVpoYppTCo9NOFvRLFcWAQJ5Xg=; b=d8LkK8Bd 6XK+FC7BimbCd93EyVc28yF6VPT5T+MvCk2csON9fhpq2v1YIrf3hWbmQVk4nXik zbzZ5S2T2JnKQi8kXV7+UAx0lVKMXR4ryI9eOvrotYTBR8ECAVGpWkGV5S5a2HHN w915K639KZM4lm3a2nLjokqAbcoNJjRToT2XoScT9t0l3IN97gq7LsjEnsxlZCG6 yLGkJpA7ABDyWGMEMAFg97nv7meytb9EYS6WVRoiwQBqkabe011e8yfV8NswS2Kj oddD56VZsR990BjSCLlwug/3SF5Jkk2xkgvZomCFGCg9s1RLmxd1oom0EVO56KQG LN49xTHOHekVWg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudehgedgudehvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefhvghrnhgrnhguohcutfgrmhhoshcuoehgrhgvvghnfhho ohesuhelvddrvghuqeenucggtffrrghtthgvrhhnpeekleekjedtheejheekfefggeevvd fgueegffeuveduhfehueegkeeijedvvdejfeenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvvghnfhhoohesuhelvddrvghu X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 16 Sep 2021 17:16:05 -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 02/15] dmr/i915: cleanup: drm_modeset_lock_all_ctx() --> DRM_MODESET_LOCK_ALL_BEGIN() Date: Thu, 16 Sep 2021 23:15:39 +0200 Message-Id: <20210916211552.33490-3-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/i915/display/intel_display.c | 17 ++++------------- 1 file changed, 4 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..997a16e85c85 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -13476,22 +13476,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