Path: blob/21.2-virgl/src/broadcom/common/v3d_debug.h
4560 views
/*1* Copyright 2003 VMware, Inc.2* Copyright © 2007 Intel Corporation3*4* Permission is hereby granted, free of charge, to any person obtaining5* a copy of this software and associated documentation files (the6* "Software"), to deal in the Software without restriction, including7* without limitation the rights to use, copy, modify, merge, publish,8* distribute, sublicense, and/or sell copies of the Software, and to9* permit persons to whom the Software is furnished to do so, subject to10* the following conditions:11*12* The above copyright notice and this permission notice (including the13* next paragraph) shall be included in all copies or substantial14* portions of the Software.15*16* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,17* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF18* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.19* IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE20* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION21* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION22* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.23*/2425#ifndef MESA_V3D_DEBUG_H26#define MESA_V3D_DEBUG_H2728#include <stdint.h>29#include "compiler/shader_enums.h"3031#ifdef __cplusplus32extern "C" {33#endif34/**35* \file v3d_debug.h36*37* Basic V3D_DEBUG environment variable handling. This file defines the38* list of debugging flags, as well as some macros for handling them.39*/4041extern uint32_t V3D_DEBUG;4243#define V3D_DEBUG_SHADERDB (1 << 0)44#define V3D_DEBUG_TGSI (1 << 1)45#define V3D_DEBUG_NIR (1 << 2)46#define V3D_DEBUG_VIR (1 << 3)47#define V3D_DEBUG_QPU (1 << 4)48#define V3D_DEBUG_FS (1 << 5)49#define V3D_DEBUG_GS (1 << 6)50#define V3D_DEBUG_VS (1 << 7)51#define V3D_DEBUG_CS (1 << 8)52#define V3D_DEBUG_CL (1 << 9)53#define V3D_DEBUG_SURFACE (1 << 10)54#define V3D_DEBUG_PERF (1 << 11)55#define V3D_DEBUG_NORAST (1 << 12)56#define V3D_DEBUG_ALWAYS_FLUSH (1 << 13)57#define V3D_DEBUG_CLIF (1 << 14)58#define V3D_DEBUG_PRECOMPILE (1 << 15)59#define V3D_DEBUG_RA (1 << 16)60#define V3D_DEBUG_DUMP_SPIRV (1 << 17)6162#define V3D_DEBUG_SHADERS (V3D_DEBUG_TGSI | V3D_DEBUG_NIR | \63V3D_DEBUG_VIR | V3D_DEBUG_QPU | \64V3D_DEBUG_FS | V3D_DEBUG_GS | \65V3D_DEBUG_VS | V3D_DEBUG_CS | \66V3D_DEBUG_RA)6768#ifdef HAVE_ANDROID_PLATFORM69#define LOG_TAG "BROADCOM-MESA"70#if ANDROID_API_LEVEL >= 2671#include <log/log.h>72#else73#include <cutils/log.h>74#endif /* use log/log.h start from android 8 major version */75#ifndef ALOGW76#define ALOGW LOGW77#endif78#define dbg_printf(...) ALOGW(__VA_ARGS__)79#else80#define dbg_printf(...) fprintf(stderr, __VA_ARGS__)81#endif /* HAVE_ANDROID_PLATFORM */8283#define DBG(flag, ...) do { \84if (unlikely(V3D_DEBUG & (flag))) \85dbg_printf(__VA_ARGS__); \86} while(0)8788extern uint32_t v3d_debug_flag_for_shader_stage(gl_shader_stage stage);8990extern void v3d_process_debug_variable(void);9192#ifdef __cplusplus93}94#endif9596#endif /* V3D_DEBUG_H */979899