r600: don't enable depth test if there is no depth buffer
[mesa.git] / src / gallium / winsys / drm / radeon / core / radeon_winsys.h
1 /*
2 * Copyright © 2009 Corbin Simpson
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining
6 * a copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sub license, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
12 *
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
15 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16 * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS
17 * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 * USE OR OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * The above copyright notice and this permission notice (including the
23 * next paragraph) shall be included in all copies or substantial portions
24 * of the Software.
25 */
26 /*
27 * Authors:
28 * Corbin Simpson <MostAwesomeDude@gmail.com>
29 */
30 #ifndef RADEON_WINSYS_H
31 #define RADEON_WINSYS_H
32
33 #include "util/u_simple_screen.h"
34
35 struct radeon_winsys_priv;
36
37 struct radeon_winsys {
38 /* Parent class. */
39 struct pipe_winsys base;
40
41 /* Winsys private */
42 struct radeon_winsys_priv* priv;
43
44 /* PCI ID */
45 uint32_t pci_id;
46
47 /* GB pipe count */
48 uint32_t gb_pipes;
49
50 /* Z pipe count (rv530 only) */
51 uint32_t z_pipes;
52
53 /* GART size. */
54 uint32_t gart_size;
55
56 /* VRAM size. */
57 uint32_t vram_size;
58
59 /* Add a pipe_buffer to the list of buffer objects to validate. */
60 boolean (*add_buffer)(struct radeon_winsys* winsys,
61 struct pipe_buffer* pbuffer,
62 uint32_t rd,
63 uint32_t wd);
64
65 /* Revalidate all currently setup pipe_buffers.
66 * Returns TRUE if a flush is required. */
67 boolean (*validate)(struct radeon_winsys* winsys);
68
69 /* Check to see if there's room for commands. */
70 boolean (*check_cs)(struct radeon_winsys* winsys, int size);
71
72 /* Start a command emit. */
73 void (*begin_cs)(struct radeon_winsys* winsys,
74 int size,
75 const char* file,
76 const char* function,
77 int line);
78
79 /* Write a dword to the command buffer. */
80 void (*write_cs_dword)(struct radeon_winsys* winsys, uint32_t dword);
81
82 /* Write a relocated dword to the command buffer. */
83 void (*write_cs_reloc)(struct radeon_winsys* winsys,
84 struct pipe_buffer* bo,
85 uint32_t rd,
86 uint32_t wd,
87 uint32_t flags);
88
89 /* Finish a command emit. */
90 void (*end_cs)(struct radeon_winsys* winsys,
91 const char* file,
92 const char* function,
93 int line);
94
95 /* Flush the CS. */
96 void (*flush_cs)(struct radeon_winsys* winsys);
97
98 /* winsys flush - callback from winsys when flush required */
99 void (*set_flush_cb)(struct radeon_winsys *winsys,
100 void (*flush_cb)(void *), void *data);
101
102 void (*reset_bos)(struct radeon_winsys *winsys);
103
104 void (*buffer_set_tiling)(struct radeon_winsys* winsys,
105 struct pipe_buffer* buffer,
106 uint32_t pitch,
107 boolean microtiled,
108 boolean macrotiled);
109 };
110
111 #endif