Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 423A1C64EC7 for ; Wed, 22 Feb 2023 15:55:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232685AbjBVPz0 (ORCPT ); Wed, 22 Feb 2023 10:55:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232676AbjBVPzX (ORCPT ); Wed, 22 Feb 2023 10:55:23 -0500 Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51C9C3B3F2; Wed, 22 Feb 2023 07:55:21 -0800 (PST) Received: by mail-qk1-x732.google.com with SMTP id u15so171705qkk.4; Wed, 22 Feb 2023 07:55:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=saj3BiOUv8TiUw3L7YFkO0PUJ/tXd3q9uJ49ovUM8sE=; b=CmKTWrxIKlz7AVFTXvHeSdE538LnVJ9hef0GchgKdtiu3KSU5PthdxEke4Yza0DhE6 LCBRXHANN/uH3a9sa84d8Hj+Xk889MqBHP8ndvBbpdcB7thMY3GlA/lZqBWBWzaPmJo0 Fjqk/rLzUY6L0Gbpy7U23GyqH93ATd4ZU0h3YBmZWObkCvdslWOFysVsCff7lnpsHdAx 2WoOdn9Ejdl9VtyN0vLkuswbYdc8A4LlgL3dew+fnwt+ulzkzVYP6FDAPOqs21buZT7J PC+UPBwXTzRtfw9ZmtdSaAYqGUK6Yv6f82h26Ir76Juc1Pcs5jdTYdMwiA9isr9nHmIi 0fGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=saj3BiOUv8TiUw3L7YFkO0PUJ/tXd3q9uJ49ovUM8sE=; b=z7sfHwTX9udi6PLpF8+Y0ZQ4XwmcVyAr+aVPqVqzHmtG2KMRTCzwI+yP0520O0Agx/ VMOoXEisy9iYAaDVAoxpb/bI2Khii9dEoqHLcFcNQYa8RxeGnUXFSdShq7PWz4RlPXaP msfR/1A2gVRivV82g98rL1dAouueePwKFshzeY0EBP+0sFNZuEh5AEkRFZwZeoUfpsSV e5R3/6sl9SUufvsoNsWgxG+QpaodkJ/C/TTucMeEuK85t1qrky7n0txCIOAMyIxfZMcm 7Nb3ceyTQek6AEjDxR3y+jMuGfNPxdcdYXznlkDZQ8LNJm2H37gCd9cKTBgGyrJafbiK 3Ltg== X-Gm-Message-State: AO0yUKUK6ytQOG08UMzPNjZSrqO4GIpnJRbnOwLH2OFurvbX0RzSg3Sd PcAISqhvh04+TLMs6qtz2eJUgW7r9I19kqgud9Q= X-Google-Smtp-Source: AK7set8bf6lP1s6ypm6jnpmXdn70rTkn5YmDMmCpMTW3NxWzHOTkop5Jow8BwPhs9IsE+pN9We1E32jaWMhSMe6NUHQ= X-Received: by 2002:a05:620a:831a:b0:742:3e52:f855 with SMTP id pa26-20020a05620a831a00b007423e52f855mr53039qkn.2.1677081320370; Wed, 22 Feb 2023 07:55:20 -0800 (PST) MIME-Version: 1.0 References: <20230218211608.1630586-1-robdclark@gmail.com> <20230218211608.1630586-4-robdclark@gmail.com> In-Reply-To: From: Rob Clark Date: Wed, 22 Feb 2023 07:55:08 -0800 Message-ID: Subject: Re: [PATCH v4 03/14] dma-buf/fence-chain: Add fence deadline support To: Tvrtko Ursulin Cc: dri-devel@lists.freedesktop.org, Rob Clark , Gustavo Padovan , Tvrtko Ursulin , =?UTF-8?Q?Christian_K=C3=B6nig?= , =?UTF-8?Q?Michel_D=C3=A4nzer?= , open list , Sumit Semwal , "moderated list:DMA BUFFER SHARING FRAMEWORK" , Pekka Paalanen , Rodrigo Vivi , Alex Deucher , freedreno@lists.freedesktop.org, =?UTF-8?Q?Christian_K=C3=B6nig?= , "open list:SYNC FILE FRAMEWORK" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 22, 2023 at 2:27 AM Tvrtko Ursulin wrote: > > > On 18/02/2023 21:15, Rob Clark wrote: > > From: Rob Clark > > > > Propagate the deadline to all the fences in the chain. > > > > Signed-off-by: Rob Clark > > Reviewed-by: Christian K=C3=B6nig for this o= ne. > > --- > > drivers/dma-buf/dma-fence-chain.c | 13 +++++++++++++ > > 1 file changed, 13 insertions(+) > > > > diff --git a/drivers/dma-buf/dma-fence-chain.c b/drivers/dma-buf/dma-fe= nce-chain.c > > index a0d920576ba6..4684874af612 100644 > > --- a/drivers/dma-buf/dma-fence-chain.c > > +++ b/drivers/dma-buf/dma-fence-chain.c > > @@ -206,6 +206,18 @@ static void dma_fence_chain_release(struct dma_fen= ce *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_chain *chain =3D to_dma_fence_chain(fenc= e); > > + struct dma_fence *f =3D chain ? chain->fence : fence; > > Low level comment - above two lines could be replaced with: > > struct dma_fence *f =3D dma_fence_chain_contained(fence); > > Although to be fair I am not sure that wouldn't be making it less > readable. From the point of view that fence might not be a chain, so > dma_fence_chain_contained() reads a bit dodgy as an API. It does seem to be the canonical way to do it since 18f5fad275ef ("dma-buf: add dma_fence_chain_contained helper").. looks like I missed that when I rebased. I guess for consistency it's best that I use the helper. BR, -R > Regards, > > Tvrtko > > > + > > + dma_fence_set_deadline(f, deadline); > > + } > > +} > > + > > const struct dma_fence_ops dma_fence_chain_ops =3D { > > .use_64bit_seqno =3D true, > > .get_driver_name =3D dma_fence_chain_get_driver_name, > > @@ -213,6 +225,7 @@ const struct dma_fence_ops dma_fence_chain_ops =3D = { > > .enable_signaling =3D dma_fence_chain_enable_signaling, > > .signaled =3D dma_fence_chain_signaled, > > .release =3D dma_fence_chain_release, > > + .set_deadline =3D dma_fence_chain_set_deadline, > > }; > > EXPORT_SYMBOL(dma_fence_chain_ops); > >