From patchwork Thu Nov 26 02:43:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Goins X-Patchwork-Id: 7704181 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2F3C7BF90C for ; Thu, 26 Nov 2015 02:43:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 250C62082B for ; Thu, 26 Nov 2015 02:42:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4299320808 for ; Thu, 26 Nov 2015 02:42:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6E9A66E4EF; Wed, 25 Nov 2015 18:42:54 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from hqemgate14.nvidia.com (hqemgate14.nvidia.com [216.228.121.143]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3CB6E6E838 for ; Wed, 25 Nov 2015 18:42:53 -0800 (PST) Received: from hqnvupgp08.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com id ; Wed, 25 Nov 2015 18:43:03 -0800 Received: from hqemhub03.nvidia.com ([172.20.150.15]) by hqnvupgp08.nvidia.com (PGP Universal service); Wed, 25 Nov 2015 18:40:06 -0800 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Wed, 25 Nov 2015 18:40:06 -0800 Received: from agoins-DiGiTS.nvidia.com (172.20.144.16) by hqemhub03.nvidia.com (172.20.150.15) with Microsoft SMTP Server id 8.3.406.0; Wed, 25 Nov 2015 18:42:52 -0800 From: Alex Goins To: dri-devel@lists.freedesktop.org Subject: [PATCH i915 v8 2/2] i915: wait for fence in prepare_plane_fb Date: Wed, 25 Nov 2015 18:43:39 -0800 Message-ID: <016135f1a7857042fc50ab14b9c0f39541cd67b0.1448505015.git.agoins@nvidia.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: X-NVConfidentiality: public MIME-Version: 1.0 Cc: djkurtz@google.com 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-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 In intel_prepare_plane_fb, if fb is backed by dma-buf, wait for exclusive fence v2: First commit v3: Remove object_name_lock acquire Move wait from intel_atomic_commit() to intel_prepare_plane_fb() v4: Wait only on exclusive fences, interruptible with no timeout v5: Style tweaks to more closely match rest of file v6: Properly handle interrupted waits v7: No change v8: No change Signed-off-by: Alex Goins --- drivers/gpu/drm/i915/intel_display.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 84cccf8..a007a6a 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -13349,6 +13349,17 @@ intel_prepare_plane_fb(struct drm_plane *plane, if (!obj) return 0; + /* For framebuffer backed by dmabuf, wait for fence */ + if (obj->base.dma_buf) { + ret = reservation_object_wait_timeout_rcu(obj->base.dma_buf->resv, + false, true, + MAX_SCHEDULE_TIMEOUT); + if (ret == -ERESTARTSYS) + return ret; + + WARN_ON(ret < 0); + } + mutex_lock(&dev->struct_mutex); if (plane->type == DRM_PLANE_TYPE_CURSOR &&