1848b8605Smrg/************************************************************************** 2848b8605Smrg * 3848b8605Smrg * Copyright 2007 VMware, Inc. 4848b8605Smrg * All Rights Reserved. 5848b8605Smrg * 6848b8605Smrg * Permission is hereby granted, free of charge, to any person obtaining a 7848b8605Smrg * copy of this software and associated documentation files (the 8848b8605Smrg * "Software"), to deal in the Software without restriction, including 9848b8605Smrg * without limitation the rights to use, copy, modify, merge, publish, 10848b8605Smrg * distribute, sub license, and/or sell copies of the Software, and to 11848b8605Smrg * permit persons to whom the Software is furnished to do so, subject to 12848b8605Smrg * the following conditions: 13848b8605Smrg * 14848b8605Smrg * The above copyright notice and this permission notice (including the 15848b8605Smrg * next paragraph) shall be included in all copies or substantial portions 16848b8605Smrg * of the Software. 17848b8605Smrg * 18848b8605Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19848b8605Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20848b8605Smrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 21848b8605Smrg * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR 22848b8605Smrg * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23848b8605Smrg * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24848b8605Smrg * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25848b8605Smrg * 26848b8605Smrg **************************************************************************/ 27848b8605Smrg 28848b8605Smrg/* Authors: Keith Whitwell <keithw@vmware.com> 29848b8605Smrg * Jakob Bornecrantz <wallbraker@gmail.com> 30848b8605Smrg */ 31848b8605Smrg 32848b8605Smrg#ifndef I915_DEBUG_H 33848b8605Smrg#define I915_DEBUG_H 34848b8605Smrg 35848b8605Smrg#include "util/u_debug.h" 36848b8605Smrg 37848b8605Smrgstruct i915_screen; 38848b8605Smrgstruct i915_context; 39848b8605Smrgstruct i915_winsys_batchbuffer; 40848b8605Smrg 41848b8605Smrg#define DBG_BLIT 0x1 42848b8605Smrg#define DBG_EMIT 0x2 43848b8605Smrg#define DBG_ATOMS 0x4 44848b8605Smrg#define DBG_FLUSH 0x8 45848b8605Smrg#define DBG_TEXTURE 0x10 46848b8605Smrg#define DBG_CONSTANTS 0x20 47848b8605Smrg 48848b8605Smrgextern unsigned i915_debug; 49848b8605Smrg 50848b8605Smrg#ifdef DEBUG 51b8e80941Smrgstatic inline boolean 52848b8605SmrgI915_DBG_ON(unsigned flags) 53848b8605Smrg{ 54848b8605Smrg return i915_debug & flags; 55848b8605Smrg} 56848b8605Smrg 57b8e80941Smrgstatic inline void 58848b8605SmrgI915_DBG(unsigned flags, const char *fmt, ...) 59848b8605Smrg{ 60848b8605Smrg if (I915_DBG_ON(flags)) { 61848b8605Smrg va_list args; 62848b8605Smrg 63848b8605Smrg va_start(args, fmt); 64848b8605Smrg debug_vprintf(fmt, args); 65848b8605Smrg va_end(args); 66848b8605Smrg } 67848b8605Smrg} 68848b8605Smrg#else 69848b8605Smrg#define I915_DBG_ON(flags) (0) 70b8e80941Smrgstatic inline void I915_DBG(unsigned flags, const char *fmt, ...) {} 71848b8605Smrg#endif 72848b8605Smrg 73848b8605Smrgvoid i915_debug_init(struct i915_screen *i915); 74848b8605Smrg 75848b8605Smrgvoid i915_dump_batchbuffer(struct i915_winsys_batchbuffer *i915); 76848b8605Smrg 77848b8605Smrgvoid i915_dump_dirty(struct i915_context *i915, const char *func); 78848b8605Smrg 79848b8605Smrgvoid i915_dump_hardware_dirty(struct i915_context *i915, const char *func); 80848b8605Smrg 81848b8605Smrg#endif 82