diff options
author | Dave Airlie <airlied@redhat.com> | 2017-07-26 18:15:43 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2017-07-26 18:15:43 -0400 |
commit | 0eb2c0ae578ba00f97c7541e01abbce022d14909 (patch) | |
tree | 172db28b9232906ddac61b4bf20c4b0c60c85139 /drivers/dma-buf | |
parent | 542aefb5a2da8f67b8fb74a24f60ecb3ec479a06 (diff) | |
parent | 520eccdfe187591a51ea9ab4c1a024ae4d0f68d9 (diff) |
Backmerge tag 'v4.13-rc2' into drm-next
Linux 4.13-rc2
This is required for drm-misc fixing.
Diffstat (limited to 'drivers/dma-buf')
-rw-r--r-- | drivers/dma-buf/dma-fence.c | 17 | ||||
-rw-r--r-- | drivers/dma-buf/sync_debug.c | 2 | ||||
-rw-r--r-- | drivers/dma-buf/sync_file.c | 8 |
3 files changed, 14 insertions, 13 deletions
diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c index eee8377b8b3a..9a302799040e 100644 --- a/drivers/dma-buf/dma-fence.c +++ b/drivers/dma-buf/dma-fence.c | |||
@@ -75,11 +75,6 @@ int dma_fence_signal_locked(struct dma_fence *fence) | |||
75 | if (WARN_ON(!fence)) | 75 | if (WARN_ON(!fence)) |
76 | return -EINVAL; | 76 | return -EINVAL; |
77 | 77 | ||
78 | if (!ktime_to_ns(fence->timestamp)) { | ||
79 | fence->timestamp = ktime_get(); | ||
80 | smp_mb__before_atomic(); | ||
81 | } | ||
82 | |||
83 | if (test_and_set_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) { | 78 | if (test_and_set_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) { |
84 | ret = -EINVAL; | 79 | ret = -EINVAL; |
85 | 80 | ||
@@ -87,8 +82,11 @@ int dma_fence_signal_locked(struct dma_fence *fence) | |||
87 | * we might have raced with the unlocked dma_fence_signal, | 82 | * we might have raced with the unlocked dma_fence_signal, |
88 | * still run through all callbacks | 83 | * still run through all callbacks |
89 | */ | 84 | */ |
90 | } else | 85 | } else { |
86 | fence->timestamp = ktime_get(); | ||
87 | set_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags); | ||
91 | trace_dma_fence_signaled(fence); | 88 | trace_dma_fence_signaled(fence); |
89 | } | ||
92 | 90 | ||
93 | list_for_each_entry_safe(cur, tmp, &fence->cb_list, node) { | 91 | list_for_each_entry_safe(cur, tmp, &fence->cb_list, node) { |
94 | list_del_init(&cur->node); | 92 | list_del_init(&cur->node); |
@@ -115,14 +113,11 @@ int dma_fence_signal(struct dma_fence *fence) | |||
115 | if (!fence) | 113 | if (!fence) |
116 | return -EINVAL; | 114 | return -EINVAL; |
117 | 115 | ||
118 | if (!ktime_to_ns(fence->timestamp)) { | ||
119 | fence->timestamp = ktime_get(); | ||
120 | smp_mb__before_atomic(); | ||
121 | } | ||
122 | |||
123 | if (test_and_set_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) | 116 | if (test_and_set_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) |
124 | return -EINVAL; | 117 | return -EINVAL; |
125 | 118 | ||
119 | fence->timestamp = ktime_get(); | ||
120 | set_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags); | ||
126 | trace_dma_fence_signaled(fence); | 121 | trace_dma_fence_signaled(fence); |
127 | 122 | ||
128 | if (test_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT, &fence->flags)) { | 123 | if (test_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT, &fence->flags)) { |
diff --git a/drivers/dma-buf/sync_debug.c b/drivers/dma-buf/sync_debug.c index 2264a075f6a9..c4c8ecb24aa9 100644 --- a/drivers/dma-buf/sync_debug.c +++ b/drivers/dma-buf/sync_debug.c | |||
@@ -84,7 +84,7 @@ static void sync_print_fence(struct seq_file *s, | |||
84 | show ? "_" : "", | 84 | show ? "_" : "", |
85 | sync_status_str(status)); | 85 | sync_status_str(status)); |
86 | 86 | ||
87 | if (status) { | 87 | if (test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags)) { |
88 | struct timespec64 ts64 = | 88 | struct timespec64 ts64 = |
89 | ktime_to_timespec64(fence->timestamp); | 89 | ktime_to_timespec64(fence->timestamp); |
90 | 90 | ||
diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c index 545e2c5c4815..d7e219d2669d 100644 --- a/drivers/dma-buf/sync_file.c +++ b/drivers/dma-buf/sync_file.c | |||
@@ -391,7 +391,13 @@ static void sync_fill_fence_info(struct dma_fence *fence, | |||
391 | sizeof(info->driver_name)); | 391 | sizeof(info->driver_name)); |
392 | 392 | ||
393 | info->status = dma_fence_get_status(fence); | 393 | info->status = dma_fence_get_status(fence); |
394 | info->timestamp_ns = ktime_to_ns(fence->timestamp); | 394 | while (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags) && |
395 | !test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags)) | ||
396 | cpu_relax(); | ||
397 | info->timestamp_ns = | ||
398 | test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags) ? | ||
399 | ktime_to_ns(fence->timestamp) : | ||
400 | ktime_set(0, 0); | ||
395 | } | 401 | } |
396 | 402 | ||
397 | static long sync_file_ioctl_fence_info(struct sync_file *sync_file, | 403 | static long sync_file_ioctl_fence_info(struct sync_file *sync_file, |