5e0516d0c1555f5751be2489ed9971908cd6b274
[mesa.git] / src / mesa / pipe / cell / spu / main.h
1 /**************************************************************************
2 *
3 * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27
28 #ifndef MAIN_H
29 #define MAIN_H
30
31
32 #include <libmisc.h>
33 #include <spu_mfcio.h>
34 #include "pipe/cell/common.h"
35
36
37 extern volatile struct cell_init_info init;
38
39 struct framebuffer {
40 void *color_start; /**< addr of color surface in main memory */
41 void *depth_start; /**< addr of depth surface in main memory */
42 enum pipe_format color_format;
43 enum pipe_format depth_format;
44 uint width, height; /**< size in pixels */
45 uint width_tiles, height_tiles; /**< width and height in tiles */
46 };
47
48 /* XXX Collect these globals in a struct: */
49
50 extern struct framebuffer fb;
51
52 extern uint ctile[TILE_SIZE][TILE_SIZE] ALIGN16_ATTRIB;
53 extern ushort ztile[TILE_SIZE][TILE_SIZE] ALIGN16_ATTRIB;
54
55 extern int DefaultTag;
56
57
58 void
59 wait_on_mask(unsigned tag);
60
61 void
62 get_tile(const struct framebuffer *fb, uint tx, uint ty, uint *tile,
63 int tag, int zBuf);
64
65 void
66 put_tile(const struct framebuffer *fb, uint tx, uint ty, const uint *tile,
67 int tag, int zBuf);
68
69
70 #endif /* MAIN_H */