Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3825920pxb; Wed, 13 Oct 2021 13:53:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqRmY/mhfRQc81wH84j4lmkPjsnzOzeHDi8ID208rTv/Ph8FdZydsNT7gUSxXyuihMJudQ X-Received: by 2002:a17:906:bceb:: with SMTP id op11mr1792013ejb.449.1634158382912; Wed, 13 Oct 2021 13:53:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634158382; cv=none; d=google.com; s=arc-20160816; b=B9SfJUk2ShiH7s4fsJepD91fMULmLDRbQtuu4AETQO5CmIuMCxMYGyUyAA68w9+FZK PdW2MWsVi/l524ALowJIxCflbL3F53aF4cKaEi9gfHhPtdzBusPRQX7LZdclgLhch5hF tmowN1tikfeyzYO1WpHgYI3NmvICabmSVYGfJTc3aRa4OLfHl6qKLef+obs0STtlMkxb g+eewbfM/9R0lcCGg6xq5Bn2eEvJOBfmLPPibfwNOSLaAw0zQXUnT6VRVqDIfss5aOu9 f3QVqt8Ivvqha3Hu0f2GMPm/QaFVRBkjqqu1TJ5aYlarqtfAM6vdDUc+yCp6eAHyxPSo XzTA== 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=PuRwF9Ft3UyWBJf64PRaXhYohKvgAVW28ATMLUMmKjo=; b=Zotz7AK5PDfqVPRYJUQXXUq9S/mVhEEZRAX3+06eturcDnG63LI4j0HkiHZhcqACTN uiSFNR0gzw+WnA2McI/m2Tvp1pKpRxzIA4ULu8w6/3Qb8wgq7/YQP74JmEs/SdKpsVMK jikTn6ws1OOtO3/WtaZA/Wmqk3f2U3c4fg+Mq7xtghWoSg45kuLd4vLD0vvB71T9kbsk dz3rO18X7ahcWPN8CvDJphNJ8P+vcP2GXjVDcMrgp9aIxOfbTC0GaZIO6LlqQAoBGx0B OPvI4HOIg+rFqjauYRWDJ5as4YQTWYRvG3T32pugT758l5tdBzWtyplVYSaoYA++FKMa Li3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@u92.eu header.s=fm3 header.b=TeNRBD6s; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=iOCBCgVY; 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 26si895447ejz.347.2021.10.13.13.52.39; Wed, 13 Oct 2021 13:53:02 -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=TeNRBD6s; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=iOCBCgVY; 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 S230378AbhJMUwA (ORCPT + 99 others); Wed, 13 Oct 2021 16:52:00 -0400 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:46651 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230110AbhJMUvl (ORCPT ); Wed, 13 Oct 2021 16:51:41 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 4AE68581176; Wed, 13 Oct 2021 16:49:37 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 13 Oct 2021 16:49:37 -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=PuRwF9Ft3UyWB Jf64PRaXhYohKvgAVW28ATMLUMmKjo=; b=TeNRBD6swzkG79I9b7TXSsHo33CRX Gsm+GcPGgDFQXMEyqf65VKjDd8gwa4dADG13lk8skjou25p8QV/d3q2+Mvv3pYJx kki+sSEjwKdQF2ihuzdBjuhotdt0SsPOS9aD+Q7ufOGJAAU7h6DRYW8gtoClN74+ ay2lpN4YxznXxbPcTdSW66PK3RK0vWRJU28d09J6klPD2bPfR/5R91SN2kAbTqdb fBbXONHgFYxzvxV6gnsg30JMzbV3271HaZfnJ+hFQXQV/HUa810oVbTXTacv/+TX lloqyy/7Y3AkRQDhYbi1xnDuheWCVPRenyLcqZf84khS6rLfa1RqtV0aQ== 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= fm1; bh=PuRwF9Ft3UyWBJf64PRaXhYohKvgAVW28ATMLUMmKjo=; b=iOCBCgVY QLlMxtfhB0e3TIoRzHX8iKMXkYWWUHgZmwuG9+SdtL6J7qUW2MMInBerBWPlEWsU OueKWNTxLVYR4L+hrV8VRaaK8Q1lb+e5550vgxfzGZH3tz6gxPVPWsZ/tkUoXo0p nCjVar4De24RqwzyGifD6QyKhHxwfG/sxbx+A50PnjhQWUjOjXrV2aNeDS+G3a9i BZZj2HwGQMegLD5d56Z+JA/HAlFxMRIPx/F1YyQu2UF4E78Hr/XrR8iZNI5OOdyk cEinoGuAfW5JiUuLCHX6YMPDlGa8h6dg9ibg/UFcKCdeJuZNYStwQxuD9rKGSZ02 v+6CqtUXYecZKg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddutddgudehvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefhvghrnhgrnhguohcutfgrmhhoshcuoehgrhgvvghnfhho ohesuhelvddrvghuqeenucggtffrrghtthgvrhhnpeekleekjedtheejheekfefggeevvd fgueegffeuveduhfehueegkeeijedvvdejfeenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvvghnfhhoohesuhelvddrvghu X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Oct 2021 16:49:34 -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 v4 15/20] drm/gma500: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN() Date: Wed, 13 Oct 2021 22:48:41 +0200 Message-Id: <20211013204846.90026-16-greenfoo@u92.eu> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211013204846.90026-1-greenfoo@u92.eu> References: <20211013204846.90026-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 3030f18ba022..021a7238508f 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 = to_drm_psb_private(dev); 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 = to_drm_psb_private(dev); 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