diff options
author | Christian König <christian.koenig@amd.com> | 2018-11-14 16:11:06 +0100 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2018-12-07 12:44:16 +0100 |
commit | b312d8ca3a7cebe19941d969a51f2b7f899b81e2 (patch) | |
tree | b38afe698b8f8c4cfb9a9e8e8ee1808fad4c33e5 /drivers/dma-buf/sync_file.c | |
parent | drm/qxl: add spice-devel list to MAINTAINERS (diff) | |
download | linux-b312d8ca3a7cebe19941d969a51f2b7f899b81e2.tar.xz linux-b312d8ca3a7cebe19941d969a51f2b7f899b81e2.zip |
dma-buf: make fence sequence numbers 64 bit v2
For a lot of use cases we need 64bit sequence numbers. Currently drivers
overload the dma_fence structure to store the additional bits.
Stop doing that and make the sequence number in the dma_fence always
64bit.
For compatibility with hardware which can do only 32bit sequences the
comparisons in __dma_fence_is_later only takes the lower 32bits as significant
when the upper 32bits are all zero.
v2: change the logic in __dma_fence_is_later
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Link: https://patchwork.freedesktop.org/patch/266927/
Diffstat (limited to 'drivers/dma-buf/sync_file.c')
-rw-r--r-- | drivers/dma-buf/sync_file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c index 35dd06479867..4f6305ca52c8 100644 --- a/drivers/dma-buf/sync_file.c +++ b/drivers/dma-buf/sync_file.c @@ -144,7 +144,7 @@ char *sync_file_get_name(struct sync_file *sync_file, char *buf, int len) } else { struct dma_fence *fence = sync_file->fence; - snprintf(buf, len, "%s-%s%llu-%d", + snprintf(buf, len, "%s-%s%llu-%lld", fence->ops->get_driver_name(fence), fence->ops->get_timeline_name(fence), fence->context, @@ -258,7 +258,7 @@ static struct sync_file *sync_file_merge(const char *name, struct sync_file *a, i_b++; } else { - if (pt_a->seqno - pt_b->seqno <= INT_MAX) + if (__dma_fence_is_later(pt_a->seqno, pt_b->seqno)) add_fence(fences, &i, pt_a); else add_fence(fences, &i, pt_b); |