1 /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.h,v 1.7 2002/10/30 12:52:16 alanh Exp $ */
2 /**************************************************************************
4 Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
7 Permission is hereby granted, free of charge, to any person obtaining a
8 copy of this software and associated documentation files (the
9 "Software"), to deal in the Software without restriction, including
10 without limitation the rights to use, copy, modify, merge, publish,
11 distribute, sub license, and/or sell copies of the Software, and to
12 permit persons to whom the Software is furnished to do so, subject to
13 the following conditions:
15 The above copyright notice and this permission notice (including the
16 next paragraph) shall be included in all copies or substantial portions
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
22 IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
23 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 **************************************************************************/
32 * Jens Owen <jens@tungstengraphics.com>
40 #include "glint_common.h"
43 unsigned int GDeltaMode
;
44 unsigned int GDepthMode
;
45 unsigned int GGeometryMode
;
46 unsigned int GTransformMode
;
47 } GAMMAContextRegionRec
, *GAMMAContextRegionPtr
;
50 unsigned char next
, prev
; /* indices to form a circular LRU */
51 unsigned char in_use
; /* owned by a client, or free? */
52 int age
; /* tracked by clients to update local LRU's */
53 } GAMMATextureRegionRec
, *GAMMATextureRegionPtr
;
56 GAMMAContextRegionRec context_state
;
60 /* Maintain an LRU of contiguous regions of texture space. If
61 * you think you own a region of texture memory, and it has an
62 * age different to the one you set, then you are mistaken and
63 * it has been stolen by another client. If global texAge
64 * hasn't changed, there is no need to walk the list.
66 * These regions can be used as a proxy for the fine-grained
67 * texture information of other clients - by maintaining them
68 * in the same lru which is used to age their own textures,
69 * clients have an approximate lru for the whole of global
70 * texture space, and can make informed decisions as to which
71 * areas to kick out. There is no need to choose whether to
72 * kick out your own texture or someone else's - simply eject
73 * them all in LRU order.
76 #define GAMMA_NR_TEX_REGIONS 64
77 GAMMATextureRegionRec texList
[GAMMA_NR_TEX_REGIONS
+1];
78 /* Last elt is sentinal */
79 int texAge
; /* last time texture was uploaded */
80 int last_enqueue
; /* last time a buffer was enqueued */
81 int last_dispatch
; /* age of the most recently dispatched buffer */
82 int last_quiescent
; /* */
83 int ctxOwner
; /* last context to upload state */
86 } GLINTSAREADRIRec
, *GLINTSAREADRIPtr
;
89 * Glint specific record passed back to client driver
90 * via DRIGetDeviceInfo request
109 int logTextureGranularity
;
110 } GLINTDRIRec
, *GLINTDRIPtr
;
112 #define GLINT_DRI_BUF_COUNT 256
113 #define GLINT_DRI_BUF_SIZE 4096
115 #define GAMMA_NR_TEX_REGIONS 64
117 #define DMA_WRITE(val,reg) \
119 pGlint->buf2D++ = Glint##reg##Tag; \
120 pGlint->buf2D++ = val; \
123 #endif /* _GLINT_DRI_H_ */