~ubuntu-branches/ubuntu/intrepid/xserver-xgl/intrepid

« back to all changes in this revision

Viewing changes to hw/kdrive/src/vga.h

  • Committer: Bazaar Package Importer
  • Author(s): Matthew Garrett
  • Date: 2006-02-13 14:21:43 UTC
  • Revision ID: james.westby@ubuntu.com-20060213142143-mad6z9xzem7hzxz9
Tags: upstream-7.0.0
Import upstream version 7.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Id: vga.h,v 1.1 1999/11/02 03:54:46 keithp Exp $
 
3
 *
 
4
 * Copyright � 1999 Keith Packard
 
5
 *
 
6
 * Permission to use, copy, modify, distribute, and sell this software and its
 
7
 * documentation for any purpose is hereby granted without fee, provided that
 
8
 * the above copyright notice appear in all copies and that both that
 
9
 * copyright notice and this permission notice appear in supporting
 
10
 * documentation, and that the name of Keith Packard not be used in
 
11
 * advertising or publicity pertaining to distribution of the software without
 
12
 * specific, written prior permission.  Keith Packard makes no
 
13
 * representations about the suitability of this software for any purpose.  It
 
14
 * is provided "as is" without express or implied warranty.
 
15
 *
 
16
 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 
17
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
 
18
 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 
19
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
 
20
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 
21
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 
22
 * PERFORMANCE OF THIS SOFTWARE.
 
23
 */
 
24
/* $RCSId: xc/programs/Xserver/hw/kdrive/vga.h,v 1.2 1999/12/30 03:03:07 robin Exp $ */
 
25
 
 
26
#ifndef _VGA_H_
 
27
#define _VGA_H_
 
28
 
 
29
typedef unsigned long   VGA32;
 
30
typedef unsigned short  VGA16;
 
31
typedef unsigned char   VGA8;
 
32
typedef int             VGABOOL;
 
33
typedef volatile VGA8   VGAVOL8;
 
34
 
 
35
#define VGATRUE     1
 
36
#define VGAFALSE    0
 
37
 
 
38
typedef struct _vgaReg {
 
39
    VGA16       id;
 
40
    VGA8        base;
 
41
    VGA8        len;
 
42
} VgaReg;
 
43
 
 
44
#define VGA_REG_NONE        0xffff
 
45
#define VGA_REG_END         VGA_REG_NONE, 0, 0
 
46
 
 
47
typedef struct _vgaValue {
 
48
    VGA8        save;
 
49
    VGA8        cur;
 
50
    VGA16       flags;
 
51
} VgaValue;
 
52
 
 
53
#define VGA_VALUE_VALID     1   /* value ever fetched */
 
54
#define VGA_VALUE_MODIFIED  2   /* value ever changed */
 
55
#define VGA_VALUE_DIRTY     4   /* value needs syncing */
 
56
#define VGA_VALUE_SAVED     8   /* value preserved */
 
57
 
 
58
typedef enum _vgaAccess {
 
59
    VgaAccessMem, VgaAccessIo, VgaAccessIndMem, VgaAccessIndIo,
 
60
    VgaAccessDone
 
61
} VgaAccess;
 
62
 
 
63
typedef struct _vgaMap {
 
64
    VgaAccess   access;
 
65
    VGA32       port;
 
66
    VGA8        addr;       /* for Ind access; addr offset from port */
 
67
    VGA8        value;      /* for Ind access; value offset from port */
 
68
    VGA8        index;      /* for Ind access; index value */
 
69
} VgaMap;
 
70
 
 
71
#define VGA_UNLOCK_FIXED    1   /* dont save current value */
 
72
#define VGA_UNLOCK_LOCK     2   /* execute only on relock */
 
73
#define VGA_UNLOCK_UNLOCK   4   /* execute only on unlock */
 
74
 
 
75
typedef struct _vgaSave {
 
76
    VGA16       first;
 
77
    VGA16       last;
 
78
} VgaSave;
 
79
 
 
80
#define VGA_SAVE_END    VGA_REG_NONE, VGA_REG_NONE
 
81
 
 
82
typedef struct _vgaCard {
 
83
    void        (*map) (struct _vgaCard *card, VGA16 reg, VgaMap *map, VGABOOL write);
 
84
    void        *closure;
 
85
    int         max;
 
86
    VgaValue    *values;
 
87
    VgaSave     *saves;
 
88
} VgaCard;
 
89
 
 
90
VGA8
 
91
VgaInb (VGA16 r);
 
92
 
 
93
void
 
94
VgaOutb (VGA8 v, VGA16 r);
 
95
    
 
96
VGA8
 
97
VgaReadMemb (VGA32 addr);
 
98
 
 
99
void
 
100
VgaWriteMemb (VGA8 v, VGA32 addr);
 
101
 
 
102
void
 
103
VgaSetImm (VgaCard *card, VgaReg *reg, VGA32 value);
 
104
 
 
105
VGA32
 
106
VgaGetImm (VgaCard *card, VgaReg *reg);
 
107
 
 
108
void
 
109
VgaSet (VgaCard *card, VgaReg *reg, VGA32 value);
 
110
 
 
111
VGA32
 
112
VgaGet (VgaCard *card, VgaReg *reg);
 
113
 
 
114
void
 
115
VgaFlush (VgaCard *card);
 
116
 
 
117
void
 
118
VgaFill (VgaCard *card, VGA16 low, VGA16 high);
 
119
 
 
120
void
 
121
VgaPreserve (VgaCard *card);
 
122
 
 
123
void
 
124
VgaInvalidate (VgaCard *card);
 
125
 
 
126
void
 
127
VgaRestore (VgaCard *card);
 
128
 
 
129
void
 
130
VgaFinish (VgaCard *card);
 
131
 
 
132
void
 
133
VgaFlushReg (VgaCard *card, VgaReg *reg);
 
134
 
 
135
VGA8
 
136
VgaFetch (VgaCard *card, VGA16 id);
 
137
 
 
138
void
 
139
VgaStore (VgaCard *card, VGA16 id, VGA8 value);
 
140
 
 
141
VGA8
 
142
_VgaFetchInd (VGA16 port, VGA8 reg);
 
143
 
 
144
void
 
145
_VgaStoreInd (VGA16 port, VGA8 reg, VGA8 value);
 
146
 
 
147
#endif /* _VGA_H_ */