From patchwork Fri Feb 17 18:35:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9580533 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 B72E3600C5 for ; Fri, 17 Feb 2017 18:35:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A94C728744 for ; Fri, 17 Feb 2017 18:35:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E2F92874F; Fri, 17 Feb 2017 18:35: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=unavailable 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 6ADED28744 for ; Fri, 17 Feb 2017 18:35:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 759DF6E031; Fri, 17 Feb 2017 18:35:41 +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 424766E031; Fri, 17 Feb 2017 18:35:40 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id v77so3981409wmv.0; Fri, 17 Feb 2017 10:35:40 -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:mime-version :content-transfer-encoding; bh=4oOM4vohGskx5pspQ7TbYL2IVgNi8cE/2uHwOnZXDns=; b=lNNAuRhP55JmeR38g+9Ndj0ED6BUacSsYJa8ljJMl2Lhaf2zws12C24IzVPEcQd5+A tfX0dore/RIqM19zw5LT0XTWpEJuodsqFxPZlEY8qxgI7wienue5UUpuiXmcMOqOzsW4 WODG4SfxgrKElVBPzAK/E35qGUvMgHLG7fx0GVTmKlv09enLnAO2Ap5X8oaOt0v6RgwH F2ePBWN///nlm/C1TkHPJ5gLHco44oyzFaBF6ELY7ncj8VvbMx11YGvAnNFnYby/BqW0 N5IQdupkFdBwjMqP0IRsMH7QikPTpf1y2Dm2nEWoL+X+GUfQV6LflUY55UxXmE1MnN3+ ApBQ== 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 :mime-version:content-transfer-encoding; bh=4oOM4vohGskx5pspQ7TbYL2IVgNi8cE/2uHwOnZXDns=; b=XF5ZvvlXLU+tTK1EsrLKi8T/10ItbPDt4eyVACiTsVsxYigtWdw9H2Hl2K/MNApT5Z 7afYxncTwdfRzJe9TOysbpCUp8gVWIefn9QTL1ebNTbOQONEPsgfY67sXSwfdhg2l7BL H7usBckCZWKMnxGJhUt2LXmU4LHFM+IwIHACy6xy3nVgayjGKbTR+SkbF5ICLhD3JHFa 3co9Jjpd2qiG1EDv8Hdu1YB1qRhVVFndzTXrcycVlToglRPOWW3ajPFqFBO5gIMwizDf 2ShavT5HpJEAzKuK9FBSNblGiA3Ql37Jw6GU8sjoR7wwrexMFNv85mcAJWVGMYTyMKo5 yVPQ== X-Gm-Message-State: AMke39kO2COB37JyDX+mbV47Qn0V3UlSJNkpZRD3xsrtdBHf1laQJjOHIlHugwBS6WBh4Q== X-Received: by 10.28.103.3 with SMTP id b3mr4789163wmc.99.1487356538891; Fri, 17 Feb 2017 10:35:38 -0800 (PST) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id 136sm2630154wms.32.2017.02.17.10.35.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Feb 2017 10:35:38 -0800 (PST) From: Chris Wilson To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] dma-fence: Flag when a fence-array is using signal-on-any Date: Fri, 17 Feb 2017 18:35:35 +0000 Message-Id: <20170217183536.26100-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Cc: Daniel Vetter , =?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 Indicate that the fence array will be signaled on the first completion (signal-on-any mode) as opposed to waiting for all to be signaled. Signed-off-by: Chris Wilson Cc: Sumit Semwal Cc: Gustavo Padovan Cc: Daniel Vetter Cc: "Christian König" Reviewed-by: Christian König --- drivers/dma-buf/dma-fence-array.c | 3 +++ include/linux/dma-fence-array.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/drivers/dma-buf/dma-fence-array.c b/drivers/dma-buf/dma-fence-array.c index 67eb7c8fb88c..8c48402a2daa 100644 --- a/drivers/dma-buf/dma-fence-array.c +++ b/drivers/dma-buf/dma-fence-array.c @@ -137,6 +137,9 @@ struct dma_fence_array *dma_fence_array_create(int num_fences, dma_fence_init(&array->base, &dma_fence_array_ops, &array->lock, context, seqno); + if (num_fences > 1 && signal_on_any) + __set_bit(DMA_FENCE_ARRAY_SIGNAL_ANY, &array->base.flags); + array->num_fences = num_fences; atomic_set(&array->num_pending, signal_on_any ? 1 : num_fences); array->fences = fences; diff --git a/include/linux/dma-fence-array.h b/include/linux/dma-fence-array.h index 5900945f962d..4270d33d05b3 100644 --- a/include/linux/dma-fence-array.h +++ b/include/linux/dma-fence-array.h @@ -49,6 +49,10 @@ struct dma_fence_array { struct dma_fence **fences; }; +enum { + DMA_FENCE_ARRAY_SIGNAL_ANY = DMA_FENCE_FLAG_USER_BITS, +}; + extern const struct dma_fence_ops dma_fence_array_ops; /**