From patchwork Thu Nov 19 16:46:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 7659261 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6C5759FD24 for ; Thu, 19 Nov 2015 16:47:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AA97B2065B for ; Thu, 19 Nov 2015 16:47:32 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id EE2BF20652 for ; Thu, 19 Nov 2015 16:47:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 398E47A17B; Thu, 19 Nov 2015 08:47:21 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5DA397A179 for ; Thu, 19 Nov 2015 08:47:17 -0800 (PST) Received: by wmvv187 with SMTP id v187so34946894wmv.1 for ; Thu, 19 Nov 2015 08:47:16 -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:in-reply-to:references; bh=kEGD+7iG6DuaOCD9+EQYg+qdVm9q7bbgOVL6S7p1V4k=; b=DRw07yKkpvmoZrpuj1Ui9SmpOX72p8vPKIJXkYS1zTe/OGb3LmzGqXTtnECV2f8/JK MRxgytwPANtoH5KzYOSoUEEqGCJCTqcXxt1TLMBnArFMDwKsjGJwxunubJeXNLd9MhrV vYlNCUMHh5+47cnt+8uzRRdwOKW+7ZMJVbI/k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kEGD+7iG6DuaOCD9+EQYg+qdVm9q7bbgOVL6S7p1V4k=; b=kxXO4i6oyNxX/pD4DxraAHvzaDGIMDL9Owv9YQZtSKRON/NAUD2PjzQ5u1sP/+74aR dMnvhWlZjxeeX7V/1mFG8UJEGVZn8SZTFF1V+GkwXbLvE6mUVkW4BWIn+Q0BIcIFzBAv vvIRJJZsbNSrfiZpMzIrvfNFMWLhP/Q37qt0KkNojNF3ITxCwG8qNeCeVGzhRO+oKV0f xOhe6U9WNDdshuulK59gGxSgKhz73CHFkZ2mh0fvrpluuxzwth2U5FdhDSjsppD8+EWo PEN98WXzyxWm6415jIgkOBX0ja2olAAMVW+hXpkqIBB3UCVzwCbBDtH7ju3zK4Zh8PaR +Yxw== X-Gm-Message-State: ALoCoQll0OewffGRsyM6MMs9q9OCDKYiGuuPTxjJUZWunfWIXi/fw+HP+VLmoVR+i3VWOBRo5VuK X-Received: by 10.194.184.81 with SMTP id es17mr10554478wjc.10.1447951636129; Thu, 19 Nov 2015 08:47:16 -0800 (PST) Received: from phenom.ffwll.local (212-51-149-109.fiber7.init7.net. [212.51.149.109]) by smtp.gmail.com with ESMTPSA id cv3sm8695001wjc.20.2015.11.19.08.47.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Nov 2015 08:47:15 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH RESEND 17/20] drm/vgem: Simplify dum_map Date: Thu, 19 Nov 2015 17:46:46 +0100 Message-Id: <1447951610-12622-18-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.5.1 In-Reply-To: <1447951610-12622-1-git-send-email-daniel.vetter@ffwll.ch> References: <1447951610-12622-1-git-send-email-daniel.vetter@ffwll.ch> Cc: Daniel Vetter , Intel Graphics Development , Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The offset manager already checks for existing offsets internally, while holding suitable locks. We can drop this check. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/vgem/vgem_drv.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c index 02ae60c395b7..63026d4324ad 100644 --- a/drivers/gpu/drm/vgem/vgem_drv.c +++ b/drivers/gpu/drm/vgem/vgem_drv.c @@ -208,11 +208,9 @@ int vgem_gem_dumb_map(struct drm_file *file, struct drm_device *dev, goto unlock; } - if (!drm_vma_node_has_offset(&obj->vma_node)) { - ret = drm_gem_create_mmap_offset(obj); - if (ret) - goto unref; - } + ret = drm_gem_create_mmap_offset(obj); + if (ret) + goto unref; BUG_ON(!obj->filp);