Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1256357pxb; Thu, 23 Sep 2021 23:47:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/BscrurNjFd2DNbNnmWnKT+/ygOxK1dE8mnYo+ODV1ooWRwKGVK0fpOYthauOAB1lTwmH X-Received: by 2002:a50:f1d9:: with SMTP id y25mr3256193edl.116.1632466032409; Thu, 23 Sep 2021 23:47:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632466032; cv=none; d=google.com; s=arc-20160816; b=NHiIaiOl3lWbFPzmP4lIHfAqWhxudr1fCgV+2ncjuCz7cZ17R/lnhCIopkN+i0KSNv RtTKmwZw71DzXlzW5yb0d+nzlhbUMgFWdPsHvGbHXhx4IXZWLNfGJsRhwvgftlCBmIA/ Lc3qOIvyd6/93RE9VHhUvUEiy6gkippvRgkfnf6CnZBU2jZEzKepg6kPwh9nEdpaj8Is z+hKJVkS8qWaSeY0h7RlMsbRINIqCMCFIOzTgofzjXGY7j01W+HYAmI33m7E2b5O/Npt hAahPnSAxc/aqHy4IHjcZSwnNOYCBH6dzL3QDQJ7xfObF3ZVxSyQ7Mp5sk+GeLTmKDw4 vexg== 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=xpHw3dVyitCsswUBuUby/MBpmwaRe7OGtFviC33KSf0=; b=eX9DdfXjl9BVwD97Qzshkzy9wCiTd+M9Tiwb8xTDuFo4UGHbe4jGEMv8vgYIpIOkfI ctrfvMpFQ3FrQbavZytURF+OaDbI7fyDMt0ak/LGZEX3+SB/bnQCVP7mEOqqeag8CSTP d03vP3iz+ppLY49GUBTV+HdgwLj0Lzr2CbtuStwnQ+fHjqcGm9jbd7IJJUf5wnWof4h0 cEwqM41QTqnli1odkfa4Z74DXSJxL02ZaM/SGX6nvut8XR5CRG/Wlrvd5zGbPBvwEHUs bnYQEc4PbTs+2lP805qfz6XBMaUhSzxiae8Vd9cUbQl+mc9nhKHKqGJm3VhvpqTTWsKb e00w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@u92.eu header.s=fm3 header.b=Obavd4dR; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=KKbu+FcI; 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 p4si8587586ejr.151.2021.09.23.23.46.49; Thu, 23 Sep 2021 23:47: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=Obavd4dR; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=KKbu+FcI; 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 S244399AbhIXGqC (ORCPT + 99 others); Fri, 24 Sep 2021 02:46:02 -0400 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:58455 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244267AbhIXGpz (ORCPT ); Fri, 24 Sep 2021 02:45:55 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id B396058107F; Fri, 24 Sep 2021 02:44:19 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 24 Sep 2021 02:44:19 -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=xpHw3dVyitCss wUBuUby/MBpmwaRe7OGtFviC33KSf0=; b=Obavd4dRrAcTjE8izX7By+AWxmPWR sd95TNPTS45RoGX2YsI6pu4O4eW+14r+bNIq8ZgKpBqUqTDAV0DNIGCyKbPvEdxN J6K9f9vY4rVSQxDd3wds8VBLr3f4qAL9wxCnNByKNcMwVG0LvZD46WP/yexfLSPg ++HlaWjxBFjjwfkmKQ7sA0Lx014/SIZ0pauKFc1avmVyx46sMPBgwnv3SeYGfZ6d 3rY8SirosES4grZEVNbqh72rh3StVe580etPIsMqQWkQLB96NpWCcVz65r+S0TIb k2birgSYUEA/bBuPeaIaZJ+3DQuk0DM6BKPdEGMf4lQhyYBCKW8NkTpqg== 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=xpHw3dVyitCsswUBuUby/MBpmwaRe7OGtFviC33KSf0=; b=KKbu+FcI qy/KmSy9fpXR+JUQxncRr4s1/ih7MSXWTbtu500gdkxQiDPlwjTrlHdz11R6N2wn Nhj9yoDh1V0R98KNMbTp1A87y7DmgBihS9wo1h6vpy2kTfoEItzIrVJkeniPP+zH i3XeJ4NPH/IZPHrdjuANggPDMppckBJMSZncjHm/h+S3USAeuJz9sorE1ITiAzNq 3aOOiJdY3c6N9kWWbIcdKhhm918XQ0MOT32MW1lX6K1d4lN+Xkoz0ocy1MB4W2kE PVQloOsYAFF+A4ygMGzaBTK3vOP+rc8rEAwU934oNsuSpFY0eexZhIDkhReQ0IfH R2JQsOheFX8iWQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudejtddguddtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefhvghrnhgrnhguohcutfgrmhhoshcuoehgrhgvvghnfhho ohesuhelvddrvghuqeenucggtffrrghtthgvrhhnpeekleekjedtheejheekfefggeevvd fgueegffeuveduhfehueegkeeijedvvdejfeenucevlhhushhtvghrufhiiigvpedunecu rfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvvghnfhhoohesuhelvddrvghu X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 24 Sep 2021 02:44:16 -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 16/17] drm: cleanup: remove drm_modeset_(un)lock_all() Date: Fri, 24 Sep 2021 08:43:23 +0200 Message-Id: <20210924064324.229457-17-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 Functions drm_modeset_lock_all() and drm_modeset_unlock_all() are no longer used anywhere and can be removed. Signed-off-by: Fernando Ramos --- drivers/gpu/drm/drm_modeset_lock.c | 94 +----------------------------- include/drm/drm_modeset_lock.h | 2 - 2 files changed, 3 insertions(+), 93 deletions(-) diff --git a/drivers/gpu/drm/drm_modeset_lock.c b/drivers/gpu/drm/drm_modeset_lock.c index fcfe1a03c4a1..afd1351749a5 100644 --- a/drivers/gpu/drm/drm_modeset_lock.c +++ b/drivers/gpu/drm/drm_modeset_lock.c @@ -77,93 +77,6 @@ static DEFINE_WW_CLASS(crtc_ww_class); -/** - * drm_modeset_lock_all - take all modeset locks - * @dev: DRM device - * - * This function takes all modeset locks, suitable where a more fine-grained - * scheme isn't (yet) implemented. Locks must be dropped by calling the - * drm_modeset_unlock_all() function. - * - * This function is deprecated. It allocates a lock acquisition context and - * stores it in &drm_device.mode_config. This facilitate conversion of - * existing code because it removes the need to manually deal with the - * acquisition context, but it is also brittle because the context is global - * and care must be taken not to nest calls. New code should use the - * drm_modeset_lock_all_ctx() function and pass in the context explicitly. - */ -void drm_modeset_lock_all(struct drm_device *dev) -{ - struct drm_mode_config *config = &dev->mode_config; - struct drm_modeset_acquire_ctx *ctx; - int ret; - - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL | __GFP_NOFAIL); - if (WARN_ON(!ctx)) - return; - - mutex_lock(&config->mutex); - - drm_modeset_acquire_init(ctx, 0); - -retry: - ret = drm_modeset_lock_all_ctx(dev, ctx); - if (ret < 0) { - if (ret == -EDEADLK) { - drm_modeset_backoff(ctx); - goto retry; - } - - drm_modeset_acquire_fini(ctx); - kfree(ctx); - return; - } - ww_acquire_done(&ctx->ww_ctx); - - WARN_ON(config->acquire_ctx); - - /* - * We hold the locks now, so it is safe to stash the acquisition - * context for drm_modeset_unlock_all(). - */ - config->acquire_ctx = ctx; - - drm_warn_on_modeset_not_all_locked(dev); -} -EXPORT_SYMBOL(drm_modeset_lock_all); - -/** - * drm_modeset_unlock_all - drop all modeset locks - * @dev: DRM device - * - * This function drops all modeset locks taken by a previous call to the - * drm_modeset_lock_all() function. - * - * This function is deprecated. It uses the lock acquisition context stored - * in &drm_device.mode_config. This facilitates conversion of existing - * code because it removes the need to manually deal with the acquisition - * context, but it is also brittle because the context is global and care must - * be taken not to nest calls. New code should pass the acquisition context - * directly to the drm_modeset_drop_locks() function. - */ -void drm_modeset_unlock_all(struct drm_device *dev) -{ - struct drm_mode_config *config = &dev->mode_config; - struct drm_modeset_acquire_ctx *ctx = config->acquire_ctx; - - if (WARN_ON(!ctx)) - return; - - config->acquire_ctx = NULL; - drm_modeset_drop_locks(ctx); - drm_modeset_acquire_fini(ctx); - - kfree(ctx); - - mutex_unlock(&dev->mode_config.mutex); -} -EXPORT_SYMBOL(drm_modeset_unlock_all); - /** * drm_warn_on_modeset_not_all_locked - check that all modeset locks are locked * @dev: device @@ -380,10 +293,9 @@ EXPORT_SYMBOL(drm_modeset_unlock); * This function takes all modeset locks, suitable where a more fine-grained * scheme isn't (yet) implemented. * - * Unlike drm_modeset_lock_all(), it doesn't take the &drm_mode_config.mutex - * since that lock isn't required for modeset state changes. Callers which - * need to grab that lock too need to do so outside of the acquire context - * @ctx. + * It doesn't take the &drm_mode_config.mutex since that lock isn't required for + * modeset state changes. Callers which need to grab that lock too need to do so + * outside of the acquire context @ctx. * * Locks acquired with this function should be released by calling the * drm_modeset_drop_locks() function on @ctx. diff --git a/include/drm/drm_modeset_lock.h b/include/drm/drm_modeset_lock.h index aafd07388eb7..865e64bcc4cb 100644 --- a/include/drm/drm_modeset_lock.h +++ b/include/drm/drm_modeset_lock.h @@ -132,8 +132,6 @@ struct drm_device; struct drm_crtc; struct drm_plane; -void drm_modeset_lock_all(struct drm_device *dev); -void drm_modeset_unlock_all(struct drm_device *dev); void drm_warn_on_modeset_not_all_locked(struct drm_device *dev); int drm_modeset_lock_all_ctx(struct drm_device *dev, -- 2.33.0