Path: blob/21.2-virgl/src/gallium/drivers/r300/r300_screen.h
4570 views
/*1* Copyright 2008 Corbin Simpson <[email protected]>2* Copyright 2010 Marek Olšák <[email protected]>3*4* Permission is hereby granted, free of charge, to any person obtaining a5* copy of this software and associated documentation files (the "Software"),6* to deal in the Software without restriction, including without limitation7* on the rights to use, copy, modify, merge, publish, distribute, sub8* license, and/or sell copies of the Software, and to permit persons to whom9* the Software is furnished to do so, subject to the following conditions:10*11* The above copyright notice and this permission notice (including the next12* paragraph) shall be included in all copies or substantial portions of the13* Software.14*15* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR16* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,17* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL18* THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,19* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR20* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE21* USE OR OTHER DEALINGS IN THE SOFTWARE. */2223#ifndef R300_SCREEN_H24#define R300_SCREEN_H2526#include "r300_chipset.h"27#include "radeon/radeon_winsys.h"28#include "pipe/p_screen.h"29#include "util/disk_cache.h"30#include "util/slab.h"31#include "os/os_thread.h"32#include <stdio.h>3334struct r300_screen {35/* Parent class */36struct pipe_screen screen;3738struct radeon_winsys *rws;3940/* Chipset info and capabilities. */41struct radeon_info info;42struct r300_capabilities caps;4344/** Combination of DBG_xxx flags */45unsigned debug;4647struct disk_cache *disk_shader_cache;4849struct slab_parent_pool pool_transfers;5051/* The MSAA texture with CMASK access; */52struct pipe_resource *cmask_resource;53mtx_t cmask_mutex;54};555657/* Convenience cast wrappers. */58static inline struct r300_screen* r300_screen(struct pipe_screen* screen) {59return (struct r300_screen*)screen;60}6162static inline struct radeon_winsys *63radeon_winsys(struct pipe_screen *screen) {64return r300_screen(screen)->rws;65}6667/* Debug functionality. */6869/**70* Debug flags to disable/enable certain groups of debugging outputs.71*72* \note These may be rather coarse, and the grouping may be impractical.73* If you find, while debugging the driver, that a different grouping74* of these flags would be beneficial, just feel free to change them75* but make sure to update the documentation in r300_debug.c to reflect76* those changes.77*/78/*@{*/7980/* Logging. */81#define DBG_PSC (1 << 0)82#define DBG_FP (1 << 1)83#define DBG_VP (1 << 2)84#define DBG_SWTCL (1 << 3)85#define DBG_DRAW (1 << 4)86#define DBG_TEX (1 << 5)87#define DBG_TEXALLOC (1 << 6)88#define DBG_RS (1 << 7)89#define DBG_FB (1 << 8)90#define DBG_RS_BLOCK (1 << 9)91#define DBG_CBZB (1 << 10)92#define DBG_HYPERZ (1 << 11)93#define DBG_SCISSOR (1 << 12)94#define DBG_INFO (1 << 13)95#define DBG_MSAA (1 << 14)96/* Features. */97#define DBG_ANISOHQ (1 << 16)98#define DBG_NO_TILING (1 << 17)99#define DBG_NO_IMMD (1 << 18)100#define DBG_NO_OPT (1 << 19)101#define DBG_NO_CBZB (1 << 20)102#define DBG_NO_ZMASK (1 << 21)103#define DBG_NO_HIZ (1 << 22)104#define DBG_NO_CMASK (1 << 23)105/* Statistics. */106#define DBG_P_STAT (1 << 25)107/*@}*/108109static inline boolean SCREEN_DBG_ON(struct r300_screen * screen, unsigned flags)110{111return (screen->debug & flags) ? TRUE : FALSE;112}113114static inline void SCREEN_DBG(struct r300_screen * screen, unsigned flags,115const char * fmt, ...)116{117if (SCREEN_DBG_ON(screen, flags)) {118va_list va;119va_start(va, fmt);120vfprintf(stderr, fmt, va);121va_end(va);122}123}124125void r300_init_debug(struct r300_screen* ctx);126127void r300_init_screen_resource_functions(struct r300_screen *r300screen);128129#endif /* R300_SCREEN_H */130131132