From patchwork Fri Feb 24 20:01:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 61434 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1119524wrd; Fri, 24 Feb 2023 12:07:25 -0800 (PST) X-Google-Smtp-Source: AK7set/z9KtNurc7kIALfGK5az1RMlimvRNGTnSUfOgmWeRL3GjTVwPDB6ICje7rmoU3N+f2wBZW X-Received: by 2002:a17:90b:38c7:b0:234:a88e:d67e with SMTP id nn7-20020a17090b38c700b00234a88ed67emr18690348pjb.34.1677269244899; Fri, 24 Feb 2023 12:07:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677269244; cv=none; d=google.com; s=arc-20160816; b=LH3qC4IGoVGKAgLw4gzfEJQx32Yt19+fCNNs/ccp1gB5a6iZtrTHfEqdCJURBvyKpx xk2a4a44qvc0KrP38hqFLAvJD2I8fr99lmY1lIQfbY63xosG2H40orQ9VqxwSTG5vrDH mEvejBXDoNGUmP8NpkvZDzy0kfqaDdnrIt0E8ljDvHIe/FHowP+Oaup5llupyd/miebE yDMSaOaw+pdm/ssi6C3CNNOgQDRcpJj0xOX2eHrEL0mypmsSX3XS+BT2aDwFKOsod+CG m9BMUHrlH+z1/es598soafQziPI2bJneS4gIjuOoE2lYd9CzAF7kh179UmiDyQfPFdD8 +ZNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=l4ehVbwCT75xnP/ECU7XAGaXEnBwLlSeDxhb5qTgwac=; b=fEnh3C+ejgv2VNA7pX+IWlfdqhk7ZfcoEstzE3UnSLVGP/FvWX2qgZkoB9NHS/1ZLl BHCxI6enaVhHhe/iqEQs+/8JBtcR2psw15w0+fjkjQZ/bmokw3xeXDOPtfN0+xYuz+v7 SoKvKtqc6RBzoEjTIJ7MEQ9i72nWLhBR43FXKgmN6fEpUOdE1ofcUP4xacfxVd6XS3U4 BAwjwIX8Nnciv1WALXpQc81UB++bv5BDM1BI8R7ktk/lJ5mRKBY2GDOaNna4Bpdt5cFO n+ycVZbZt3apjOk4R1K6ZYeEuBOPQBOBERRHHjU5St6sGFfxzO6q0OQKJHgLEpWoKSs5 lFKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DXggLen9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t8-20020a17090aba8800b002340f45c0ffsi150224pjr.90.2023.02.24.12.07.11; Fri, 24 Feb 2023 12:07:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DXggLen9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229759AbjBXUCR (ORCPT + 99 others); Fri, 24 Feb 2023 15:02:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229830AbjBXUCI (ORCPT ); Fri, 24 Feb 2023 15:02:08 -0500 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2647760D5E; Fri, 24 Feb 2023 12:02:06 -0800 (PST) Received: by mail-pj1-x102a.google.com with SMTP id q31-20020a17090a17a200b0023750b69614so355830pja.5; Fri, 24 Feb 2023 12:02:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=l4ehVbwCT75xnP/ECU7XAGaXEnBwLlSeDxhb5qTgwac=; b=DXggLen98SswuMy6LWqXGQsVk+Kl+HCfw0GV1eAOFvn+k5vSTK02Ocr5Lbsyxv6vfh G20mSjTIjOf259aIQo9lioVuf2337pFt9wQRSOGi8YqoroNnPJKx2D4Mr0xHfHSxCGT7 akg3hVHnOWkFuSiethSqYeWo7JDzOhnrfIoSCv7bq9Cg9YoLldU3y0kGrbBbMx0pQ+2p 08cG5QwY8KRM5ilt4+qiozXhQ1XkMPB9i3dsYB6XbH95KMc8X6/uhu8+apx8JqhHqY4x 6FZc7CMmgBc7sW4c5ct5na3F6MPDyh0tfN48fiZnvYPLT38xxShI5xvb/D2DWLAmHqBB a37Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l4ehVbwCT75xnP/ECU7XAGaXEnBwLlSeDxhb5qTgwac=; b=Fr21Vkn14CSnmQWfOhtfpxTQw4cakxAXDQSWQQKJN4aI5lmtW690oMQ4c4Au03i2eu 0ZEPgGGdYCbslUrr0uqslk/rfCJeIaoGT8NtSl+US8gRwdJXTiIX3VLd0uydGK/2ZH2r D5wTKxQg+qJoFjw0V9vjEU01UvtsDPDXTDRuuvQGRfujer5Q7BA8dgrp4eqrQlTTJXtG hDlGIIVQY+vR2pUBtxViFCqI3ZlzrHBbVkgWSqLVXdhUAUklsMXudPddMc9+nmPH8f+A fmCofRHW5gDWffKZguBBBkgMiT14GNFcLa/zAbt/8SUuqV9s3SGruTDrcCeZtq/lKwpu DEcg== X-Gm-Message-State: AO0yUKX6CkI8qO3KhA+Auq/Qy8p308gacl6RLxP+Dbx7cfIXskOnabRA rgt6UUTiXY62VtDxKxdoWLA= X-Received: by 2002:a17:90b:33cf:b0:237:b92f:39d1 with SMTP id lk15-20020a17090b33cf00b00237b92f39d1mr644702pjb.0.1677268925626; Fri, 24 Feb 2023 12:02:05 -0800 (PST) Received: from localhost ([2a00:79e1:abd:4a00:61b:48ed:72ab:435b]) by smtp.gmail.com with ESMTPSA id d16-20020a17090abf9000b0023440af7aafsm61128pjs.9.2023.02.24.12.02.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Feb 2023 12:02:05 -0800 (PST) From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: freedreno@lists.freedesktop.org, Daniel Vetter , =?utf-8?q?Christian_K=C3=B6nig?= , =?utf-8?q?Michel_D=C3=A4nzer?= , Tvrtko Ursulin , Rodrigo Vivi , Alex Deucher , Pekka Paalanen , Simon Ser , Luben Tuikov , Rob Clark , =?utf-8?q?Christian_K=C3=B6nig?= , Sumit Semwal , Gustavo Padovan , linux-media@vger.kernel.org (open list:SYNC FILE FRAMEWORK), linaro-mm-sig@lists.linaro.org (moderated list:DMA BUFFER SHARING FRAMEWORK), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v6 03/15] dma-buf/fence-chain: Add fence deadline support Date: Fri, 24 Feb 2023 12:01:31 -0800 Message-Id: <20230224200155.2510320-4-robdclark@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230224200155.2510320-1-robdclark@gmail.com> References: <20230224200155.2510320-1-robdclark@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758744275661308871?= X-GMAIL-MSGID: =?utf-8?q?1758744275661308871?= From: Rob Clark Propagate the deadline to all the fences in the chain. v2: Use dma_fence_chain_contained [Tvrtko] Signed-off-by: Rob Clark Reviewed-by: Christian König for this one. --- drivers/dma-buf/dma-fence-chain.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/dma-buf/dma-fence-chain.c b/drivers/dma-buf/dma-fence-chain.c index a0d920576ba6..9663ba1bb6ac 100644 --- a/drivers/dma-buf/dma-fence-chain.c +++ b/drivers/dma-buf/dma-fence-chain.c @@ -206,6 +206,17 @@ static void dma_fence_chain_release(struct dma_fence *fence) dma_fence_free(fence); } + +static void dma_fence_chain_set_deadline(struct dma_fence *fence, + ktime_t deadline) +{ + dma_fence_chain_for_each(fence, fence) { + struct dma_fence *f = dma_fence_chain_contained(fence); + + dma_fence_set_deadline(f, deadline); + } +} + const struct dma_fence_ops dma_fence_chain_ops = { .use_64bit_seqno = true, .get_driver_name = dma_fence_chain_get_driver_name, @@ -213,6 +224,7 @@ const struct dma_fence_ops dma_fence_chain_ops = { .enable_signaling = dma_fence_chain_enable_signaling, .signaled = dma_fence_chain_signaled, .release = dma_fence_chain_release, + .set_deadline = dma_fence_chain_set_deadline, }; EXPORT_SYMBOL(dma_fence_chain_ops);