~ubuntu-branches/ubuntu/gutsy/vnc4/gutsy

« back to all changes in this revision

Viewing changes to unix/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drm.h

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2006-05-15 20:35:17 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060515203517-l4lre1ku942mn26k
Tags: 4.1.1+X4.3.0-10
* Correction of critical security issue. Thanks to Martin Kogler
  <e9925248@student.tuwien.ac.at> that informed me about the issue,
  and provided the patch.
  This flaw was originally found by Steve Wiseman of intelliadmin.com.
* Applied patch from Javier Kohen <jkohen@users.sourceforge.net> that
  inform the user that only 8 first characters of the password will
  actually be used when typing more than 8 characters, closes:
  #355619.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _GAMMA_DRM_H_
 
2
#define _GAMMA_DRM_H_
 
3
 
 
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;
 
9
 
 
10
typedef struct {
 
11
        unsigned int    GDeltaMode;
 
12
        unsigned int    GDepthMode;
 
13
        unsigned int    GGeometryMode;
 
14
        unsigned int    GTransformMode;
 
15
} drm_gamma_context_regs_t;
 
16
 
 
17
typedef struct _drm_gamma_sarea {
 
18
        drm_gamma_context_regs_t context_state;
 
19
 
 
20
        unsigned int dirty;
 
21
 
 
22
 
 
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.
 
28
         *
 
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.  
 
37
         */
 
38
   
 
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 */
 
47
 
 
48
        int vertex_prim;
 
49
} drm_gamma_sarea_t;
 
50
 
 
51
/* WARNING: If you change any of these defines, make sure to change the
 
52
 * defines in the Xserver file (xf86drmGamma.h)
 
53
 */
 
54
 
 
55
/* Gamma specific ioctls
 
56
 * The device specific ioctl range is 0x40 to 0x79.
 
57
 */
 
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)
 
60
 
 
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;
 
72
} drm_gamma_copy_t;
 
73
 
 
74
typedef struct drm_gamma_init {
 
75
        enum {
 
76
                GAMMA_INIT_DMA    = 0x01,
 
77
                GAMMA_CLEANUP_DMA = 0x02
 
78
        } func;
 
79
 
 
80
        int sarea_priv_offset;
 
81
        int pcimode;
 
82
        unsigned int mmio0;
 
83
        unsigned int mmio1;
 
84
        unsigned int mmio2;
 
85
        unsigned int mmio3;
 
86
        unsigned int buffers_offset;
 
87
} drm_gamma_init_t;
 
88
 
 
89
#endif /* _GAMMA_DRM_H_ */