Remove CVS keywords.
[mesa.git] / src / mesa / drivers / dri / gamma / server / glint_dri.h
1 /**************************************************************************
2
3 Copyright 1998-1999 Precision Insight, 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 PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
22 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23
24 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
27 **************************************************************************/
28
29 /*
30 * Author:
31 * Jens Owen <jens@tungstengraphics.com>
32 *
33 */
34
35 #ifndef _GLINT_DRI_H_
36 #define _GLINT_DRI_H_
37
38 #include "xf86drm.h"
39 #include "glint_common.h"
40
41 typedef struct {
42 unsigned int GDeltaMode;
43 unsigned int GDepthMode;
44 unsigned int GGeometryMode;
45 unsigned int GTransformMode;
46 } GAMMAContextRegionRec, *GAMMAContextRegionPtr;
47
48 typedef struct {
49 unsigned char next, prev; /* indices to form a circular LRU */
50 unsigned char in_use; /* owned by a client, or free? */
51 int age; /* tracked by clients to update local LRU's */
52 } GAMMATextureRegionRec, *GAMMATextureRegionPtr;
53
54 typedef struct {
55 GAMMAContextRegionRec context_state;
56
57 unsigned int dirty;
58
59 /* Maintain an LRU of contiguous regions of texture space. If
60 * you think you own a region of texture memory, and it has an
61 * age different to the one you set, then you are mistaken and
62 * it has been stolen by another client. If global texAge
63 * hasn't changed, there is no need to walk the list.
64 *
65 * These regions can be used as a proxy for the fine-grained
66 * texture information of other clients - by maintaining them
67 * in the same lru which is used to age their own textures,
68 * clients have an approximate lru for the whole of global
69 * texture space, and can make informed decisions as to which
70 * areas to kick out. There is no need to choose whether to
71 * kick out your own texture or someone else's - simply eject
72 * them all in LRU order.
73 */
74
75 #define GAMMA_NR_TEX_REGIONS 64
76 GAMMATextureRegionRec texList[GAMMA_NR_TEX_REGIONS+1];
77 /* Last elt is sentinal */
78 int texAge; /* last time texture was uploaded */
79 int last_enqueue; /* last time a buffer was enqueued */
80 int last_dispatch; /* age of the most recently dispatched buffer */
81 int last_quiescent; /* */
82 int ctxOwner; /* last context to upload state */
83
84 int vertex_prim;
85 } GLINTSAREADRIRec, *GLINTSAREADRIPtr;
86
87 /*
88 * Glint specific record passed back to client driver
89 * via DRIGetDeviceInfo request
90 */
91 typedef struct {
92 drmRegion registers0;
93 drmRegion registers1;
94 drmRegion registers2;
95 drmRegion registers3;
96 int numMultiDevices;
97 int pprod;
98 int cpp;
99 int frontOffset;
100 int frontPitch;
101 int backOffset;
102 int backPitch;
103 int backX;
104 int backY;
105 int depthOffset;
106 int depthPitch;
107 int textureSize;
108 int logTextureGranularity;
109 } GLINTDRIRec, *GLINTDRIPtr;
110
111 #define GLINT_DRI_BUF_COUNT 256
112 #define GLINT_DRI_BUF_SIZE 4096
113
114 #define GAMMA_NR_TEX_REGIONS 64
115
116 #define DMA_WRITE(val,reg) \
117 do { \
118 pGlint->buf2D++ = Glint##reg##Tag; \
119 pGlint->buf2D++ = val; \
120 } while (0)
121
122 #endif /* _GLINT_DRI_H_ */