1 /**************************************************************************
3 Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
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:
14 The above copyright notice and this permission notice (including the
15 next paragraph) shall be included in all copies or substantial portions
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,
24 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 **************************************************************************/
31 * Jens Owen <jens@tungstengraphics.com>
39 #include "glint_common.h"
42 unsigned int GDeltaMode
;
43 unsigned int GDepthMode
;
44 unsigned int GGeometryMode
;
45 unsigned int GTransformMode
;
46 } GAMMAContextRegionRec
, *GAMMAContextRegionPtr
;
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
;
55 GAMMAContextRegionRec context_state
;
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.
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.
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 */
85 } GLINTSAREADRIRec
, *GLINTSAREADRIPtr
;
88 * Glint specific record passed back to client driver
89 * via DRIGetDeviceInfo request
108 int logTextureGranularity
;
109 } GLINTDRIRec
, *GLINTDRIPtr
;
111 #define GLINT_DRI_BUF_COUNT 256
112 #define GLINT_DRI_BUF_SIZE 4096
114 #define GAMMA_NR_TEX_REGIONS 64
116 #define DMA_WRITE(val,reg) \
118 pGlint->buf2D++ = Glint##reg##Tag; \
119 pGlint->buf2D++ = val; \
122 #endif /* _GLINT_DRI_H_ */