2 * Copyright © 2009 Corbin Simpson
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:
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.
22 * The above copyright notice and this permission notice (including the
23 * next paragraph) shall be included in all copies or substantial portions
28 * Corbin Simpson <MostAwesomeDude@gmail.com>
30 #ifndef RADEON_WINSYS_H
31 #define RADEON_WINSYS_H
33 #include "util/u_simple_screen.h"
35 struct radeon_winsys_priv
;
37 struct radeon_winsys
{
39 struct pipe_winsys base
;
42 struct radeon_winsys_priv
* priv
;
50 /* Z pipe count (rv530 only) */
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
,
65 /* Revalidate all currently setup pipe_buffers.
66 * Returns TRUE if a flush is required. */
67 boolean (*validate
)(struct radeon_winsys
* winsys
);
69 /* Check to see if there's room for commands. */
70 boolean (*check_cs
)(struct radeon_winsys
* winsys
, int size
);
72 /* Start a command emit. */
73 void (*begin_cs
)(struct radeon_winsys
* winsys
,
79 /* Write a dword to the command buffer. */
80 void (*write_cs_dword
)(struct radeon_winsys
* winsys
, uint32_t dword
);
82 /* Write a relocated dword to the command buffer. */
83 void (*write_cs_reloc
)(struct radeon_winsys
* winsys
,
84 struct pipe_buffer
* bo
,
89 /* Finish a command emit. */
90 void (*end_cs
)(struct radeon_winsys
* winsys
,
96 void (*flush_cs
)(struct radeon_winsys
* winsys
);
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
);
102 void (*reset_bos
)(struct radeon_winsys
*winsys
);
104 void (*buffer_set_tiling
)(struct radeon_winsys
* winsys
,
105 struct pipe_buffer
* buffer
,