From patchwork Wed Dec 12 13:06:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1866161 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id B1DCB4006E for ; Wed, 12 Dec 2012 13:33:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9B3E9E653D for ; Wed, 12 Dec 2012 05:33:48 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com [74.125.83.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 7485EE5EAA for ; Wed, 12 Dec 2012 05:07:34 -0800 (PST) Received: by mail-ee0-f49.google.com with SMTP id c4so424162eek.36 for ; Wed, 12 Dec 2012 05:07:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=8bAMOJhbVUHW+bB1dN+zIQ7Ax5et+ebmIO+BDfPxchE=; b=bs92zC+3Oy5iv1daCE7Hurt65SV3VUbGkhDk3MJKQrKURwF2sF1SmDqZcj1UjqO9q8 dnB/xgNFEa6xuSc5IXtkIifQXHz+5u25T8NXFezrPV2NEfWW2mX853PjDc5drSt0xfqR /hekSj+Dy8mBGQnsFcWXXKLS+FADUtM0IWeNM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=8bAMOJhbVUHW+bB1dN+zIQ7Ax5et+ebmIO+BDfPxchE=; b=HpoMhhm+BuBQ5MH4t7NoiswEeeLxgpJ/7iNY94oBJj/Vl1YuGr0xFWo/KjNbRWlC64 or6iBK7UQZdEuS2H/f7kEDT+a8/g+KSYBDuAYxSUXQDULgF2ozSAuY0lCl5enuxWQnlr V66h+uRMuDUjCgK2xKX2Oa1bwsmRJM0xi254rlExKTjLsUsEHwTPemfRnGbDBU6TGTIz DEU+/Pw56edITypPEpkAC3HAdDJIOTVTJlFabxtGRPQY67Nk1WcSkfuCFy/42qkwXDlR nppv8iNMylaoOP0zFCMIexHjvnnlicBWVcxn3zEO3L47hXc18EZDrMIigFlIJ2+p618o J73g== Received: by 10.14.194.4 with SMTP id l4mr2709423een.42.1355317653394; Wed, 12 Dec 2012 05:07:33 -0800 (PST) Received: from biers.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id r1sm55868541eeo.2.2012.12.12.05.07.32 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Dec 2012 05:07:33 -0800 (PST) From: Daniel Vetter To: DRI Development Date: Wed, 12 Dec 2012 14:06:49 +0100 Message-Id: <1355317637-16742-10-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1355317637-16742-1-git-send-email-daniel.vetter@ffwll.ch> References: <1355317637-16742-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQnu5A991b+Hhq430qkliSDby5IA7sF0RZSwW8khpjhVPdFzF2xqgXl34GNdz3WK42IYuiFe Cc: Nouveau Dev , Intel Graphics Development , Radeon Dev , Daniel Vetter Subject: [Intel-gfx] [PATCH 09/37] drm/vmgfx: use drm_modeset_lock_all X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Ok, this one here is a bit more complicated, but for an RFC I've figured I can be a bit sloppy. So just convert ever mutex_lock call, including the interruptible one. Since other places (e.g. in the execbuf ioctl) take the mode_config.mutex without bothering with interruptible handling, I've figured I should be able to get away with this in a few more places ... Signed-off-by: Daniel Vetter --- drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c index 2f7c08e..13e4371 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c @@ -161,11 +161,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data, goto out_no_copy; } - ret = mutex_lock_interruptible(&dev->mode_config.mutex); - if (unlikely(ret != 0)) { - ret = -ERESTARTSYS; - goto out_no_mode_mutex; - } + drm_modeset_lock_all(dev); obj = drm_mode_object_find(dev, arg->fb_id, DRM_MODE_OBJECT_FB); if (!obj) { @@ -198,8 +194,7 @@ out_no_surface: ttm_read_unlock(&vmaster->lock); out_no_ttm_lock: out_no_fb: - mutex_unlock(&dev->mode_config.mutex); -out_no_mode_mutex: + drm_modeset_unlock_all(dev); out_no_copy: kfree(clips); out_clips: @@ -249,11 +244,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data, goto out_no_copy; } - ret = mutex_lock_interruptible(&dev->mode_config.mutex); - if (unlikely(ret != 0)) { - ret = -ERESTARTSYS; - goto out_no_mode_mutex; - } + drm_modeset_lock_all(dev); obj = drm_mode_object_find(dev, arg->fb_id, DRM_MODE_OBJECT_FB); if (!obj) { @@ -280,8 +271,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data, ttm_read_unlock(&vmaster->lock); out_no_ttm_lock: out_no_fb: - mutex_unlock(&dev->mode_config.mutex); -out_no_mode_mutex: + drm_modeset_unlock_all(dev); out_no_copy: kfree(clips); out_clips: