4 typedef struct _drm_gamma_tex_region
{
5 unsigned char next
, prev
; /* indices to form a circular LRU */
6 unsigned char in_use
; /* owned by a client, or free? */
7 int age
; /* tracked by clients to update local LRU's */
8 } drm_gamma_tex_region_t
;
11 unsigned int GDeltaMode
;
12 unsigned int GDepthMode
;
13 unsigned int GGeometryMode
;
14 unsigned int GTransformMode
;
15 } drm_gamma_context_regs_t
;
17 typedef struct _drm_gamma_sarea
{
18 drm_gamma_context_regs_t context_state
;
23 /* Maintain an LRU of contiguous regions of texture space. If
24 * you think you own a region of texture memory, and it has an
25 * age different to the one you set, then you are mistaken and
26 * it has been stolen by another client. If global texAge
27 * hasn't changed, there is no need to walk the list.
29 * These regions can be used as a proxy for the fine-grained
30 * texture information of other clients - by maintaining them
31 * in the same lru which is used to age their own textures,
32 * clients have an approximate lru for the whole of global
33 * texture space, and can make informed decisions as to which
34 * areas to kick out. There is no need to choose whether to
35 * kick out your own texture or someone else's - simply eject
36 * them all in LRU order.
39 #define GAMMA_NR_TEX_REGIONS 64
40 drm_gamma_tex_region_t texList
[GAMMA_NR_TEX_REGIONS
+1];
41 /* Last elt is sentinal */
42 int texAge
; /* last time texture was uploaded */
43 int last_enqueue
; /* last time a buffer was enqueued */
44 int last_dispatch
; /* age of the most recently dispatched buffer */
45 int last_quiescent
; /* */
46 int ctxOwner
; /* last context to upload state */
51 /* WARNING: If you change any of these defines, make sure to change the
52 * defines in the Xserver file (xf86drmGamma.h)
55 /* Gamma specific ioctls
56 * The device specific ioctl range is 0x40 to 0x79.
58 #define DRM_IOCTL_GAMMA_INIT DRM_IOW( 0x40, drm_gamma_init_t)
59 #define DRM_IOCTL_GAMMA_COPY DRM_IOW( 0x41, drm_gamma_copy_t)
61 typedef struct drm_gamma_copy
{
62 unsigned int DMAOutputAddress
;
63 unsigned int DMAOutputCount
;
64 unsigned int DMAReadGLINTSource
;
65 unsigned int DMARectangleWriteAddress
;
66 unsigned int DMARectangleWriteLinePitch
;
67 unsigned int DMARectangleWrite
;
68 unsigned int DMARectangleReadAddress
;
69 unsigned int DMARectangleReadLinePitch
;
70 unsigned int DMARectangleRead
;
71 unsigned int DMARectangleReadTarget
;
74 typedef struct drm_gamma_init
{
76 GAMMA_INIT_DMA
= 0x01,
77 GAMMA_CLEANUP_DMA
= 0x02
80 int sarea_priv_offset
;
86 unsigned int buffers_offset
;
90 #endif /* _GAMMA_DRM_H_ */