diff options
author | Chris Wilson <[email protected]> | 2018-11-09 15:02:12 +0000 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-02-21 10:26:10 -0800 |
commit | fae74234d9177b2257d878640f36e9ef227badfa (patch) | |
tree | f1c85f445193fca22de8ba17b2713cc44540ebff /src/gallium/drivers/iris/iris_fence.h | |
parent | 3e332af61111c627d0384a5c3bdc2ce1b279405a (diff) |
iris: Tag each submitted batch with a syncobj
(adjusted by Ken to make the signalling sync object immediately on
batch reset, rather than batch finish time. this will work better
with deferred flushes...)
Diffstat (limited to 'src/gallium/drivers/iris/iris_fence.h')
-rw-r--r-- | src/gallium/drivers/iris/iris_fence.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/gallium/drivers/iris/iris_fence.h b/src/gallium/drivers/iris/iris_fence.h new file mode 100644 index 00000000000..0101ce00883 --- /dev/null +++ b/src/gallium/drivers/iris/iris_fence.h @@ -0,0 +1,53 @@ +/* + * Copyright © 2018 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef IRIS_FENCE_H +#define IRIS_FENCE_H + +#include "util/u_inlines.h" + +struct pipe_screen; + +struct iris_syncpt { + struct pipe_reference ref; + uint32_t handle; +}; + +struct iris_syncpt *iris_create_syncpt(struct iris_screen *screen); +void iris_syncpt_destroy(struct iris_screen *, struct iris_syncpt *); +void iris_batch_add_syncpt(struct iris_batch *batch, + struct iris_syncpt *syncpt, + unsigned flags); + +static inline void +iris_syncpt_reference(struct iris_screen *screen, + struct iris_syncpt **dst, + struct iris_syncpt *src) +{ + if (pipe_reference(&(*dst)->ref, &src->ref)) + iris_syncpt_destroy(screen, *dst); + + *dst = src; +} + +#endif |