From patchwork Thu Aug 11 14:46:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9275375 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 A951560231 for ; Thu, 11 Aug 2016 14:46:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B320286C8 for ; Thu, 11 Aug 2016 14:46:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8FF5A286CB; Thu, 11 Aug 2016 14:46:44 +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 23397286C8 for ; Thu, 11 Aug 2016 14:46:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 27E136E928; Thu, 11 Aug 2016 14:46:43 +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 2F9E56E920 for ; Thu, 11 Aug 2016 14:46:41 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id i5so225575wmg.2 for ; Thu, 11 Aug 2016 07:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=M9/yTDGwPIlROoZRTW1fZm8lsb5tg/dLBE7pj6/7Fkc=; b=iNRa3dnNSWtpKAPTWqBvLWfdli3OQIKetzWKOJSyM1vqn6XIafRHNpdw4VjQBdl059 vUmLDUDDCYEnDK38sj1YjjqrrcYrD5pALnQCJPSmhoKXjZQ//89D64fTqhXMNs6W8wn1 1VnB7MxuEJV+IheIA7A9ehsadm08b4sIwUcrWy86AJViSgO2rv2WMfAnVr0eWNuTYv5Y hYYKAyRRWJw1e7jNRhfAoeS2tTnFRIzbj69wVf/XIgMYpRfjfZaMaXKbrt638Nf6Z5aR LpzZSrYJ/y7LnNICeQyewWH6rhI6TtT+t38AHiSbPfpmPXFt4LnVOYLwbGBZZcVm6gbY g/rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=M9/yTDGwPIlROoZRTW1fZm8lsb5tg/dLBE7pj6/7Fkc=; b=NnhCL1+ptWoOqo9jY1A8tyAzWqTLDF+7hQqQez43xDL3vYyjcUDxitrjmX+tsTiSOd y9WEz2KI583uhNV5Sawytn3Ih4U2v5M09jldhGWuGBr/fXPcuDyFkrnHpnWRt9vSxQ37 fj4vgHrxxCaCvyzMGiyTRjZjZXerV03CnVJHwNIugyOlIQF9ha6qlG3gCJvfvrpff8YK pg2GXCydcAOdjLpzsuRR8tnNKbzBdJnm/0l9RCnh3ZYLlEQVhantgEIKkjKu2suPB2TW RNNITeegFOu9EO0lvu59hT2px7LKOBWUu4uikXgrb5zcSXxDsZzWmxrRKvU8HQKSL/OY UvDQ== X-Gm-Message-State: AEkoouvXVfrH2hKf0bs0u2id2/hOyh2WzSpTERlaaGRCcBgQH76oyj6MACO+abYu1oxXDQ== X-Received: by 10.28.98.135 with SMTP id w129mr9260754wmb.38.1470926799811; Thu, 11 Aug 2016 07:46:39 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id jq5sm3038161wjc.20.2016.08.11.07.46.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Aug 2016 07:46:38 -0700 (PDT) From: Chris Wilson To: dri-devel@lists.freedesktop.org Subject: [PATCH 5/5] drm/vmwgfx: Remove call to reservation_object_test_signaled_rcu before wait Date: Thu, 11 Aug 2016 15:46:22 +0100 Message-Id: <1470926782-22250-5-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1470926782-22250-1-git-send-email-chris@chris-wilson.co.uk> References: <1470926782-22250-1-git-send-email-chris@chris-wilson.co.uk> Cc: Thomas Hellstrom 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 Since fence_wait_timeout_reservation_object_wait_timeout_rcu() with a timeout of 0 becomes reservation_object_test_signaled_rcu(), we do not need to handle such conversion in the caller. The only challenge are those callers that wish to differentiate the error code between the nonblocking busy check and potentially blocking wait. Signed-off-by: Chris Wilson Cc: Sinclair Yeh Cc: Thomas Hellstrom Reviewed-by: Sinclair Yeh --- drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c index 6a328d507a28..afda2a57a094 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c @@ -574,10 +574,8 @@ static int vmw_user_dmabuf_synccpu_grab(struct vmw_user_dma_buffer *user_bo, bool nonblock = !!(flags & drm_vmw_synccpu_dontblock); long lret; - if (nonblock) - return reservation_object_test_signaled_rcu(bo->resv, true) ? 0 : -EBUSY; - - lret = reservation_object_wait_timeout_rcu(bo->resv, true, true, MAX_SCHEDULE_TIMEOUT); + lret = reservation_object_wait_timeout_rcu(bo->resv, true, true, + nonblock ? 0 :MAX_SCHEDULE_TIMEOUT); if (!lret) return -EBUSY; else if (lret < 0)