Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3825066pxb; Wed, 13 Oct 2021 13:51:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsgKrjliTjhZR83i5CdwmTJ6GumbQu27dHRVGd554I+7NJwU/WaQ1CPLjYVgnWT6Clvicx X-Received: by 2002:a17:906:ca18:: with SMTP id jt24mr1767432ejb.325.1634158297975; Wed, 13 Oct 2021 13:51:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634158297; cv=none; d=google.com; s=arc-20160816; b=zTYKRwplKqorXTn/v8DHIuBfPHz0gwMMHoje51gUmrrjT4Vjj2Qpy4ubU4XMyef+Sm vMV1eDn/rHuavc7kbUIY+ETrQdSkwjA7ytKNKPk+xj3ekhheyu1YdO17OQM4TemHkjk+ /GRgv9V9ChRbF+ZvW2wOnxZYIDv4jgQRwhGjnvlcBV1/sDdo94yYU3fo21/r241DFKOa bfAANHAgGE76SZMRBg+QQasKRs1wI/S+KwqukQtNUkKIW/hgFZ0nWAWyUAEzkW5rpafh 9vZ2qWag8puJGRcHLZ3cSmH8Hdfp4+m5rOYgKRBZusox2tHx+/4uhRTlVrGI9dPGf3T1 q5sg== 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=LhomnjUlqNsoFaXjW53m6Qq/8PoE2SUei4fpnPBAfNQ=; b=bsjNnTJaWxuPdVG9/5vorgeM8txoCUmIiibvJgYh9s5x2aO44KPIo2aVYjUrq4QMMV nqqEKvHc9SgRQIKdCmvi1C49dPf8XZdqbmfwWF+bfkXwfbVmG0ilqGNiDPnjPnCw2t2H ELpYsM91Vys0EZbCj/H15d0cZXvvds7fHfzxC7M1VcTrtRKI+CFcHZbN0KDUhHTkZ8oh smOpGeKa3gkWFXmMIruqEo14fTp707qxfcPOOy6Uv/PnWGXMJ2MTbqPybkP888iB+2Vc OegV1TMdw5R/WZAr1gev5tMlJSrk1k0yidGdeou31kwKyZDjd768tWFRGblrsy1LW2Gk xQDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@u92.eu header.s=fm3 header.b=iKG4y+A2; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=IxYvdkPL; 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 b26si872394edn.158.2021.10.13.13.51.13; Wed, 13 Oct 2021 13:51:37 -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=iKG4y+A2; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=IxYvdkPL; 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 S230099AbhJMUvQ (ORCPT + 99 others); Wed, 13 Oct 2021 16:51:16 -0400 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:58705 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230025AbhJMUvM (ORCPT ); Wed, 13 Oct 2021 16:51:12 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id CB875581176; Wed, 13 Oct 2021 16:49:07 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 13 Oct 2021 16:49:07 -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=LhomnjUlqNsoF aXjW53m6Qq/8PoE2SUei4fpnPBAfNQ=; b=iKG4y+A2JqVVm8l28icjhk+M5e4hq LJQggHCk+5NORH5OjIjccbN1vx5rv8MsqOzL+PB7NKpttadlv5XeTS8cqH52C0Bg H9jp1j/hxvvUzWd3Tt8tYb4B89ykM/a1lIwrtrjtsF7E3cxMmOOoJHM9iTjYJ8kN GbnpbFDO72G9j8uU8FSf1ocOBagaQJw8gkNBey6Lpem9j9MbLeNtUlWz/l77gC6F q0354BhzR6/SOCeH3jUY/SSL5tVhBi9ETH+j1MOojhLza7c0HIIWJoa6w0xciioK inQNzqqaTVghoQtJ963logLvtk6dhmV+o7zIwRanoK3mELhwGXlG3GLsQ== 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=LhomnjUlqNsoFaXjW53m6Qq/8PoE2SUei4fpnPBAfNQ=; b=IxYvdkPL SWFoZepDfvqBA3c/3x8UkOogDOaKWjj1MxqM9m7WN6cqsXqyNemMCMelM79zBe3U X2QE4ZUkEVdr9RMUKxyrRGiZF1m2l9ZxueAyyHVDOudNaNxc/tT02AlE98Z2k3xK qrbP5jUhm2yg4DHMJb4X04svrL5OAuluvfwmOsGTxv5elU6TT8lSY4ofEbT4OUFm JfPyA9EO1k291HVETcYzowhRc8Qt1fdz8EC/aFIbMcmUTsU3oOItf7gtLVx+u4dk E9NNT2gjrzFg56tdPW4pVuBHrq/eQ1BTp39AaSQIAOHlT+OnSHtN3+8CHH51UMjL ZHyJPzqweKa3Nw== 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: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 v4 05/20] drm/vmwgfx: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN() Date: Wed, 13 Oct 2021 22:48:31 +0200 Message-Id: <20211013204846.90026-6-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 Reviewed-by: Sean Paul --- drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c | 11 +++++++---- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 12 ++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c index 28af34ab6ed6..7df35c6f1458 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c @@ -28,6 +28,7 @@ #include "vmwgfx_drv.h" #include "vmwgfx_devcaps.h" #include +#include #include "vmwgfx_kms.h" int vmw_getparam_ioctl(struct drm_device *dev, void *data, @@ -172,6 +173,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data, struct drm_vmw_rect __user *clips_ptr; struct drm_vmw_rect *clips = NULL; struct drm_framebuffer *fb; + struct drm_modeset_acquire_ctx ctx; struct vmw_framebuffer *vfb; struct vmw_resource *res; uint32_t num_clips; @@ -203,7 +205,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data, goto out_no_copy; } - drm_modeset_lock_all(dev); + DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); fb = drm_framebuffer_lookup(dev, file_priv, arg->fb_id); if (!fb) { @@ -231,7 +233,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data, out_no_surface: drm_framebuffer_put(fb); out_no_fb: - drm_modeset_unlock_all(dev); + DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); out_no_copy: kfree(clips); out_clips: @@ -250,6 +252,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data, struct drm_vmw_rect __user *clips_ptr; struct drm_vmw_rect *clips = NULL; struct drm_framebuffer *fb; + struct drm_modeset_acquire_ctx ctx; struct vmw_framebuffer *vfb; uint32_t num_clips; int ret; @@ -280,7 +283,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data, goto out_no_copy; } - drm_modeset_lock_all(dev); + DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); fb = drm_framebuffer_lookup(dev, file_priv, arg->fb_id); if (!fb) { @@ -303,7 +306,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data, out_no_ttm_lock: drm_framebuffer_put(fb); out_no_fb: - drm_modeset_unlock_all(dev); + DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); out_no_copy: kfree(clips); out_clips: diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 74fa41909213..268095cb8c84 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -33,6 +33,7 @@ #include #include #include +#include #include "vmwgfx_kms.h" @@ -243,15 +244,17 @@ void vmw_kms_legacy_hotspot_clear(struct vmw_private *dev_priv) struct drm_device *dev = &dev_priv->drm; struct vmw_display_unit *du; struct drm_crtc *crtc; + struct drm_modeset_acquire_ctx ctx; + int ret; - drm_modeset_lock_all(dev); + DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); drm_for_each_crtc(crtc, dev) { du = vmw_crtc_to_du(crtc); du->hotspot_x = 0; du->hotspot_y = 0; } - drm_modeset_unlock_all(dev); + DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); } void vmw_kms_cursor_post_execbuf(struct vmw_private *dev_priv) @@ -1012,9 +1015,10 @@ static int vmw_framebuffer_bo_dirty(struct drm_framebuffer *framebuffer, struct vmw_framebuffer_bo *vfbd = vmw_framebuffer_to_vfbd(framebuffer); struct drm_clip_rect norect; + struct drm_modeset_acquire_ctx ctx; int ret, increment = 1; - drm_modeset_lock_all(&dev_priv->drm); + DRM_MODESET_LOCK_ALL_BEGIN((&dev_priv->drm), ctx, 0, ret); if (!num_clips) { num_clips = 1; @@ -1040,7 +1044,7 @@ static int vmw_framebuffer_bo_dirty(struct drm_framebuffer *framebuffer, vmw_cmd_flush(dev_priv, false); - drm_modeset_unlock_all(&dev_priv->drm); + DRM_MODESET_LOCK_ALL_END((&dev_priv->drm), ctx, ret); return ret; } -- 2.33.0