Centos-kernel-stream-9/drivers/dma-buf/sync_debug.c

191 lines
4.6 KiB
C
Raw Permalink Normal View History

// SPDX-License-Identifier: GPL-2.0-only
/*
* Sync File validation framework and debug information
*
* Copyright (C) 2012 Google, Inc.
*/
#include <linux/debugfs.h>
#include "sync_debug.h"
static struct dentry *dbgfs;
static LIST_HEAD(sync_timeline_list_head);
static DEFINE_SPINLOCK(sync_timeline_list_lock);
static LIST_HEAD(sync_file_list_head);
static DEFINE_SPINLOCK(sync_file_list_lock);
void sync_timeline_debug_add(struct sync_timeline *obj)
{
unsigned long flags;
spin_lock_irqsave(&sync_timeline_list_lock, flags);
list_add_tail(&obj->sync_timeline_list, &sync_timeline_list_head);
spin_unlock_irqrestore(&sync_timeline_list_lock, flags);
}
void sync_timeline_debug_remove(struct sync_timeline *obj)
{
unsigned long flags;
spin_lock_irqsave(&sync_timeline_list_lock, flags);
list_del(&obj->sync_timeline_list);
spin_unlock_irqrestore(&sync_timeline_list_lock, flags);
}
void sync_file_debug_add(struct sync_file *sync_file)
{
unsigned long flags;
spin_lock_irqsave(&sync_file_list_lock, flags);
list_add_tail(&sync_file->sync_file_list, &sync_file_list_head);
spin_unlock_irqrestore(&sync_file_list_lock, flags);
}
void sync_file_debug_remove(struct sync_file *sync_file)
{
unsigned long flags;
spin_lock_irqsave(&sync_file_list_lock, flags);
list_del(&sync_file->sync_file_list);
spin_unlock_irqrestore(&sync_file_list_lock, flags);
}
static const char *sync_status_str(int status)
{
if (status < 0)
return "error";
if (status > 0)
return "signaled";
return "active";
}
dma-buf: Rename struct fence to dma_fence I plan to usurp the short name of struct fence for a core kernel struct, and so I need to rename the specialised fence/timeline for DMA operations to make room. A consensus was reached in https://lists.freedesktop.org/archives/dri-devel/2016-July/113083.html that making clear this fence applies to DMA operations was a good thing. Since then the patch has grown a bit as usage increases, so hopefully it remains a good thing! (v2...: rebase, rerun spatch) v3: Compile on msm, spotted a manual fixup that I broke. v4: Try again for msm, sorry Daniel coccinelle script: @@ @@ - struct fence + struct dma_fence @@ @@ - struct fence_ops + struct dma_fence_ops @@ @@ - struct fence_cb + struct dma_fence_cb @@ @@ - struct fence_array + struct dma_fence_array @@ @@ - enum fence_flag_bits + enum dma_fence_flag_bits @@ @@ ( - fence_init + dma_fence_init | - fence_release + dma_fence_release | - fence_free + dma_fence_free | - fence_get + dma_fence_get | - fence_get_rcu + dma_fence_get_rcu | - fence_put + dma_fence_put | - fence_signal + dma_fence_signal | - fence_signal_locked + dma_fence_signal_locked | - fence_default_wait + dma_fence_default_wait | - fence_add_callback + dma_fence_add_callback | - fence_remove_callback + dma_fence_remove_callback | - fence_enable_sw_signaling + dma_fence_enable_sw_signaling | - fence_is_signaled_locked + dma_fence_is_signaled_locked | - fence_is_signaled + dma_fence_is_signaled | - fence_is_later + dma_fence_is_later | - fence_later + dma_fence_later | - fence_wait_timeout + dma_fence_wait_timeout | - fence_wait_any_timeout + dma_fence_wait_any_timeout | - fence_wait + dma_fence_wait | - fence_context_alloc + dma_fence_context_alloc | - fence_array_create + dma_fence_array_create | - to_fence_array + to_dma_fence_array | - fence_is_array + dma_fence_is_array | - trace_fence_emit + trace_dma_fence_emit | - FENCE_TRACE + DMA_FENCE_TRACE | - FENCE_WARN + DMA_FENCE_WARN | - FENCE_ERR + DMA_FENCE_ERR ) ( ... ) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Acked-by: Sumit Semwal <sumit.semwal@linaro.org> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20161025120045.28839-1-chris@chris-wilson.co.uk
2016-10-25 12:00:45 +00:00
static void sync_print_fence(struct seq_file *s,
struct dma_fence *fence, bool show)
{
dma-buf: Rename struct fence to dma_fence I plan to usurp the short name of struct fence for a core kernel struct, and so I need to rename the specialised fence/timeline for DMA operations to make room. A consensus was reached in https://lists.freedesktop.org/archives/dri-devel/2016-July/113083.html that making clear this fence applies to DMA operations was a good thing. Since then the patch has grown a bit as usage increases, so hopefully it remains a good thing! (v2...: rebase, rerun spatch) v3: Compile on msm, spotted a manual fixup that I broke. v4: Try again for msm, sorry Daniel coccinelle script: @@ @@ - struct fence + struct dma_fence @@ @@ - struct fence_ops + struct dma_fence_ops @@ @@ - struct fence_cb + struct dma_fence_cb @@ @@ - struct fence_array + struct dma_fence_array @@ @@ - enum fence_flag_bits + enum dma_fence_flag_bits @@ @@ ( - fence_init + dma_fence_init | - fence_release + dma_fence_release | - fence_free + dma_fence_free | - fence_get + dma_fence_get | - fence_get_rcu + dma_fence_get_rcu | - fence_put + dma_fence_put | - fence_signal + dma_fence_signal | - fence_signal_locked + dma_fence_signal_locked | - fence_default_wait + dma_fence_default_wait | - fence_add_callback + dma_fence_add_callback | - fence_remove_callback + dma_fence_remove_callback | - fence_enable_sw_signaling + dma_fence_enable_sw_signaling | - fence_is_signaled_locked + dma_fence_is_signaled_locked | - fence_is_signaled + dma_fence_is_signaled | - fence_is_later + dma_fence_is_later | - fence_later + dma_fence_later | - fence_wait_timeout + dma_fence_wait_timeout | - fence_wait_any_timeout + dma_fence_wait_any_timeout | - fence_wait + dma_fence_wait | - fence_context_alloc + dma_fence_context_alloc | - fence_array_create + dma_fence_array_create | - to_fence_array + to_dma_fence_array | - fence_is_array + dma_fence_is_array | - trace_fence_emit + trace_dma_fence_emit | - FENCE_TRACE + DMA_FENCE_TRACE | - FENCE_WARN + DMA_FENCE_WARN | - FENCE_ERR + DMA_FENCE_ERR ) ( ... ) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Acked-by: Sumit Semwal <sumit.semwal@linaro.org> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20161025120045.28839-1-chris@chris-wilson.co.uk
2016-10-25 12:00:45 +00:00
struct sync_timeline *parent = dma_fence_parent(fence);
int status;
status = dma_fence_get_status_locked(fence);
seq_printf(s, " %s%sfence %s",
show ? parent->name : "",
show ? "_" : "",
sync_status_str(status));
dma-buf/fence: Avoid use of uninitialised timestamp [ 236.821534] WARNING: kmemcheck: Caught 64-bit read from uninitialized memory (ffff8802538683d0) [ 236.828642] 420000001e7f0000000000000000000000080000000000000000000000000000 [ 236.839543] i i i i u u u u i i i i i i i i u u u u u u u u u u u u u u u u [ 236.850420] ^ [ 236.854123] RIP: 0010:[<ffffffff81396f07>] [<ffffffff81396f07>] fence_signal+0x17/0xd0 [ 236.861313] RSP: 0018:ffff88024acd7ba0 EFLAGS: 00010282 [ 236.865027] RAX: ffffffff812f6a90 RBX: ffff8802527ca800 RCX: ffff880252cb30e0 [ 236.868801] RDX: ffff88024ac5d918 RSI: ffff880252f780e0 RDI: ffff880253868380 [ 236.872579] RBP: ffff88024acd7bc0 R08: ffff88024acd7be0 R09: 0000000000000000 [ 236.876407] R10: 0000000000000000 R11: 0000000000000000 R12: ffff880253868380 [ 236.880185] R13: ffff8802538684d0 R14: ffff880253868380 R15: ffff88024cd48e00 [ 236.883983] FS: 00007f1646d1a740(0000) GS:ffff88025d000000(0000) knlGS:0000000000000000 [ 236.890959] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 236.894702] CR2: ffff880251360318 CR3: 000000024ad21000 CR4: 00000000001406f0 [ 236.898481] [<ffffffff8130d1ad>] i915_gem_request_retire+0x1cd/0x230 [ 236.902439] [<ffffffff8130e2b3>] i915_gem_request_alloc+0xa3/0x2f0 [ 236.906435] [<ffffffff812fb1bd>] i915_gem_do_execbuffer.isra.41+0xb6d/0x18b0 [ 236.910434] [<ffffffff812fc265>] i915_gem_execbuffer2+0x95/0x1e0 [ 236.914390] [<ffffffff812ad625>] drm_ioctl+0x1e5/0x460 [ 236.918275] [<ffffffff8110d4cf>] do_vfs_ioctl+0x8f/0x5c0 [ 236.922168] [<ffffffff8110da3c>] SyS_ioctl+0x3c/0x70 [ 236.926090] [<ffffffff814b7a5f>] entry_SYSCALL_64_fastpath+0x17/0x93 [ 236.930045] [<ffffffffffffffff>] 0xffffffffffffffff We only set the timestamp before we mark the fence as signaled. It is done before to avoid observers having a window in which they may see the fence as complete but no timestamp. Having it does incur a potential for the timestamp to be written twice, and even for it to be corrupted if the u64 write is not atomic. Instead use a new bit to record the presence of the timestamp, and teach the readers to wait until it is set if the fence is complete. There still remains a race where the timestamp for the signaled fence may be shown before the fence is reported as signaled, but that's a pre-existing error. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: Gustavo Padovan <gustavo@padovan.org> Cc: Daniel Vetter <daniel.vetter@intel.com> Reported-by: Rafael Antognolli <rafael.antognolli@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170214124001.1930-1-chris@chris-wilson.co.uk
2017-02-14 12:40:01 +00:00
if (test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags)) {
struct timespec64 ts64 =
ktime_to_timespec64(fence->timestamp);
seq_printf(s, "@%lld.%09ld", (s64)ts64.tv_sec, ts64.tv_nsec);
}
if (fence->ops->timeline_value_str &&
fence->ops->fence_value_str) {
char value[64];
bool success;
fence->ops->fence_value_str(fence, value, sizeof(value));
success = strlen(value);
if (success) {
seq_printf(s, ": %s", value);
fence->ops->timeline_value_str(fence, value,
sizeof(value));
if (strlen(value))
seq_printf(s, " / %s", value);
}
}
seq_putc(s, '\n');
}
static void sync_print_obj(struct seq_file *s, struct sync_timeline *obj)
{
struct list_head *pos;
seq_printf(s, "%s: %d\n", obj->name, obj->value);
Merge DRM changes from upstream v6.9..v6.9.11 NOTE: This commit does not compile due to missing RHEL-specific fix-ups, which are split out into separate Git commits following this one. If git bisect selected this commit, run "git bisect skip" and try again. Repeat this until it selects a commit which compiles. This commit was generated using: rhdrm-merge-drm v6.9.11 RHEL-24103 JIRA: https://issues.redhat.com/browse/RHEL-24103 Conflicts: drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Conflict resolution: Commit list: commit 308de6be0c9c7ba36915c0d398e771725c0ea911 commit 9ea499a97b0a9c459bc1cc83f673ed8acda1cf11 commit ceb79a4368b02a7f4da79e7224acffe7dc3eb15c commit c93d80cea0b3596c979fdd6358646fe824efd882 commit 68160442dce98f32bfdf82ae52d36998852038f9 commit 9386206d4c229a7c48708d929271eab477afd08c commit 7226ddf3311c5e5a7726ad7d4e7b079bb3cfbb29 commit 6a9cffd96c4a6178d443447cd1447c12d7cbe157 commit a8e01256c5be7ce08bfe787852103960c44111bd commit 6127ea0302e9186a85fce121de6084a8fdf9d043 commit 4e8de27007ad5f95c517d0a5f1bcdbb575a3af7e commit 47889711da20be9b43e1e136e5cb68df37cbcc79 commit ccf8dc41b8d7e5dfbce693919c95e00c79211567 commit 4f9faca2f2d5f9cdb50817c58e33c86276b87c32 commit 69bc77fef6add11f42eb62bde7ad189e01e0ba70 commit a86321bfe52b2c19a29acaaea1ee84dadd3388fe commit 72ca4171142f7e3d8c838da865099de7218eb133 commit a073e011bd174987bd715843be81a13ee5b66382 commit 3673f70f6a16ee6d896dbc7b7d246b7b3ce42f96 commit 48de4f92a44c20f645bbbe15e7af0d3710de2693 commit d8285fea0656f221bcea0c551d98094117126f59 commit 88fcce7c31e6c1d99a2a3b2bd9c0aeade0dd41c3 commit 8971b2da4b6cea1a533a1b77d647f739a85e4c63 commit 3092ef7774535d6b5df4bdc4313ab5dc1ebcd58a commit 9a4a5d7b513c596749ee6ec4eebba78a53fa2bdc commit b9cbe1c8911e754af6f84dd7dd47e248d8ba7a53 commit 850f4a965229f226e687efc2efd776da1e97492b commit 6175e4442e8c620ced69167fab003e7ff55303bd commit f1b6a016dfa45cedc080d36fa5d6f22237d80e8b commit 6ad1ffb66846bfbdb93a127204b0bb5b1be02331 commit ca5ad9c231c2fc69526d25436ba592633d7db1e4 commit 289a10b47fe5d17a81c9ee69994110d3ccfb5495 commit 8a283cdfc8beeb14024387a925247b563d614e1e commit 492990552be6df3580c5be178dcbfa4c2204219c commit 4e85c324b3f21a5205f5dd4d85c2023d7d4f1282 commit 2803bc08b0f1933f4c41b922c919290865654b3e commit 92deed4a9bfd9ef187764225bba530116c49e15c commit 00a43f84101a37a8f220a09daafc1c6216b9b348 commit e9250578ac6278dfd24a57c326eb805b3bdb0e31 commit 869f31cfb1341f178d2e27b3ed5172d773729d5d commit 6d3934a09d6d266c2b6e5a24d8b4b437dd6f12c6 commit 9938a1715cd8614af3bbf2442594867a0bd8eb3c commit c7ca42116e7931754df6d40cb0860f8995104274 commit 7a5bc0f266e78476f04583c25c9ab7b6785a53ae commit 42547ec5f0c6b8d0c995078cd805736fcdf51dfb commit ce5a22d22db691d14516c3b8fdbf69139eb2ea8f commit 0964c84b93db7fbf74f357c1e20957850e092db3 commit 6b84900ebb91ef0945fd9969d1620ea66c4779ba commit 309f1a7ffa4e2db309af1db4c968327faf6e89f3 commit 438c129ef72a76330c07d8a8c684d1cd78c74851 commit 40ee4866d25f69b0428e24a8f5d35e64d407f5d3 commit 46579f06206d877b076b6835244fd36c97db82e1 commit 5f34ee20e9b96a01c5e73fa0c99c25d92245ef3c commit 059b58ef6a7584e2679b06a6889584dcefc375fb commit 0ae1868e9e140c6bf495ede3a58591f6647d9dfe commit 4bf7ea0d0f407e24cfd6d205ef71ecb970dc13f3 commit c1503cc18f0d1c489a6bf20bce18ad8e7548a9de commit 1925eecec23a688d101850d71c044ae4a1f4e5a9 commit 227349998e5740f14d531b0f0d704e66b1ed3c2f commit b7a0cfab3944dd91cce889d4adf6711f9a80c59b commit 794556bdcf372d3a6081f94e0bed1a66de3f0347 commit 6503743bbf48c8acf6a2390b6738684866642aa4 commit f4a7584e4805ea39d3fe55f0511741734bdc4ca9 commit 0c1f6e1418297c44e91ecab6e309d2cf4cdd9461 commit f6adc5322e153600d06ec8c3a64e5521985b8a89 commit 8e21de5f99b2368a5155037ce0aae8aaba3f5241 commit ecb4e3989770c646eb3dbc52c6794889d7e06fa9 commit 03c71c42809ef4b17f5d874cdb2d3bf40e847b86 commit 432123417475ec9cd5b1b88da43477fece7a7133 commit a2552020fb714ff357182c3c179abfac2289f84d commit 0510acb3a499f6ccedfac94b032fecf85ca0918d commit de1af9af37cb8e5d6c160ad3acad957716a6968c commit e96fe6dbbb1aa80c0706df4656f63db159e5f6ad commit a68facb934d91ad9c923b92321e5f6d6f74c702c commit 468a50fd46a09bba7ba18a11054ae64b6479ecdc commit b0d612619ed70cab476c77b19e00d13aa414e14f commit c4cc9399251ff062b622a429d3edd0e0e265ea8b commit e6eb2567523713b8783e061656b375477776c96d commit 068eb46639fff326f1a236d91f4d336af4a54734 commit e646402bf82145349fcf5dcbe395afaf02a8ce47 commit 79d54ddf0e292b810887994bb04709c5ac0e1531 commit cc796a77985d6af75c9362cb2e73dce4ae3f97cd commit fc37011ab528d7433848fb6679975eecfa2dd10d commit 27df59c6071470efce7182ee92fbb16afba551e0 commit 76ec0e33707282d5321555698d902f4e067aff37 commit ebacd4bbd500e033842515dc62224c68e46b202f commit 583ce246c7ff9edeb0de49130cdc3d45db8545cb commit 0aaf41c55d0c699fbf50fccf9d80cafda092bb67 commit bf3825a98969af7dce32d096fd24ee3a53ea8ae7 commit 0acce2a5c619ef1abdee783d7fea5eac78ce4844 commit bdda5072494f2a7215d94fc4124ad1949a218714 commit 00702cfa8432ac67a72f56de5e1d278ddea2ebde commit dd9ec0ea4cdde0fc48116e63969fc83e81d7ef46 commit 414f4a31f7a811008fd9a33b06216b060bad18fc commit 6e49a157d541e7e97b815a56f4bdfcbc89844a59 commit c990344a94208c5bcf32eefc61a74d0cdbade8b7 commit c6b5ff549af545f2faee04356420183bd2f9fc29 commit 0888d15ea45ba8ef4508edd1123ea5ad95b58994 commit 4874f858788985307238d618ee124aea63a5d4b6 commit f8f120b3de48b8b6bdf8988a9b334c2d61c17440 commit 89dc29424717af11067b96d4a9c8fb501d4d8a56 commit 8e24beb3c2b08a4763f920399a9cc577ed440a1a commit 062edd612fcd300f0f79a36fca5b8b6a5e2fce70 commit a31ea49dc8064a557565725cf045944307476a6e commit c5ec2afeeee4c91cebc4eff6d4f1ecf4047259f4 commit 881fb6afc0004c5e6392ae2848f825bf051dae14 commit 9342da15f2491d8600eca89c8e0da08876fb969b commit 8ed43801351e6daad055a6cefb076f2b1181d955 commit a76fa9c4f0fc0aa6f517da3fa7d7c23e8a32c7d0 commit a9c047a5cf3135b8b66bd28fbe2c698b9cace0b3 commit be8c1cfeb91ea856948d812d3bd5273d93a0fca6 commit b1656d83725ba2dc412c46f5aa26f32919aaa4c8 commit 803b30c5816e31819880525c2a9a7827656b8c39 commit 39722d35ea6a24fafc3f3e3b173a69114d683ffb commit 785c8716707d514f4485edefeae962e4d530c89c commit 704c9b5a48c90766102b09c78e735a7306d1411d commit 79223ce7d19682f57b6835b233d60c9bc4dc0ba2 commit 7db5411c5d0bd9c29b8c2ad93c36b5c16ea46c9e commit 2c72cc1c73d410ae4957eac30ecb63a4ad5462f1 commit e2779ae53928a758f2f2e7f2238497f17ce61ee5 commit 8d656c7a0fed8e1675a170d0d17039fe713beb59 commit ad7c0bced8851e6cb1177bb80397aa3b875f6acf commit fccdf39502b5deab8c8170e3aa5cc94b58b0985c commit e24147c48fa574576e916f201a9f9da35d7052e7 commit 49f50a7cd4ffb6749471eb571e1aa10dcc697b79 commit b53fc5664709b44487c8f31b7ec22825fbd214f5 commit 3c36a4415f09fa77c58d564f376b22d7704aae27 commit 99df9af3e8580754201faae95a7f9e5f64ac2229 commit 2898c30041a2a195a8bf8f1b779ff6b46c5e5097 commit a7f8e80d8e935ec0068263eb33ae3fdececf4971 commit cfba03470ce1f50a859ebaef69f38090d065bbdb commit 6172bade9a91ff639a233952719ef8cb5ea92c17 commit 0b94cb5f0cb534aa98c9cfdf011f3224e6cae153 commit 4f9467d0623eef1b77944b6a1f90c180c4458559 commit 566db3743699e19545206292636c807f36148717 commit 823273bf78434a6e89545317cfd767183e6f02ea commit 94166fe12543fbef122ca2d093e794ea41073a85 commit 8a500b3a5f0a58c6f99039091fbd715f64f2f8af Signed-off-by: Dave Airlie <airlied@redhat.com>
2024-07-29 00:32:30 +00:00
spin_lock(&obj->lock); /* Caller already disabled IRQ. */
list_for_each(pos, &obj->pt_list) {
struct sync_pt *pt = container_of(pos, struct sync_pt, link);
sync_print_fence(s, &pt->base, false);
}
Merge DRM changes from upstream v6.9..v6.9.11 NOTE: This commit does not compile due to missing RHEL-specific fix-ups, which are split out into separate Git commits following this one. If git bisect selected this commit, run "git bisect skip" and try again. Repeat this until it selects a commit which compiles. This commit was generated using: rhdrm-merge-drm v6.9.11 RHEL-24103 JIRA: https://issues.redhat.com/browse/RHEL-24103 Conflicts: drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Conflict resolution: Commit list: commit 308de6be0c9c7ba36915c0d398e771725c0ea911 commit 9ea499a97b0a9c459bc1cc83f673ed8acda1cf11 commit ceb79a4368b02a7f4da79e7224acffe7dc3eb15c commit c93d80cea0b3596c979fdd6358646fe824efd882 commit 68160442dce98f32bfdf82ae52d36998852038f9 commit 9386206d4c229a7c48708d929271eab477afd08c commit 7226ddf3311c5e5a7726ad7d4e7b079bb3cfbb29 commit 6a9cffd96c4a6178d443447cd1447c12d7cbe157 commit a8e01256c5be7ce08bfe787852103960c44111bd commit 6127ea0302e9186a85fce121de6084a8fdf9d043 commit 4e8de27007ad5f95c517d0a5f1bcdbb575a3af7e commit 47889711da20be9b43e1e136e5cb68df37cbcc79 commit ccf8dc41b8d7e5dfbce693919c95e00c79211567 commit 4f9faca2f2d5f9cdb50817c58e33c86276b87c32 commit 69bc77fef6add11f42eb62bde7ad189e01e0ba70 commit a86321bfe52b2c19a29acaaea1ee84dadd3388fe commit 72ca4171142f7e3d8c838da865099de7218eb133 commit a073e011bd174987bd715843be81a13ee5b66382 commit 3673f70f6a16ee6d896dbc7b7d246b7b3ce42f96 commit 48de4f92a44c20f645bbbe15e7af0d3710de2693 commit d8285fea0656f221bcea0c551d98094117126f59 commit 88fcce7c31e6c1d99a2a3b2bd9c0aeade0dd41c3 commit 8971b2da4b6cea1a533a1b77d647f739a85e4c63 commit 3092ef7774535d6b5df4bdc4313ab5dc1ebcd58a commit 9a4a5d7b513c596749ee6ec4eebba78a53fa2bdc commit b9cbe1c8911e754af6f84dd7dd47e248d8ba7a53 commit 850f4a965229f226e687efc2efd776da1e97492b commit 6175e4442e8c620ced69167fab003e7ff55303bd commit f1b6a016dfa45cedc080d36fa5d6f22237d80e8b commit 6ad1ffb66846bfbdb93a127204b0bb5b1be02331 commit ca5ad9c231c2fc69526d25436ba592633d7db1e4 commit 289a10b47fe5d17a81c9ee69994110d3ccfb5495 commit 8a283cdfc8beeb14024387a925247b563d614e1e commit 492990552be6df3580c5be178dcbfa4c2204219c commit 4e85c324b3f21a5205f5dd4d85c2023d7d4f1282 commit 2803bc08b0f1933f4c41b922c919290865654b3e commit 92deed4a9bfd9ef187764225bba530116c49e15c commit 00a43f84101a37a8f220a09daafc1c6216b9b348 commit e9250578ac6278dfd24a57c326eb805b3bdb0e31 commit 869f31cfb1341f178d2e27b3ed5172d773729d5d commit 6d3934a09d6d266c2b6e5a24d8b4b437dd6f12c6 commit 9938a1715cd8614af3bbf2442594867a0bd8eb3c commit c7ca42116e7931754df6d40cb0860f8995104274 commit 7a5bc0f266e78476f04583c25c9ab7b6785a53ae commit 42547ec5f0c6b8d0c995078cd805736fcdf51dfb commit ce5a22d22db691d14516c3b8fdbf69139eb2ea8f commit 0964c84b93db7fbf74f357c1e20957850e092db3 commit 6b84900ebb91ef0945fd9969d1620ea66c4779ba commit 309f1a7ffa4e2db309af1db4c968327faf6e89f3 commit 438c129ef72a76330c07d8a8c684d1cd78c74851 commit 40ee4866d25f69b0428e24a8f5d35e64d407f5d3 commit 46579f06206d877b076b6835244fd36c97db82e1 commit 5f34ee20e9b96a01c5e73fa0c99c25d92245ef3c commit 059b58ef6a7584e2679b06a6889584dcefc375fb commit 0ae1868e9e140c6bf495ede3a58591f6647d9dfe commit 4bf7ea0d0f407e24cfd6d205ef71ecb970dc13f3 commit c1503cc18f0d1c489a6bf20bce18ad8e7548a9de commit 1925eecec23a688d101850d71c044ae4a1f4e5a9 commit 227349998e5740f14d531b0f0d704e66b1ed3c2f commit b7a0cfab3944dd91cce889d4adf6711f9a80c59b commit 794556bdcf372d3a6081f94e0bed1a66de3f0347 commit 6503743bbf48c8acf6a2390b6738684866642aa4 commit f4a7584e4805ea39d3fe55f0511741734bdc4ca9 commit 0c1f6e1418297c44e91ecab6e309d2cf4cdd9461 commit f6adc5322e153600d06ec8c3a64e5521985b8a89 commit 8e21de5f99b2368a5155037ce0aae8aaba3f5241 commit ecb4e3989770c646eb3dbc52c6794889d7e06fa9 commit 03c71c42809ef4b17f5d874cdb2d3bf40e847b86 commit 432123417475ec9cd5b1b88da43477fece7a7133 commit a2552020fb714ff357182c3c179abfac2289f84d commit 0510acb3a499f6ccedfac94b032fecf85ca0918d commit de1af9af37cb8e5d6c160ad3acad957716a6968c commit e96fe6dbbb1aa80c0706df4656f63db159e5f6ad commit a68facb934d91ad9c923b92321e5f6d6f74c702c commit 468a50fd46a09bba7ba18a11054ae64b6479ecdc commit b0d612619ed70cab476c77b19e00d13aa414e14f commit c4cc9399251ff062b622a429d3edd0e0e265ea8b commit e6eb2567523713b8783e061656b375477776c96d commit 068eb46639fff326f1a236d91f4d336af4a54734 commit e646402bf82145349fcf5dcbe395afaf02a8ce47 commit 79d54ddf0e292b810887994bb04709c5ac0e1531 commit cc796a77985d6af75c9362cb2e73dce4ae3f97cd commit fc37011ab528d7433848fb6679975eecfa2dd10d commit 27df59c6071470efce7182ee92fbb16afba551e0 commit 76ec0e33707282d5321555698d902f4e067aff37 commit ebacd4bbd500e033842515dc62224c68e46b202f commit 583ce246c7ff9edeb0de49130cdc3d45db8545cb commit 0aaf41c55d0c699fbf50fccf9d80cafda092bb67 commit bf3825a98969af7dce32d096fd24ee3a53ea8ae7 commit 0acce2a5c619ef1abdee783d7fea5eac78ce4844 commit bdda5072494f2a7215d94fc4124ad1949a218714 commit 00702cfa8432ac67a72f56de5e1d278ddea2ebde commit dd9ec0ea4cdde0fc48116e63969fc83e81d7ef46 commit 414f4a31f7a811008fd9a33b06216b060bad18fc commit 6e49a157d541e7e97b815a56f4bdfcbc89844a59 commit c990344a94208c5bcf32eefc61a74d0cdbade8b7 commit c6b5ff549af545f2faee04356420183bd2f9fc29 commit 0888d15ea45ba8ef4508edd1123ea5ad95b58994 commit 4874f858788985307238d618ee124aea63a5d4b6 commit f8f120b3de48b8b6bdf8988a9b334c2d61c17440 commit 89dc29424717af11067b96d4a9c8fb501d4d8a56 commit 8e24beb3c2b08a4763f920399a9cc577ed440a1a commit 062edd612fcd300f0f79a36fca5b8b6a5e2fce70 commit a31ea49dc8064a557565725cf045944307476a6e commit c5ec2afeeee4c91cebc4eff6d4f1ecf4047259f4 commit 881fb6afc0004c5e6392ae2848f825bf051dae14 commit 9342da15f2491d8600eca89c8e0da08876fb969b commit 8ed43801351e6daad055a6cefb076f2b1181d955 commit a76fa9c4f0fc0aa6f517da3fa7d7c23e8a32c7d0 commit a9c047a5cf3135b8b66bd28fbe2c698b9cace0b3 commit be8c1cfeb91ea856948d812d3bd5273d93a0fca6 commit b1656d83725ba2dc412c46f5aa26f32919aaa4c8 commit 803b30c5816e31819880525c2a9a7827656b8c39 commit 39722d35ea6a24fafc3f3e3b173a69114d683ffb commit 785c8716707d514f4485edefeae962e4d530c89c commit 704c9b5a48c90766102b09c78e735a7306d1411d commit 79223ce7d19682f57b6835b233d60c9bc4dc0ba2 commit 7db5411c5d0bd9c29b8c2ad93c36b5c16ea46c9e commit 2c72cc1c73d410ae4957eac30ecb63a4ad5462f1 commit e2779ae53928a758f2f2e7f2238497f17ce61ee5 commit 8d656c7a0fed8e1675a170d0d17039fe713beb59 commit ad7c0bced8851e6cb1177bb80397aa3b875f6acf commit fccdf39502b5deab8c8170e3aa5cc94b58b0985c commit e24147c48fa574576e916f201a9f9da35d7052e7 commit 49f50a7cd4ffb6749471eb571e1aa10dcc697b79 commit b53fc5664709b44487c8f31b7ec22825fbd214f5 commit 3c36a4415f09fa77c58d564f376b22d7704aae27 commit 99df9af3e8580754201faae95a7f9e5f64ac2229 commit 2898c30041a2a195a8bf8f1b779ff6b46c5e5097 commit a7f8e80d8e935ec0068263eb33ae3fdececf4971 commit cfba03470ce1f50a859ebaef69f38090d065bbdb commit 6172bade9a91ff639a233952719ef8cb5ea92c17 commit 0b94cb5f0cb534aa98c9cfdf011f3224e6cae153 commit 4f9467d0623eef1b77944b6a1f90c180c4458559 commit 566db3743699e19545206292636c807f36148717 commit 823273bf78434a6e89545317cfd767183e6f02ea commit 94166fe12543fbef122ca2d093e794ea41073a85 commit 8a500b3a5f0a58c6f99039091fbd715f64f2f8af Signed-off-by: Dave Airlie <airlied@redhat.com>
2024-07-29 00:32:30 +00:00
spin_unlock(&obj->lock);
}
static void sync_print_sync_file(struct seq_file *s,
struct sync_file *sync_file)
{
char buf[128];
int i;
seq_printf(s, "[%p] %s: %s\n", sync_file,
sync_file_get_name(sync_file, buf, sizeof(buf)),
sync_status_str(dma_fence_get_status(sync_file->fence)));
dma-buf: Rename struct fence to dma_fence I plan to usurp the short name of struct fence for a core kernel struct, and so I need to rename the specialised fence/timeline for DMA operations to make room. A consensus was reached in https://lists.freedesktop.org/archives/dri-devel/2016-July/113083.html that making clear this fence applies to DMA operations was a good thing. Since then the patch has grown a bit as usage increases, so hopefully it remains a good thing! (v2...: rebase, rerun spatch) v3: Compile on msm, spotted a manual fixup that I broke. v4: Try again for msm, sorry Daniel coccinelle script: @@ @@ - struct fence + struct dma_fence @@ @@ - struct fence_ops + struct dma_fence_ops @@ @@ - struct fence_cb + struct dma_fence_cb @@ @@ - struct fence_array + struct dma_fence_array @@ @@ - enum fence_flag_bits + enum dma_fence_flag_bits @@ @@ ( - fence_init + dma_fence_init | - fence_release + dma_fence_release | - fence_free + dma_fence_free | - fence_get + dma_fence_get | - fence_get_rcu + dma_fence_get_rcu | - fence_put + dma_fence_put | - fence_signal + dma_fence_signal | - fence_signal_locked + dma_fence_signal_locked | - fence_default_wait + dma_fence_default_wait | - fence_add_callback + dma_fence_add_callback | - fence_remove_callback + dma_fence_remove_callback | - fence_enable_sw_signaling + dma_fence_enable_sw_signaling | - fence_is_signaled_locked + dma_fence_is_signaled_locked | - fence_is_signaled + dma_fence_is_signaled | - fence_is_later + dma_fence_is_later | - fence_later + dma_fence_later | - fence_wait_timeout + dma_fence_wait_timeout | - fence_wait_any_timeout + dma_fence_wait_any_timeout | - fence_wait + dma_fence_wait | - fence_context_alloc + dma_fence_context_alloc | - fence_array_create + dma_fence_array_create | - to_fence_array + to_dma_fence_array | - fence_is_array + dma_fence_is_array | - trace_fence_emit + trace_dma_fence_emit | - FENCE_TRACE + DMA_FENCE_TRACE | - FENCE_WARN + DMA_FENCE_WARN | - FENCE_ERR + DMA_FENCE_ERR ) ( ... ) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Acked-by: Sumit Semwal <sumit.semwal@linaro.org> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20161025120045.28839-1-chris@chris-wilson.co.uk
2016-10-25 12:00:45 +00:00
if (dma_fence_is_array(sync_file->fence)) {
struct dma_fence_array *array = to_dma_fence_array(sync_file->fence);
dma-buf/sync_file: refactor fence storage in struct sync_file Create sync_file->fence to abstract the type of fence we are using for each sync_file. If only one fence is present we use a normal struct fence but if there is more fences to be added to the sync_file a fence_array is created. This change cleans up sync_file a bit. We don't need to have sync_file_cb array anymore. Instead, as we always have one fence, only one fence callback is registered per sync_file. v2: Comments from Chris Wilson and Christian König - Not using fence_ops anymore - fence_is_array() was created to differentiate fence from fence_array - fence_array_teardown() is now exported and used under fence_is_array() - struct sync_file lost num_fences member v3: Comments from Chris Wilson and Christian König - struct sync_file lost status member in favor of fence_is_signaled() - drop use of fence_array_teardown() - use sizeof(*fence) to allocate only an array on fence pointers v4: Comments from Chris Wilson - use sizeof(*fence) to reallocate array - fix typo in comments - protect num_fences sum against overflows - use array->base instead of casting the to struct fence v5: fixes checkpatch warnings v6: fix case where all fences are signaled. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Christian König <christian.koenig@amd.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
2016-08-05 13:39:35 +00:00
for (i = 0; i < array->num_fences; ++i)
sync_print_fence(s, array->fences[i], true);
} else {
sync_print_fence(s, sync_file->fence, true);
}
}
static int sync_info_debugfs_show(struct seq_file *s, void *unused)
{
struct list_head *pos;
seq_puts(s, "objs:\n--------------\n");
spin_lock_irq(&sync_timeline_list_lock);
list_for_each(pos, &sync_timeline_list_head) {
struct sync_timeline *obj =
container_of(pos, struct sync_timeline,
sync_timeline_list);
sync_print_obj(s, obj);
seq_putc(s, '\n');
}
spin_unlock_irq(&sync_timeline_list_lock);
seq_puts(s, "fences:\n--------------\n");
spin_lock_irq(&sync_file_list_lock);
list_for_each(pos, &sync_file_list_head) {
struct sync_file *sync_file =
container_of(pos, struct sync_file, sync_file_list);
sync_print_sync_file(s, sync_file);
seq_putc(s, '\n');
}
spin_unlock_irq(&sync_file_list_lock);
return 0;
}
DEFINE_SHOW_ATTRIBUTE(sync_info_debugfs);
static __init int sync_debugfs_init(void)
{
dbgfs = debugfs_create_dir("sync", NULL);
/*
* The debugfs files won't ever get removed and thus, there is
* no need to protect it against removal races. The use of
* debugfs_create_file_unsafe() is actually safe here.
*/
debugfs_create_file_unsafe("info", 0444, dbgfs, NULL,
&sync_info_debugfs_fops);
debugfs_create_file_unsafe("sw_sync", 0644, dbgfs, NULL,
&sw_sync_debugfs_fops);
return 0;
}
late_initcall(sync_debugfs_init);