From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=148.251.105.195 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796219256; b=rkz4xUNxOFUGilgb3rSKKzjvNoZvz73n9YwdD+qYHIdbIrnkySPplqdJT85U0leG3fst n3Nh6HEYAQ5pzZ0TqjUgkX4CNZ7jb7Fp1XV30c2uIdX7SW27sTSbdvWvogGsOczzFy60i NkUkkCiT3ZFSgHhy06PC8ENYPPQ/7uBlIIbuKXkuB1x/7ujz2tv2vs3uEsudyvSFni9BV zzIXZ1jwg7oZ5++L9P1y5v0C8VnVBeUkO61ma66emHewuvu33uSclXwbuJnnoFhtcxuKm 6NJB8WbS84/AeGqlmBI2LNzmovTX0CqaVDNAECebB/pN6jM+NCNL8kgsv++ipYUVuzw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796219256; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:In-Reply-To:References:Organization:X-Mailer:MIME-Version: Content-Type:Content-Transfer-Encoding; bh=CiXhhpeyKjRXCR4wqhB2lm3ygaKsv62MrzJFbL3zCUc=; b=xd42kKGm3f1PAVbW2mObmPKtM8LFnJGeLgnHOUSHuYHAdUgmy8GCYyHSty643gbQr4+o 1RZmbuY7BaESi19j5zC4zql5P9UfqmsMrWqT9/1ralb0NqDK5Lr+pxE9r7icp/HRjBo9T 9W//5pIpVldYOUASsEN2QmZ169hCTYzSmpID1ao/VUgbTcJ0jALatYZhXGguUN6TSJpZf nLprvjl8+wouno3XRUxOEjV/e7e2BNSIauMgJ3z0uWCobnHr6XmxHGvr6UIf+CeN55PSs z9SwRZ/bbXWbRHwItdfP+7d6KOCr5q2DfcDp3e1Tuxd7Oak1JvqSzNCOTav6HAXTk1g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=mail header.b=ezJCj7YG; arc=none smtp.remote-ip=148.251.105.195 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0BE1606A31A; Wed, 2 Dec 2026 13:47:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B0BE1606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=mail header.b=ezJCj7YG DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1796219253; bh=OH2xPEvficnM99tWtKpoVS466piolu/9bEcYK39dDuk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ezJCj7YGoKSG405FjB6i01kTG5VajmUsYwy8H9dWyH02XOb+s7kYe62hJ6Zoa1Mcr Di830QbT4yBB1rQHdhFcPBtvAlFa/7PoJ466SsWs7Cb075rVuJDGCt5uPSangakBiw gePoA+wufpCvdhmYpW8ZH3Kuh+odRlGv7+34tKhN6bhA4VKKEp2xiFw0O0g+kq7z5Y 33CYAx64r4FOwDOWfGSTKKe05el70a4cj0aN8CkQc04MW4zCjVJkC1XJDa2/ClUW3h YFVZpHhnxM4fYTY61vB4XjwfspykY+n4aABb3Zn5De6yfJff9lMkLj4egvxcIS03oA Fhd0eDyv0+Jzw== Received: from fedora1.home (unknown [100.64.0.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by bali.collaboradmins.com (Postfix) with ESMTPSA id EE3E217E079B; Wed, 02 Dec 2026 14:47:32 +0100 (CET) Date: Wed, 2 Dec 2026 14:47:27 +0100 From: Boris Brezillon To: Philipp Stanner Cc: phasta@kernel.org, Steven Price , Liviu Dudau , Akash Goel , Karunika Choo , Lukas Zapolskas , Chris Diamand , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Sumit Semwal , Christian =?UTF-8?B?S8O2bmln?= , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, Xianzhong Li Subject: Re: [PATCH v4 2/3] drm/sched: Add a drm_sched_job_add_dependency_unwrapped() helper Message-ID: <20261202144727.71174d87@fedora1.home> In-Reply-To: <812d4ff157dfab49a019e85b04f609f10cfcbc5d.camel@mailbox.org> References: <20261202-panhtor-dep-skip-v4-0-f84482d7a49c@collabora.com> <20261202-panhtor-dep-skip-v4-2-f84482d7a49c@collabora.com> <812d4ff157dfab49a019e85b04f609f10cfcbc5d.camel@mailbox.org> Organization: Collabora X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-redhat-linux-gnu) X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, 02 Dec 2026 13:53:58 +0100 Philipp Stanner wrote: > On Wed, 2026-12-02 at 12:34 +0100, Boris Brezillon wrote: > > =20 >=20 > [=E2=80=A6] >=20 > > +/** > > + * drm_sched_job_add_dependency_unwrapped - unwrap the fence (if this = is a > > + * container) and add the resulting fences as job dependencies > > + * @job: scheduler job to add the dependencies to > > + * @fence: the dma_fence to add to the list of dependencies. =20 >=20 > Not entirely true, this is the container containing the dependencies, > not the actual dependency. Right? It can be both: if it's a container fence, it's what you say, but if it's a singular fence, the fence is added directly to the XArray. It's a bit hard to express that in a short sentence, unfortunately... >=20 > Maybe just call it "dependencies" or "deps" and below "fence" then > singular, "dep"? Well, the fact it can be both a singular fence or a container makes me think we should keep the naming vague enough to apply to both. When you think about it, it is a single dependency we get passed. We just extract non-container fences out of it when we're being passed a container, and add the resulting fences get added the dep list. >=20 > > + * > > + * Note that @fence is consumed in both the success and error cases. > > + * > > + * Returns: =20 >=20 > same nit, "Return: " Will fix. >=20 > > + * 0 on success, or an error on failing to expand the array. > > + */ > > +int drm_sched_job_add_dependency_unwrapped(struct drm_sched_job *job, > > + =C2=A0=C2=A0 struct dma_fence *fence) > > +{ > > + struct dma_fence *inner_fence; > > + int ret; > > + > > + dma_fence_unwrap_for_each(inner_fence, fence) { > > + ret =3D drm_sched_job_add_dependency(job, dma_fence_get(inner_fence)= ); > > + if (ret) > > + break; > > + } > > + > > + dma_fence_put(fence); > > + return ret; > > +} > > +EXPORT_SYMBOL(drm_sched_job_add_dependency_unwrapped); =20 >=20 >=20 > But makes sense to me. >=20 > With the docu: >=20 > Reviewed-by: Philipp Stanner Thanks for the review. Boris