2 * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
3 * Copyright 2010 Marek Olšák <maraeo@gmail.com>
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * on the rights to use, copy, modify, merge, publish, distribute, sub
9 * license, and/or sell copies of the Software, and to permit persons to whom
10 * the Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
20 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
22 * USE OR OTHER DEALINGS IN THE SOFTWARE. */
27 #include "r300_chipset.h"
28 #include "../../winsys/radeon/drm/radeon_winsys.h"
29 #include "pipe/p_screen.h"
30 #include "util/u_slab.h"
35 struct pipe_screen screen
;
37 struct radeon_winsys
*rws
;
39 /* Chipset info and capabilities. */
40 struct radeon_info info
;
41 struct r300_capabilities caps
;
43 /** Combination of DBG_xxx flags */
48 /* Convenience cast wrappers. */
49 static INLINE
struct r300_screen
* r300_screen(struct pipe_screen
* screen
) {
50 return (struct r300_screen
*)screen
;
53 static INLINE
struct radeon_winsys
*
54 radeon_winsys(struct pipe_screen
*screen
) {
55 return r300_screen(screen
)->rws
;
58 /* Debug functionality. */
61 * Debug flags to disable/enable certain groups of debugging outputs.
63 * \note These may be rather coarse, and the grouping may be impractical.
64 * If you find, while debugging the driver, that a different grouping
65 * of these flags would be beneficial, just feel free to change them
66 * but make sure to update the documentation in r300_debug.c to reflect
72 #define DBG_PSC (1 << 0)
73 #define DBG_FP (1 << 1)
74 #define DBG_VP (1 << 2)
75 #define DBG_SWTCL (1 << 3)
76 #define DBG_DRAW (1 << 4)
77 #define DBG_TEX (1 << 5)
78 #define DBG_TEXALLOC (1 << 6)
79 #define DBG_RS (1 << 7)
80 #define DBG_FB (1 << 8)
81 #define DBG_RS_BLOCK (1 << 9)
82 #define DBG_CBZB (1 << 10)
83 #define DBG_HYPERZ (1 << 11)
84 #define DBG_SCISSOR (1 << 12)
85 #define DBG_INFO (1 << 13)
87 #define DBG_ANISOHQ (1 << 16)
88 #define DBG_NO_TILING (1 << 17)
89 #define DBG_NO_IMMD (1 << 18)
90 #define DBG_NO_OPT (1 << 19)
91 #define DBG_NO_CBZB (1 << 20)
92 #define DBG_NO_ZMASK (1 << 21)
93 #define DBG_NO_HIZ (1 << 22)
95 #define DBG_P_STAT (1 << 25)
98 static INLINE boolean
SCREEN_DBG_ON(struct r300_screen
* screen
, unsigned flags
)
100 return (screen
->debug
& flags
) ? TRUE
: FALSE
;
103 static INLINE
void SCREEN_DBG(struct r300_screen
* screen
, unsigned flags
,
104 const char * fmt
, ...)
106 if (SCREEN_DBG_ON(screen
, flags
)) {
109 vfprintf(stderr
, fmt
, va
);
114 void r300_init_debug(struct r300_screen
* ctx
);
116 void r300_init_screen_resource_functions(struct r300_screen
*r300screen
);
118 #endif /* R300_SCREEN_H */