1 /* 2 * Copyright © 2023 Google, Inc. 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the 9 * Software is furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice (including the next 12 * paragraph) shall be included in all copies or substantial portions of the 13 * Software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 * SOFTWARE. 22 */ 23 24 #ifndef FD6_BARRIER_H_ 25 #define FD6_BARRIER_H_ 26 27 #include "freedreno_context.h" 28 29 /** 30 * Various flush operations that could be needed 31 */ 32 enum fd6_flush { 33 FD6_FLUSH_CCU_COLOR = BIT(0), 34 FD6_FLUSH_CCU_DEPTH = BIT(1), 35 FD6_INVALIDATE_CCU_COLOR = BIT(2), 36 FD6_INVALIDATE_CCU_DEPTH = BIT(3), 37 FD6_FLUSH_CACHE = BIT(4), 38 FD6_INVALIDATE_CACHE = BIT(5), 39 FD6_WAIT_MEM_WRITES = BIT(6), 40 FD6_WAIT_FOR_IDLE = BIT(7), 41 FD6_WAIT_FOR_ME = BIT(8), 42 }; 43 44 void fd6_emit_flushes(struct fd_context *ctx, struct fd_ringbuffer *ring, 45 unsigned flushes); 46 47 void fd6_barrier_flush(struct fd_batch *batch) assert_dt; 48 49 void fd6_barrier_init(struct pipe_context *pctx); 50 51 #endif /* FD6_BARRIER_H_ */ 52