<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/include/linux/dma-fence-unwrap.h, branch docs-fixes</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-fixes</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-fixes'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2025-05-05T17:29:44+00:00</updated>
<entry>
<title>dma-fence: Add helper to sort and deduplicate dma_fence arrays</title>
<updated>2025-05-05T17:29:44+00:00</updated>
<author>
<name>Arvind Yadav</name>
<email>Arvind.Yadav@amd.com</email>
</author>
<published>2025-04-25T14:06:50+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=575ec9b0c2f11f40535ea737ed5a64792780d1ef'/>
<id>urn:sha1:575ec9b0c2f11f40535ea737ed5a64792780d1ef</id>
<content type='text'>
Export a new helper function `dma_fence_dedup_array()` that sorts
an array of dma_fence pointers by context, then deduplicates the array
by retaining only the most recent fence per context.

This utility is useful when merging or optimizing sets of fences where
redundant entries from the same context can be pruned. The operation is
performed in-place and releases references to dropped fences using
dma_fence_put().

v2: - Export this code from dma-fence-unwrap.c(by Christian).
v3: - To split this in a dma_buf patch and amd userq patch(by Sunil).
    - No need to add a new function just re-use existing(by Christian).
v4: - Export dma_fence_dedub_array and use it(by Christian).

Cc: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Cc: Arunpravin Paneer Selvam &lt;Arunpravin.PaneerSelvam@amd.com&gt;
Reviewed-by: Sunil Khatri &lt;sunil.khatri@amd.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Arvind Yadav &lt;Arvind.Yadav@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>dma-buf: revert "return only unsignaled fences in dma_fence_unwrap_for_each v3"</title>
<updated>2022-07-14T12:41:30+00:00</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2022-07-11T14:48:01+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=4fa05a67b558d2cb3acd2bb299b91220d405ca5e'/>
<id>urn:sha1:4fa05a67b558d2cb3acd2bb299b91220d405ca5e</id>
<content type='text'>
This reverts commit 8f61973718485f3e89bc4f408f929048b7b47c83.

It turned out that this is not correct. Especially the sync_file info
IOCTL needs to see even signaled fences to correctly report back their
status to userspace.

Instead add the filter in the merge function again where it makes sense.

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Tested-by: Karolina Drobnik &lt;karolina.drobnik@intel.com&gt;
Reviewed-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220712102849.1562-1-christian.koenig@amd.com
</content>
</entry>
<entry>
<title>dma-buf: generalize dma_fence unwrap &amp; merging v3</title>
<updated>2022-05-30T12:24:04+00:00</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2022-04-25T12:22:12+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=245a4a7b531cffb41233a716497c25b06835cf4b'/>
<id>urn:sha1:245a4a7b531cffb41233a716497c25b06835cf4b</id>
<content type='text'>
Introduce a dma_fence_unwrap_merge() macro which allows to unwrap fences
which potentially can be containers as well and then merge them back
together into a flat dma_fence_array.

v2: rename the function, add some more comments about how the wrapper is
    used, move filtering of signaled fences into the unwrap iterator,
    add complex selftest which covers more cases.
v3: fix signaled fence filtering once more

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220518135844.3338-5-christian.koenig@amd.com
</content>
</entry>
<entry>
<title>dma-buf: return only unsignaled fences in dma_fence_unwrap_for_each v3</title>
<updated>2022-05-30T12:23:21+00:00</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2022-05-04T11:01:29+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=8f61973718485f3e89bc4f408f929048b7b47c83'/>
<id>urn:sha1:8f61973718485f3e89bc4f408f929048b7b47c83</id>
<content type='text'>
dma_fence_chain containers cleanup signaled fences automatically, so
filter those out from arrays as well.

v2: fix missing walk over the array
v3: massively simplify the patch and actually update the description.

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220518135844.3338-4-christian.koenig@amd.com
</content>
</entry>
<entry>
<title>dma-buf: cleanup dma_fence_unwrap implementation</title>
<updated>2022-05-30T12:16:32+00:00</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2022-04-24T14:55:14+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=01357a5a45ed8eb9543183f5c9c6713ae60fc1f3'/>
<id>urn:sha1:01357a5a45ed8eb9543183f5c9c6713ae60fc1f3</id>
<content type='text'>
Move the code from the inline functions into exported functions.

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220518135844.3338-3-christian.koenig@amd.com
</content>
</entry>
<entry>
<title>dma-buf: add dma_fence_unwrap v2</title>
<updated>2022-03-25T13:18:28+00:00</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2022-03-11T09:27:53+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=64a8f92fd783e750cdb81af75942dcd53bbf61bd'/>
<id>urn:sha1:64a8f92fd783e750cdb81af75942dcd53bbf61bd</id>
<content type='text'>
Add a general purpose helper to deep dive into dma_fence_chain/dma_fence_array
structures and iterate over all the fences in them.

This is useful when we need to flatten out all fences in those structures.

v2: some selftests cleanup, improved function naming and documentation

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220311110244.1245-1-christian.koenig@amd.com
</content>
</entry>
</feed>
