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: 1866121 Return-Path: X-Original-To: patchwork-dri-devel@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 5CB2F4006E for ; Wed, 12 Dec 2012 13:33:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 34342E6542 for ; Wed, 12 Dec 2012 05:33:02 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ea0-f177.google.com (mail-ea0-f177.google.com [209.85.215.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B710E5D57 for ; Wed, 12 Dec 2012 05:07:34 -0800 (PST) Received: by mail-ea0-f177.google.com with SMTP id c10so219368eaa.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=UqWhkx3m5OgVOgOrK39poJFZlXn+/xzD4xAMpcsiFuOefSggHVzjDOt2mGDeE7ISN5 z/ws7AWV25xUAEYH0QZBuw0VL0ovc0ko8tgKb+NVrjZt5YqGIoK/y2VX4z4RpXN8eANQ NdFZVd3dANRU632a3FRPGHGev3NqgHjeJ4VSwFg39YyP6LG7RbdGZ1WzrDabZgYrxLZk D7Txuh33x5kN7WwnziyqisdWBs+AnxX64NOTXAdUFrNyGJAHf008VHcNB5yrto1SGLDu IK1OVPxAlvWHDStFBUqTBYKW1E6pSe6tAKC64hmBgbRvWH8TBkS9ogC+euu6QKORcP/d dmOA== 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 Subject: [PATCH 09/37] drm/vmgfx: use drm_modeset_lock_all 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: ALoCoQkkGSNsC3NMvLtZ5JQUcWrR4ggGl2HZOTuK3OW3ZjQvkDqv61ZThzNnV8modxwV+953EHTF Cc: Nouveau Dev , Intel Graphics Development , Radeon Dev , Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=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: