@@ -344,6 +344,30 @@ void __dma_fence_might_wait(void)
}
#endif
+void __dma_fence_signal__timestamp(struct dma_fence *fence, ktime_t timestamp)
+{
+ lockdep_assert_held(fence->lock);
+
+ fence->timestamp = timestamp;
+ set_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags);
+ trace_dma_fence_signaled(fence);
+}
+EXPORT_SYMBOL(__dma_fence_signal__timestamp);
+
+void
+__dma_fence_signal__notify(struct dma_fence *fence,
+ const struct list_head *list)
+{
+ struct dma_fence_cb *cur, *tmp;
+
+ lockdep_assert_held(fence->lock);
+
+ list_for_each_entry_safe(cur, tmp, list, node) {
+ INIT_LIST_HEAD(&cur->node);
+ cur->func(fence, cur);
+ }
+}
+EXPORT_SYMBOL(__dma_fence_signal__notify);
/**
* dma_fence_signal_timestamp_locked - signal completion of a fence
@@ -366,7 +390,6 @@ void __dma_fence_might_wait(void)
int dma_fence_signal_timestamp_locked(struct dma_fence *fence,
ktime_t timestamp)
{
- struct dma_fence_cb *cur, *tmp;
struct list_head cb_list;
lockdep_assert_held(fence->lock);
@@ -378,14 +401,8 @@ int dma_fence_signal_timestamp_locked(struct dma_fence *fence,
/* Stash the cb_list before replacing it with the timestamp */
list_replace(&fence->cb_list, &cb_list);
- fence->timestamp = timestamp;
- set_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags);
- trace_dma_fence_signaled(fence);
-
- list_for_each_entry_safe(cur, tmp, &cb_list, node) {
- INIT_LIST_HEAD(&cur->node);
- cur->func(fence, cur);
- }
+ __dma_fence_signal__timestamp(fence, timestamp);
+ __dma_fence_signal__notify(fence, &cb_list);
return 0;
}
@@ -127,28 +127,6 @@ __dma_fence_signal(struct dma_fence *fence)
return !test_and_set_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags);
}
-static void
-__dma_fence_signal__timestamp(struct dma_fence *fence, ktime_t timestamp)
-{
- fence->timestamp = timestamp;
- set_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags);
- trace_dma_fence_signaled(fence);
-}
-
-static void
-__dma_fence_signal__notify(struct dma_fence *fence,
- const struct list_head *list)
-{
- struct dma_fence_cb *cur, *tmp;
-
- lockdep_assert_held(fence->lock);
-
- list_for_each_entry_safe(cur, tmp, list, node) {
- INIT_LIST_HEAD(&cur->node);
- cur->func(fence, cur);
- }
-}
-
static void add_retire(struct intel_breadcrumbs *b, struct intel_timeline *tl)
{
if (b->irq_engine)
@@ -367,6 +367,10 @@ static inline void dma_fence_end_signalling(bool cookie) {}
static inline void __dma_fence_might_wait(void) {}
#endif
+void __dma_fence_signal__timestamp(struct dma_fence *fence, ktime_t timestamp);
+void __dma_fence_signal__notify(struct dma_fence *fence,
+ const struct list_head *list);
+
int dma_fence_signal(struct dma_fence *fence);
int dma_fence_signal_locked(struct dma_fence *fence);
int dma_fence_signal_timestamp(struct dma_fence *fence, ktime_t timestamp);