ENGR00156850 gpu-viv: add gpu-viv driver source
[wandboard.git] / drivers / mxc / gpu-viv / arch / XAQ2 / hal / kernel / gc_hal_kernel_context.h
bloba1b189ae5e80df16a97c267a50eca9ebcc0834b6
1 /****************************************************************************
3 * Copyright (C) 2005 - 2011 by Vivante Corp.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the license, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 *****************************************************************************/
24 #ifndef __gc_hal_kernel_context_h_
25 #define __gc_hal_kernel_context_h_
27 #include "gc_hal_kernel_buffer.h"
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
33 /* Maps state locations within the context buffer. */
34 typedef struct _gcsSTATE_MAP * gcsSTATE_MAP_PTR;
35 typedef struct _gcsSTATE_MAP
37 /* Index of the state in the context buffer. */
38 gctUINT index;
40 /* State mask. */
41 gctUINT32 mask;
43 gcsSTATE_MAP;
45 /* Context buffer. */
46 typedef struct _gcsCONTEXT * gcsCONTEXT_PTR;
47 typedef struct _gcsCONTEXT
49 /* For debugging: the number of context buffer in the order of creation. */
50 #if gcmIS_DEBUG(gcdDEBUG_CODE)
51 gctUINT num;
52 #endif
54 /* Pointer to gckEVENT object. */
55 gckEVENT eventObj;
57 /* Context busy signal. */
58 gctSIGNAL signal;
60 /* Physical address of the context buffer. */
61 gctPHYS_ADDR physical;
63 /* Logical address of the context buffer. */
64 gctUINT32_PTR logical;
66 /* Pointer to the LINK commands. */
67 gctPOINTER link2D;
68 gctPOINTER link3D;
70 /* The number of pending state deltas. */
71 gctUINT deltaCount;
73 /* Pointer to the first delta to be applied. */
74 gcsSTATE_DELTA_PTR delta;
76 /* Next context buffer. */
77 gcsCONTEXT_PTR next;
79 gcsCONTEXT;
81 /* gckCONTEXT structure that hold the current context. */
82 struct _gckCONTEXT
84 /* Object. */
85 gcsOBJECT object;
87 /* Pointer to gckOS object. */
88 gckOS os;
90 /* Pointer to gckHARDWARE object. */
91 gckHARDWARE hardware;
93 /* Command buffer alignment. */
94 gctSIZE_T alignment;
95 gctSIZE_T reservedHead;
96 gctSIZE_T reservedTail;
98 /* Context buffer metrics. */
99 gctSIZE_T stateCount;
100 gctSIZE_T totalSize;
101 gctSIZE_T bufferSize;
102 gctUINT32 linkIndex2D;
103 gctUINT32 linkIndex3D;
104 gctUINT32 linkIndexXD;
105 gctUINT32 entryOffset3D;
106 gctUINT32 entryOffsetXDFrom2D;
107 gctUINT32 entryOffsetXDFrom3D;
109 /* Dirty flags. */
110 gctBOOL dirty;
111 gctBOOL dirty2D;
112 gctBOOL dirty3D;
113 gcsCONTEXT_PTR dirtyBuffer;
115 /* State mapping. */
116 gcsSTATE_MAP_PTR map;
118 /* List of context buffers. */
119 gcsCONTEXT_PTR buffer;
121 /* A copy of the user record array. */
122 gctUINT recordArraySize;
123 gcsSTATE_DELTA_RECORD_PTR recordArray;
125 /* Requested pipe select for context. */
126 gcePIPE_SELECT entryPipe;
127 gcePIPE_SELECT exitPipe;
129 /* Variables used for building state buffer. */
130 gctUINT32 lastAddress;
131 gctSIZE_T lastSize;
132 gctUINT32 lastIndex;
133 gctBOOL lastFixed;
135 /* Hint array. */
136 #if gcdSECURE_USER
137 gctBOOL_PTR hint;
138 #endif
141 #ifdef __cplusplus
143 #endif
145 #endif /* __gc_hal_kernel_context_h_ */