1 /* 2 * Copyright (c) 2008-2024 Broadcom. All Rights Reserved. 3 * The term “Broadcom” refers to Broadcom Inc. 4 * and/or its subsidiaries. 5 * SPDX-License-Identifier: MIT 6 */ 7 8 #ifndef SVGA_DEBUG_H 9 #define SVGA_DEBUG_H 10 11 #include "util/compiler.h" 12 #include "util/u_debug.h" 13 14 #define DEBUG_DMA 0x1 15 #define DEBUG_TGSI 0x4 16 #define DEBUG_PIPE 0x8 17 #define DEBUG_STATE 0x10 18 #define DEBUG_SCREEN 0x20 19 #define DEBUG_TEX 0x40 20 #define DEBUG_SWTNL 0x80 21 #define DEBUG_CONSTS 0x100 22 #define DEBUG_VIEWPORT 0x200 23 #define DEBUG_VIEWS 0x400 24 #define DEBUG_PERF 0x800 /* print something when we hit any slow path operation */ 25 #define DEBUG_FLUSH 0x1000 /* flush after every draw */ 26 #define DEBUG_SYNC 0x2000 /* sync after every flush */ 27 #define DEBUG_QUERY 0x4000 28 #define DEBUG_CACHE 0x8000 29 #define DEBUG_STREAMOUT 0x10000 30 #define DEBUG_SAMPLERS 0x20000 31 #define DEBUG_IMAGE 0x40000 32 #define DEBUG_UAV 0x80000 33 #define DEBUG_RETRY 0x100000 34 35 #if MESA_DEBUG 36 extern int SVGA_DEBUG; 37 #define DBSTR(x) x 38 #else 39 #define SVGA_DEBUG 0 40 #define DBSTR(x) "" 41 #endif 42 43 static inline void SVGA_DBG(unsigned flag,const char * fmt,...)44SVGA_DBG( unsigned flag, const char *fmt, ... ) 45 { 46 #if MESA_DEBUG 47 if (SVGA_DEBUG & flag) 48 { 49 va_list args; 50 51 va_start( args, fmt ); 52 debug_vprintf( fmt, args ); 53 va_end( args ); 54 } 55 #else 56 (void)flag; 57 (void)fmt; 58 #endif 59 } 60 61 62 #endif 63