502fbfa5a24a1ce4ed6ba74cbb2954cfac5007b6
2 * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * on the rights to use, copy, modify, merge, publish, distribute, sub
8 * license, and/or sell copies of the Software, and to permit persons to whom
9 * the Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21 * USE OR OTHER DEALINGS IN THE SOFTWARE. */
26 #include "pipe/p_screen.h"
28 #include "r300_chipset.h"
34 struct pipe_screen screen
;
36 struct radeon_winsys
* radeon_winsys
;
38 /* Chipset capabilities */
39 struct r300_capabilities
* caps
;
41 /** Combination of DBG_xxx flags */
45 struct r300_transfer
{
47 struct pipe_transfer transfer
;
49 /* Offset from start of buffer. */
53 /* Convenience cast wrapper. */
54 static INLINE
struct r300_screen
* r300_screen(struct pipe_screen
* screen
) {
55 return (struct r300_screen
*)screen
;
58 /* Convenience cast wrapper. */
59 static INLINE
struct r300_transfer
*
60 r300_transfer(struct pipe_transfer
* transfer
)
62 return (struct r300_transfer
*)transfer
;
65 /* Debug functionality. */
68 * Debug flags to disable/enable certain groups of debugging outputs.
70 * \note These may be rather coarse, and the grouping may be impractical.
71 * If you find, while debugging the driver, that a different grouping
72 * of these flags would be beneficial, just feel free to change them
73 * but make sure to update the documentation in r300_debug.c to reflect
77 #define DBG_HELP 0x0000001
78 #define DBG_FP 0x0000002
79 #define DBG_VP 0x0000004
80 #define DBG_CS 0x0000008
81 #define DBG_DRAW 0x0000010
82 #define DBG_TEX 0x0000020
83 #define DBG_FALL 0x0000040
86 static INLINE boolean
SCREEN_DBG_ON(struct r300_screen
* screen
, unsigned flags
)
88 return (screen
->debug
& flags
) ? TRUE
: FALSE
;
91 static INLINE
void SCREEN_DBG(struct r300_screen
* screen
, unsigned flags
,
92 const char * fmt
, ...)
94 if (SCREEN_DBG_ON(screen
, flags
)) {
97 debug_vprintf(fmt
, va
);
102 void r300_init_debug(struct r300_screen
* ctx
);
104 #endif /* R300_SCREEN_H */