From patchwork Mon Aug 29 07:08:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9303141 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 59AB4601C0 for ; Mon, 29 Aug 2016 07:08:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E90D28813 for ; Mon, 29 Aug 2016 07:08:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 429F328816; Mon, 29 Aug 2016 07:08:49 +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 CB22F28813 for ; Mon, 29 Aug 2016 07:08:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4D2866E2DA; Mon, 29 Aug 2016 07:08:45 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0C9626E017; Mon, 29 Aug 2016 07:08:44 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id i138so8194542wmf.3; Mon, 29 Aug 2016 00:08:43 -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:mime-version :content-transfer-encoding; bh=exbQiBuIA/uU4/KzKQ9NYRwYLZ9plpvyP+dEPWk2kRE=; b=p2lBdrY5p4o1ae4VzXHRZzrgivbcZQFqlTP8+3y+S/RTui+qtKFAmj6sgEeZzn8yK4 u2Tkirs4fwgyTdh8F+y25oaiBB294wRdxqyiEy05D5VWA5yiheXQv23oaGEQJbAgsTQj uQXPCT+O+uuWDbHXsU9oVkGulGR5FC4arCC+dv84xaG5wyU3pXNCFIIEz8oLmkKIZqR7 nDi48KJEf0wONZL+U3qZ2xeywHFTc66tMwH0aQe1PUvRWYBm8uqp4JYjf8axN7t9eNQC Fa+eqkRqdcbKL2Y8/OwnvC6fHvWVzqbi0rOKDrTYCsH1tRQf5j46T9+js0q6VD4ptx8A PGCg== 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 :mime-version:content-transfer-encoding; bh=exbQiBuIA/uU4/KzKQ9NYRwYLZ9plpvyP+dEPWk2kRE=; b=Lxd8MufY0XuTZK60MiPhxGI9G3WGLRH/ifT/1eeL9ZdCg1IXU2DmOXDsXxihAOYxOl ID0MOazA7W4QZJ+LyiNoRymKH/rime/wXfrp4emeAy0Nl9fzFM4SlNhO28bjfdAw91W1 +cuBDUYqgWrcZ31zIz9OQDRk0yKEs5/uR2mdTUQZxnUt1UAwkhoS5vnCcVC/sqdd53VQ 5hePV3MMRo81YvbS+q/gc5hcmRKc4zH7m5WzFYiTEtwu568rz+5gchXEUznPJIkInP86 dW3WouCcYocej1rOV5EYizv0GWlbgD8fKoeiW+IZpCnnkygRLdbdwXF0n6Q1+FTh0Ach zhQw== X-Gm-Message-State: AE9vXwNfDeiU3JTlRQwp4UtYK2jU6F2AVaRNWJtCP3VNcbtHMoNNFf9ijTOQYjve98D2Aw== X-Received: by 10.28.128.207 with SMTP id b198mr8664928wmd.56.1472454522484; Mon, 29 Aug 2016 00:08:42 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id v203sm11954826wmv.2.2016.08.29.00.08.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Aug 2016 00:08:41 -0700 (PDT) From: Chris Wilson To: dri-devel@lists.freedesktop.org Subject: [PATCH 01/11] drm/amdgpu: Remove call to reservation_object_test_signaled_rcu before wait Date: Mon, 29 Aug 2016 08:08:24 +0100 Message-Id: <20160829070834.22296-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 Cc: Alex Deucher , intel-gfx@lists.freedesktop.org, =?UTF-8?q?Christian=20K=C3=B6nig?= 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: , 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: Alex Deucher Cc: Christian König Reviewed-by: Daniel Vetter --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index 88fbed2389c0..a3e6f883ac2c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c @@ -407,10 +407,8 @@ int amdgpu_gem_wait_idle_ioctl(struct drm_device *dev, void *data, return -ENOENT; } robj = gem_to_amdgpu_bo(gobj); - if (timeout == 0) - ret = reservation_object_test_signaled_rcu(robj->tbo.resv, true); - else - ret = reservation_object_wait_timeout_rcu(robj->tbo.resv, true, true, timeout); + ret = reservation_object_wait_timeout_rcu(robj->tbo.resv, true, true, + timeout); /* ret == 0 means not signaled, * ret > 0 means signaled