147979480SChris Wilson /*
247979480SChris Wilson  * Copyright © 2017 Intel Corporation
347979480SChris Wilson  *
447979480SChris Wilson  * Permission is hereby granted, free of charge, to any person obtaining a
547979480SChris Wilson  * copy of this software and associated documentation files (the "Software"),
647979480SChris Wilson  * to deal in the Software without restriction, including without limitation
747979480SChris Wilson  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
847979480SChris Wilson  * and/or sell copies of the Software, and to permit persons to whom the
947979480SChris Wilson  * Software is furnished to do so, subject to the following conditions:
1047979480SChris Wilson  *
1147979480SChris Wilson  * The above copyright notice and this permission notice (including the next
1247979480SChris Wilson  * paragraph) shall be included in all copies or substantial portions of the
1347979480SChris Wilson  * Software.
1447979480SChris Wilson  *
1547979480SChris Wilson  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1647979480SChris Wilson  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1747979480SChris Wilson  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1847979480SChris Wilson  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1947979480SChris Wilson  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2047979480SChris Wilson  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2147979480SChris Wilson  * IN THE SOFTWARE.
2247979480SChris Wilson  *
2347979480SChris Wilson  */
2447979480SChris Wilson 
2547979480SChris Wilson #ifndef __I915_SYNCMAP_H__
2647979480SChris Wilson #define __I915_SYNCMAP_H__
2747979480SChris Wilson 
2847979480SChris Wilson #include <linux/types.h>
2947979480SChris Wilson 
3047979480SChris Wilson struct i915_syncmap;
3147979480SChris Wilson #define KSYNCMAP 16 /* radix of the tree, how many slots in each layer */
3247979480SChris Wilson 
3347979480SChris Wilson void i915_syncmap_init(struct i915_syncmap **root);
3447979480SChris Wilson int i915_syncmap_set(struct i915_syncmap **root, u64 id, u32 seqno);
3547979480SChris Wilson bool i915_syncmap_is_later(struct i915_syncmap **root, u64 id, u32 seqno);
3647979480SChris Wilson void i915_syncmap_free(struct i915_syncmap **root);
3747979480SChris Wilson 
3847979480SChris Wilson #endif /* __I915_SYNCMAP_H__ */
39