Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1256805pxb; Thu, 23 Sep 2021 23:48:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfh1bER23f/kLHKojEJvv1bz48J/J61S1Fs+zku9B5Cx8Q8YhKbudU/F0LPKYn5xQNA7+3 X-Received: by 2002:a17:906:53c8:: with SMTP id p8mr9381641ejo.422.1632466092366; Thu, 23 Sep 2021 23:48:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632466092; cv=none; d=google.com; s=arc-20160816; b=K+DwpVfdTI6S+i0VgePzoaUjrwat+XCZAQaprjXboqBziSLDQrZOjuRYxDMK8HWxti TjiKOE79jpo7s9VnnDsd8IdKKaTR4rFKUVxQ/qOgueip/8NDgU5NEybFhIsDn/PFthEi uKGPEmILVB77CZnnJRE086UFJmuzZTeUifLeiwLDCT8F3zFESRH7r+m5YvmymdrRNvoC Dlrzb3SOlW+y5UgWZb75X0tltx0ziELWqcAHowxUhF2tLwVy2ul08RF4KPE9FA2Wy5lI P9d1ZYOHd3LuKxPl9CjznuvogSR2Wupdk/8paTBFrAlBP5mEuI/EAnI4b1M/2WltEVoF HPhw== 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=tQ7fPMA+k/fulDlgZN6bcVcmaKq9X2y5rvMhwSoX/o0=; b=pSQnqCuosxKbteQlJGQPP7kjFt8Rkc8qSxLjC+nvg52AhGGit4mopl1VOQZADsqkcw fviE/86qkt5f0hwFBrmHFIB5GbkLcYp2z4PgZKgms3F2807vPEAXyWN+wFKfM8j015qp Es8/UEB0dNJLR3oTf+XPeUW2axDhCELXVIkksLTuBRgFjmVTb8qiCKTUa4M786g44i3L PP9Ec+uOr3c0WAFYP4RUaKYB1WYuN3j4G6FiXR5JtxOWiV7riQ8r+P4q7P3pbq+CxToi 54TFrzgO91WRPz0lWPwt1+mhaisubolhCf5DOnpPV6HzpEg1Nbvhmvdw6nmq+qip/SPW rdTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@u92.eu header.s=fm3 header.b=Zjst53zs; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=W2Ye1ny1; 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 dg13si2544834edb.604.2021.09.23.23.47.49; Thu, 23 Sep 2021 23:48:12 -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=Zjst53zs; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=W2Ye1ny1; 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 S244446AbhIXGqA (ORCPT + 99 others); Fri, 24 Sep 2021 02:46:00 -0400 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:36035 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244408AbhIXGpr (ORCPT ); Fri, 24 Sep 2021 02:45:47 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 4413858107C; Fri, 24 Sep 2021 02:44:14 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 24 Sep 2021 02:44:14 -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=tQ7fPMA+k/ful DlgZN6bcVcmaKq9X2y5rvMhwSoX/o0=; b=Zjst53zsynbvx1z5/4T4LviMKVeKW vSC+kRVtIHeybzjgB+cm9w/lvtMJGgdtROr2NWXXaYUEIs5m8VZMR9kDBLWCb2gz MFhR6iVtu+rcoyNVbmz4uu3Ayknb7wVMUz9vkv9TH9nav7ZYmmfCR4lUH1zgErso QHdmTZSaACSwYGlLlZLuNUcUsQBqTy/+TVrv7jkYPUVX1Of7LONV+MS5P1dMxQ6P MZbmwLOaWgFbUBJotmads7AjYL6rgrxlZArQLFHIanrJUv7D5XqZA7jhOkSLi7zC R5upFM9rZq7BMbrvegw08bqzfv6gF5Dj81g33DEqB4o0vB7IhkC8YCkdA== 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=tQ7fPMA+k/fulDlgZN6bcVcmaKq9X2y5rvMhwSoX/o0=; b=W2Ye1ny1 QKoj5Jt/dQhTo7C4XzB6salMQJKiE5nauB7UXTWM64IoHf23jukyusjXfHpU0UM4 llYAmIGZwbEBm8skIP9icUjOebCsovkiCFX8dA52riG0AqXZjJlP0xkb4SVziPSn UFpoKae70R3SYDv3UxgHGMXun6YORySUTpV+vLccihm9hvyhZhPHQCxRlmVC87+t fbglziisIhXleHOUrC0rzcV7K+HPr9pizny1T1krt3ItE5q4ji8csSCtYWjcy+ol cRMV7tgPM/hMvSNp6ctH/gyP72K/CABo4P1WnJJS1gpmVueF8wdXlPnc/6aJ1noc DBy/8E8KfbnVDw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudejtddguddtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefhvghrnhgrnhguohcutfgrmhhoshcuoehgrhgvvghnfhho ohesuhelvddrvghuqeenucggtffrrghtthgvrhhnpeekleekjedtheejheekfefggeevvd fgueegffeuveduhfehueegkeeijedvvdejfeenucevlhhushhtvghrufhiiigvpedvnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvvghnfhhoohesuhelvddrvghu X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 24 Sep 2021 02:44:11 -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 14/17] drm/gma500: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN() Date: Fri, 24 Sep 2021 08:43:21 +0200 Message-Id: <20210924064324.229457-15-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 driver calls to drm_modeset_lock_all() with DRM_MODESET_LOCK_ALL_BEGIN() and DRM_MODESET_LOCK_ALL_END() Signed-off-by: Fernando Ramos --- drivers/gpu/drm/gma500/psb_device.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/gma500/psb_device.c b/drivers/gpu/drm/gma500/psb_device.c index 951725a0f7a3..98d06736dbaa 100644 --- a/drivers/gpu/drm/gma500/psb_device.c +++ b/drivers/gpu/drm/gma500/psb_device.c @@ -8,6 +8,7 @@ #include #include +#include #include "gma_device.h" #include "intel_bios.h" @@ -169,8 +170,10 @@ static int psb_save_display_registers(struct drm_device *dev) { struct drm_psb_private *dev_priv = dev->dev_private; struct drm_crtc *crtc; + struct drm_modeset_acquire_ctx ctx; struct gma_connector *connector; struct psb_state *regs = &dev_priv->regs.psb; + int ret; /* Display arbitration control + watermarks */ regs->saveDSPARB = PSB_RVDC32(DSPARB); @@ -183,7 +186,7 @@ static int psb_save_display_registers(struct drm_device *dev) regs->saveCHICKENBIT = PSB_RVDC32(DSPCHICKENBIT); /* Save crtc and output state */ - drm_modeset_lock_all(dev); + DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { if (drm_helper_crtc_in_use(crtc)) dev_priv->ops->save_crtc(crtc); @@ -193,8 +196,9 @@ static int psb_save_display_registers(struct drm_device *dev) if (connector->save) connector->save(&connector->base); - drm_modeset_unlock_all(dev); - return 0; + DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + + return ret; } /** @@ -207,8 +211,10 @@ static int psb_restore_display_registers(struct drm_device *dev) { struct drm_psb_private *dev_priv = dev->dev_private; struct drm_crtc *crtc; + struct drm_modeset_acquire_ctx ctx; struct gma_connector *connector; struct psb_state *regs = &dev_priv->regs.psb; + int ret; /* Display arbitration + watermarks */ PSB_WVDC32(regs->saveDSPARB, DSPARB); @@ -223,7 +229,7 @@ static int psb_restore_display_registers(struct drm_device *dev) /*make sure VGA plane is off. it initializes to on after reset!*/ PSB_WVDC32(0x80000000, VGACNTRL); - drm_modeset_lock_all(dev); + DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) if (drm_helper_crtc_in_use(crtc)) dev_priv->ops->restore_crtc(crtc); @@ -232,8 +238,8 @@ static int psb_restore_display_registers(struct drm_device *dev) if (connector->restore) connector->restore(&connector->base); - drm_modeset_unlock_all(dev); - return 0; + DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + return ret; } static int psb_power_down(struct drm_device *dev) -- 2.33.0