Release 4.12 include/linux/dma-fence-array.h
/*
* fence-array: aggregates fence to be waited together
*
* Copyright (C) 2016 Collabora Ltd
* Copyright (C) 2016 Advanced Micro Devices, Inc.
* Authors:
* Gustavo Padovan <gustavo@padovan.org>
* Christian König <christian.koenig@amd.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#ifndef __LINUX_DMA_FENCE_ARRAY_H
#define __LINUX_DMA_FENCE_ARRAY_H
#include <linux/dma-fence.h>
/**
* struct dma_fence_array_cb - callback helper for fence array
* @cb: fence callback structure for signaling
* @array: reference to the parent fence array object
*/
struct dma_fence_array_cb {
struct dma_fence_cb cb;
struct dma_fence_array *array;
};
/**
* struct dma_fence_array - fence to represent an array of fences
* @base: fence base class
* @lock: spinlock for fence handling
* @num_fences: number of fences in the array
* @num_pending: fences in the array still pending
* @fences: array of the fences
*/
struct dma_fence_array {
struct dma_fence base;
spinlock_t lock;
unsigned num_fences;
atomic_t num_pending;
struct dma_fence **fences;
};
extern const struct dma_fence_ops dma_fence_array_ops;
/**
* dma_fence_is_array - check if a fence is from the array subsclass
* @fence: fence to test
*
* Return true if it is a dma_fence_array and false otherwise.
*/
static inline bool dma_fence_is_array(struct dma_fence *fence)
{
return fence->ops == &dma_fence_array_ops;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Gustavo Fernando Padovan | 17 | 85.00% | 1 | 50.00% |
Chris Wilson | 3 | 15.00% | 1 | 50.00% |
Total | 20 | 100.00% | 2 | 100.00% |
/**
* to_dma_fence_array - cast a fence to a dma_fence_array
* @fence: fence to cast to a dma_fence_array
*
* Returns NULL if the fence is not a dma_fence_array,
* or the dma_fence_array otherwise.
*/
static inline struct dma_fence_array *
to_dma_fence_array(struct dma_fence *fence)
{
if (fence->ops != &dma_fence_array_ops)
return NULL;
return container_of(fence, struct dma_fence_array, base);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Gustavo Fernando Padovan | 32 | 86.49% | 1 | 50.00% |
Chris Wilson | 5 | 13.51% | 1 | 50.00% |
Total | 37 | 100.00% | 2 | 100.00% |
struct dma_fence_array *dma_fence_array_create(int num_fences,
struct dma_fence **fences,
u64 context, unsigned seqno,
bool signal_on_any);
bool dma_fence_match_context(struct dma_fence *fence, u64 context);
#endif /* __LINUX_DMA_FENCE_ARRAY_H */
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Gustavo Fernando Padovan | 112 | 72.73% | 2 | 40.00% |
Chris Wilson | 27 | 17.53% | 1 | 20.00% |
Philipp Zabel | 12 | 7.79% | 1 | 20.00% |
Christian König | 3 | 1.95% | 1 | 20.00% |
Total | 154 | 100.00% | 5 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.