Path: blob/21.2-virgl/src/gallium/drivers/etnaviv/etnaviv_debug.h
4570 views
/*1* Copyright (c) 2012-2013 Etnaviv Project2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sub license,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice (including the11* next paragraph) shall be included in all copies or substantial portions12* of the Software.13*14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR15* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,16* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL17* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER18* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING19* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER20* DEALINGS IN THE SOFTWARE.21*/2223/* Common debug stuffl */24#ifndef H_ETNA_DEBUG25#define H_ETNA_DEBUG2627#include "util/u_debug.h"2829#include <stdint.h>30#include <stdio.h>31#include <stdlib.h>3233/* Logging */34#define ETNA_DBG_MSGS 0x1 /* Warnings and non-fatal errors */35#define ETNA_DBG_FRAME_MSGS 0x236#define ETNA_DBG_RESOURCE_MSGS 0x437#define ETNA_DBG_COMPILER_MSGS 0x838#define ETNA_DBG_LINKER_MSGS 0x1039#define ETNA_DBG_DUMP_SHADERS 0x204041/* Bypasses */42#define ETNA_DBG_NO_TS 0x1000 /* Disable TS */43#define ETNA_DBG_NO_AUTODISABLE 0x2000 /* Disable autodisable */44#define ETNA_DBG_NO_SUPERTILE 0x4000 /* Disable supertile */45#define ETNA_DBG_NO_EARLY_Z 0x8000 /* Disable early z */46#define ETNA_DBG_CFLUSH_ALL 0x10000 /* Flush before every state update + draw call */47#define ETNA_DBG_MSAA_2X 0x20000 /* Force 2X MSAA for screen */48#define ETNA_DBG_MSAA_4X 0x40000 /* Force 4X MSAA for screen */49#define ETNA_DBG_FINISH_ALL 0x80000 /* Finish on every flush */50#define ETNA_DBG_FLUSH_ALL 0x100000 /* Flush after every rendered primitive */51#define ETNA_DBG_ZERO 0x200000 /* Zero all resources after allocation */52#define ETNA_DBG_DRAW_STALL 0x400000 /* Stall FE/PE after every draw op */53#define ETNA_DBG_SHADERDB 0x800000 /* dump program compile information */54#define ETNA_DBG_NO_SINGLEBUF 0x1000000 /* disable single buffer feature */55#define ETNA_DBG_NIR 0x2000000 /* use new NIR compiler */56#define ETNA_DBG_DEQP 0x4000000 /* Hacks to run dEQP GLES3 tests */57#define ETNA_DBG_NOCACHE 0x8000000 /* Disable shader cache */5859extern int etna_mesa_debug; /* set in etnaviv_screen.c from ETNA_MESA_DEBUG */6061#define DBG_ENABLED(flag) unlikely(etna_mesa_debug & (flag))6263#define DBG_F(flag, fmt, ...) \64do { \65if (etna_mesa_debug & (flag)) \66debug_printf("%s:%d: " fmt "\n", __FUNCTION__, __LINE__, \67##__VA_ARGS__); \68} while (0)6970#define DBG(fmt, ...) \71do { \72if (etna_mesa_debug & ETNA_DBG_MSGS) \73debug_printf("%s:%d: " fmt "\n", __FUNCTION__, __LINE__, \74##__VA_ARGS__); \75} while (0)7677/* A serious bug, show this even in non-debug mode */78#define BUG(fmt, ...) \79do { \80printf("%s:%d: " fmt "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__); \81} while (0)8283#endif848586