Home | History | Annotate | Download | only in svga
      1 /**********************************************************
      2  * Copyright 2008-2009 VMware, Inc.  All rights reserved.
      3  *
      4  * Permission is hereby granted, free of charge, to any person
      5  * obtaining a copy of this software and associated documentation
      6  * files (the "Software"), to deal in the Software without
      7  * restriction, including without limitation the rights to use, copy,
      8  * modify, merge, publish, distribute, sublicense, and/or sell copies
      9  * of the Software, and to permit persons to whom the Software is
     10  * furnished to do so, subject to the following conditions:
     11  *
     12  * The above copyright notice and this permission notice shall be
     13  * included in all copies or substantial portions of the Software.
     14  *
     15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
     16  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
     17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
     18  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
     19  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
     20  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
     21  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
     22  * SOFTWARE.
     23  *
     24  **********************************************************/
     25 
     26 #ifndef SVGA_DEBUG_H
     27 #define SVGA_DEBUG_H
     28 
     29 #include "pipe/p_compiler.h"
     30 #include "util/u_debug.h"
     31 
     32 #define DEBUG_DMA          0x1
     33 #define DEBUG_TGSI         0x4
     34 #define DEBUG_PIPE         0x8
     35 #define DEBUG_STATE        0x10
     36 #define DEBUG_SCREEN       0x20
     37 #define DEBUG_TEX          0x40
     38 #define DEBUG_SWTNL        0x80
     39 #define DEBUG_CONSTS       0x100
     40 #define DEBUG_VIEWPORT     0x200
     41 #define DEBUG_VIEWS        0x400
     42 #define DEBUG_PERF         0x800    /* print something when we hit any slow path operation */
     43 #define DEBUG_FLUSH        0x1000   /* flush after every draw */
     44 #define DEBUG_SYNC         0x2000   /* sync after every flush */
     45 #define DEBUG_QUERY        0x4000
     46 #define DEBUG_CACHE        0x8000
     47 #define DEBUG_STREAMOUT    0x10000
     48 
     49 #ifdef DEBUG
     50 extern int SVGA_DEBUG;
     51 #define DBSTR(x) x
     52 #else
     53 #define SVGA_DEBUG 0
     54 #define DBSTR(x) ""
     55 #endif
     56 
     57 static inline void
     58 SVGA_DBG( unsigned flag, const char *fmt, ... )
     59 {
     60 #ifdef DEBUG
     61     if (SVGA_DEBUG & flag)
     62     {
     63         va_list args;
     64 
     65         va_start( args, fmt );
     66         debug_vprintf( fmt, args );
     67         va_end( args );
     68     }
     69 #else
     70     (void)flag;
     71     (void)fmt;
     72 #endif
     73 }
     74 
     75 
     76 #endif
     77