From patchwork Mon Jan 23 09:53:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9531981 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 57B9360434 for ; Mon, 23 Jan 2017 09:54:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49EC827D4A for ; Mon, 23 Jan 2017 09:54:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E84127F10; Mon, 23 Jan 2017 09:54:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D15A627D4A for ; Mon, 23 Jan 2017 09:54:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 91D556E3EF; Mon, 23 Jan 2017 09:54:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id B75B86E3EF for ; Mon, 23 Jan 2017 09:54:02 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id r144so25138432wme.0 for ; Mon, 23 Jan 2017 01:54:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=kqeKfQHq0InIg9PddCH1vuXET8pd46pNMZCZf0LYyE4=; b=N2efnTxYdVcOwbJYdNpbAgP4oWKdnQ262KE9oMh987JyNdJzR1yKesDX2jO/Pvn2mR CJ4lQWE2hyMfBlPtncfVwaaU8/S7l4H5IqR9u6fPmUi+pgwGztAuw2+pMsw5jOBy+c0S 4EZLxpobp2/9OD7Gq2lY0t/qQ0OFHQkoh1kHBIaFNds9bUmPZoXGaZWczWb/Kj4ahrDB fGupcLjQcUz7WXBVx/nfg6u4vSiCeWR+omJeNDc85U2vQOFG4M7/JgFvY9HKyS7px9FT VovwseOcy9UtzSlmUQmpptAwSr7rCM5SXaPwyY6viOzgA7Df0dP1WBy+RAzLQS+jLr6m +HdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=kqeKfQHq0InIg9PddCH1vuXET8pd46pNMZCZf0LYyE4=; b=LaH6cusmB8C1Or6PJvb1On3q4A630xJKJpLxk5ERG9tgounrBQMafmN98CvcrtR20J Ofbmtt/Yph23OpLMNliexj74kJMoSVLAMmNlfmakxCiMj4W1MSPyjua41FuJCneV41dR i9Us/01MriGAS1UGEPc7V1IkCoInyeYBuofcexBYOepdolc0NPabdH2RhiQ/46EiFxKF 1/KrWUp7WCm+gPip6+eyX0azjjxI1CaQFHhxiHp4AaAn972+zQV7rftnbiUT5xGHIUic qsDEDFZExtzKGvRDwxWpaeB0EV+i0RDEHhtbjwxEJOTVwRpUo64n1JtfOZNt7vdyZ/5r UWcw== X-Gm-Message-State: AIkVDXI2ytb+0A0AKAeKy9icOof1/K8FTrnYK2GsrEVo3RKPMwETT42NhHDBrC8q2xLjkQ== X-Received: by 10.223.155.140 with SMTP id d12mr21922535wrc.143.1485165241146; Mon, 23 Jan 2017 01:54:01 -0800 (PST) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id y97sm20179539wmh.24.2017.01.23.01.54.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jan 2017 01:54:00 -0800 (PST) From: Chris Wilson To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/vgem: Switch to reservation_object_lock() helpers Date: Mon, 23 Jan 2017 09:53:57 +0000 Message-Id: <20170123095357.29514-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 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-Virus-Scanned: ClamAV using ClamSMTP For the convenience of encapsulation the reservation object's ww_mutex was wrapped in pair of lock/unlock helpers. Signed-off-by: Chris Wilson --- drivers/gpu/drm/vgem/vgem_fence.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vgem/vgem_fence.c b/drivers/gpu/drm/vgem/vgem_fence.c index da25dfe7b80e..3109c8308eb5 100644 --- a/drivers/gpu/drm/vgem/vgem_fence.c +++ b/drivers/gpu/drm/vgem/vgem_fence.c @@ -190,12 +190,12 @@ int vgem_fence_attach_ioctl(struct drm_device *dev, /* Expose the fence via the dma-buf */ ret = 0; - ww_mutex_lock(&resv->lock, NULL); + reservation_object_lock(resv, NULL); if (arg->flags & VGEM_FENCE_WRITE) reservation_object_add_excl_fence(resv, fence); else if ((ret = reservation_object_reserve_shared(resv)) == 0) reservation_object_add_shared_fence(resv, fence); - ww_mutex_unlock(&resv->lock); + reservation_object_unlock(resv); /* Record the fence in our idr for later signaling */ if (ret == 0) {