]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_context.h
Revert "net: phy: Set the driver when registering an MDIO bus device"
[karo-tx-linux.git] / drivers / mxc / gpu-viv / arch / XAQ2 / hal / kernel / gc_hal_kernel_context.h
1 /****************************************************************************
2 *
3 *    Copyright (C) 2005 - 2013 by Vivante Corp.
4 *
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.
9 *
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.
14 *
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.
18 *
19 *****************************************************************************/
20
21
22 #ifndef __gc_hal_kernel_context_h_
23 #define __gc_hal_kernel_context_h_
24
25 #include "gc_hal_kernel_buffer.h"
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 /* Maps state locations within the context buffer. */
32 typedef struct _gcsSTATE_MAP * gcsSTATE_MAP_PTR;
33 typedef struct _gcsSTATE_MAP
34 {
35     /* Index of the state in the context buffer. */
36     gctUINT                     index;
37
38     /* State mask. */
39     gctUINT32                   mask;
40 }
41 gcsSTATE_MAP;
42
43 /* Context buffer. */
44 typedef struct _gcsCONTEXT * gcsCONTEXT_PTR;
45 typedef struct _gcsCONTEXT
46 {
47     /* For debugging: the number of context buffer in the order of creation. */
48 #if gcmIS_DEBUG(gcdDEBUG_CODE)
49     gctUINT                     num;
50 #endif
51
52     /* Pointer to gckEVENT object. */
53     gckEVENT                    eventObj;
54
55     /* Context busy signal. */
56     gctSIGNAL                   signal;
57
58     /* Physical address of the context buffer. */
59     gctPHYS_ADDR                physical;
60
61     /* Logical address of the context buffer. */
62     gctUINT32_PTR               logical;
63
64     /* Pointer to the LINK commands. */
65     gctPOINTER                  link2D;
66     gctPOINTER                  link3D;
67
68     /* The number of pending state deltas. */
69     gctUINT                     deltaCount;
70
71     /* Pointer to the first delta to be applied. */
72     gcsSTATE_DELTA_PTR          delta;
73
74     /* Next context buffer. */
75     gcsCONTEXT_PTR              next;
76 }
77 gcsCONTEXT;
78
79 /* gckCONTEXT structure that hold the current context. */
80 struct _gckCONTEXT
81 {
82     /* Object. */
83     gcsOBJECT                   object;
84
85     /* Pointer to gckOS object. */
86     gckOS                       os;
87
88     /* Pointer to gckHARDWARE object. */
89     gckHARDWARE                 hardware;
90
91     /* Command buffer alignment. */
92     gctSIZE_T                   alignment;
93     gctSIZE_T                   reservedHead;
94     gctSIZE_T                   reservedTail;
95
96     /* Context buffer metrics. */
97     gctSIZE_T                   stateCount;
98     gctSIZE_T                   totalSize;
99     gctSIZE_T                   bufferSize;
100     gctUINT32                   linkIndex2D;
101     gctUINT32                   linkIndex3D;
102     gctUINT32                   linkIndexXD;
103     gctUINT32                   entryOffset3D;
104     gctUINT32                   entryOffsetXDFrom2D;
105     gctUINT32                   entryOffsetXDFrom3D;
106
107     /* Dirty flags. */
108     gctBOOL                     dirty;
109     gctBOOL                     dirty2D;
110     gctBOOL                     dirty3D;
111     gcsCONTEXT_PTR              dirtyBuffer;
112
113     /* State mapping. */
114     gcsSTATE_MAP_PTR            map;
115
116     /* List of context buffers. */
117     gcsCONTEXT_PTR              buffer;
118
119     /* A copy of the user record array. */
120     gctUINT                     recordArraySize;
121     gcsSTATE_DELTA_RECORD_PTR   recordArray;
122
123     /* Requested pipe select for context. */
124     gcePIPE_SELECT              entryPipe;
125     gcePIPE_SELECT              exitPipe;
126
127     /* Variables used for building state buffer. */
128     gctUINT32                   lastAddress;
129     gctSIZE_T                   lastSize;
130     gctUINT32                   lastIndex;
131     gctBOOL                     lastFixed;
132
133     /* Hint array. */
134 #if gcdSECURE_USER
135     gctBOOL_PTR                 hint;
136 #endif
137
138 #if VIVANTE_PROFILER_CONTEXT
139     gcsPROFILER_COUNTERS        latestProfiler;
140     gcsPROFILER_COUNTERS        histroyProfiler;
141     gctUINT32                   prevVSInstCount;
142     gctUINT32                   prevVSBranchInstCount;
143     gctUINT32                   prevVSTexInstCount;
144     gctUINT32                   prevVSVertexCount;
145     gctUINT32                   prevPSInstCount;
146     gctUINT32                   prevPSBranchInstCount;
147     gctUINT32                   prevPSTexInstCount;
148     gctUINT32                   prevPSPixelCount;
149 #endif
150 };
151
152 #ifdef __cplusplus
153 }
154 #endif
155
156 #endif /* __gc_hal_kernel_context_h_ */
157