Path: blob/21.2-virgl/src/gallium/auxiliary/util/u_debug_flush.h
4561 views
/**************************************************************************1*2* Copyright 2012 VMware, Inc.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* The above copyright notice and this permission notice (including the14* next paragraph) shall be included in all copies or substantial portions15* of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS18* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.20* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR21* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,22* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE23* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.24*25**************************************************************************/2627/**28* @file29* u_debug_flush.h - Header for debugging flush- and map- related issues.30* - Flush while synchronously mapped.31* - Command stream reference while synchronously mapped.32* - Synchronous map while referenced on command stream.33* - Recursive maps.34* - Unmap while not mapped.35*36* @author Thomas Hellstrom <[email protected]>37*/38#ifdef DEBUG3940#ifndef U_DEBUG_FLUSH_H_41#define U_DEBUG_FLUSH_H_4243struct debug_flush_buf;44struct debug_flush_ctx;4546/**47* Create a buffer (AKA allocation) representation.48*49* @param supports_persistent Whether persistent maps are truly supported.50* @param bt_depth Depth of backtrace to be captured for this buffer51* representation.52*/53struct debug_flush_buf *54debug_flush_buf_create(boolean supports_persistent, unsigned bt_depth);5556/**57* Reference a buffer representation.58*59* @param dst Pointer copy destination60* @param src Pointer copy source (may be NULL).61*62* Replace a pointer to a buffer representation with proper refcounting.63*/64void65debug_flush_buf_reference(struct debug_flush_buf **dst,66struct debug_flush_buf *src);6768/**69* Create a context representation.70*71* @param catch_map_of_referenced Whether to catch synchronous maps of buffers72* already present on the command stream.73* @param bt_depth Depth of backtrace to be captured for this context74* representation.75*/76struct debug_flush_ctx *77debug_flush_ctx_create(boolean catch_map_of_referenced, unsigned bt_depth);7879/**80* Destroy a context representation.81*82* @param fctx The context representation to destroy.83*/84void85debug_flush_ctx_destroy(struct debug_flush_ctx *fctx);8687/**88* Map annotation89*90* @param fbuf The buffer representation to map.91* @param flags Pipebuffer flags for the map.92*93* Used to annotate a map of the buffer described by the buffer representation.94*/95void debug_flush_map(struct debug_flush_buf *fbuf, unsigned flags);9697/**98* Unmap annotation99*100* @param fbuf The buffer representation to map.101*102* Used to annotate an unmap of the buffer described by the103* buffer representation.104*/105void debug_flush_unmap(struct debug_flush_buf *fbuf);106107/**108* Might flush annotation109*110* @param fctx The context representation that might be flushed.111*112* Used to annotate a conditional (possible) flush of the given context.113*/114void debug_flush_might_flush(struct debug_flush_ctx *fctx);115116/**117* Flush annotation118*119* @param fctx The context representation that is flushed.120*121* Used to annotate a real flush of the given context.122*/123void debug_flush_flush(struct debug_flush_ctx *fctx);124125126/**127* Flush annotation128*129* @param fctx The context representation that is flushed.130*131* Used to annotate a real flush of the given context.132*/133void debug_flush_cb_reference(struct debug_flush_ctx *fctx,134struct debug_flush_buf *fbuf);135136#endif137#endif138139140