~ubuntu-branches/ubuntu/edgy/xorg-server/edgy-updates

« back to all changes in this revision

Viewing changes to hw/kdrive/sis300/sis.h

  • Committer: Bazaar Package Importer
  • Author(s): Rodrigo Parra Novo
  • Date: 2006-07-25 20:06:28 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060725200628-gjmmd9gxfxdc4ejs
Tags: 1:1.1.1-0ubuntu1
* New Upstream version
* Changed Build-Depends from mesa-swrast-source to mesa-swx11-source,
  following Debian package nomenclature
* Re-did 12_security_policy_in_etc.diff for 1.1.1
* Dropped 15_security_allocate_local.diff (applied upstream)
* Dropped 16_SECURITY_setuid.diff (applied upstream)
* Dropped 000_ubuntu_fix_read_kernel_mapping.patch (applied upstream)
* Dropped 002_ubuntu_fix_for_certain_intel_chipsets.patch (applied upstream)
* Updated versioned Build-Depends on mesa-swx11-source to version
  6.5.0.cvs.20060725-0ubuntu1
* Added arrayobj.c, arrayobj.h, bitset.h & rbadaptors.h to
  GL/symlink-mesa.sh (linked from mesa-swx11-source)
* Added arrayobj.c to default build target on GL/mesa/main

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * $Id$
 
3
 *
 
4
 * Copyright � 2003 Eric Anholt
 
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 Eric Anholt not be used in
 
11
 * advertising or publicity pertaining to distribution of the software without
 
12
 * specific, written prior permission.  Eric Anholt 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
 * ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 
17
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
 
18
 * EVENT SHALL ERIC ANHOLT 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
/* $Header$ */
 
25
 
 
26
#ifndef _SIS_H_
 
27
#define _SIS_H_
 
28
 
 
29
#include "kdrive-config.h"
 
30
 
 
31
#ifdef KDRIVEFBDEV
 
32
#include <fbdev.h>
 
33
#endif
 
34
#ifdef KDRIVEVESA
 
35
#include <vesa.h>
 
36
#endif
 
37
 
 
38
/* XXX */
 
39
#define SIS_REG_BASE(c)         ((c)->attr.address[1])
 
40
#define SIS_REG_SIZE(c)         (0x10000)
 
41
 
 
42
#ifdef __powerpc__
 
43
 
 
44
static __inline__ void
 
45
MMIO_OUT32(__volatile__ void *base, const unsigned long offset,
 
46
           const unsigned int val)
 
47
{
 
48
        __asm__ __volatile__(
 
49
                        "stwbrx %1,%2,%3\n\t"
 
50
                        "eieio"
 
51
                        : "=m" (*((volatile unsigned char *)base+offset))
 
52
                        : "r" (val), "b" (base), "r" (offset));
 
53
}
 
54
 
 
55
static __inline__ CARD32
 
56
MMIO_IN32(__volatile__ void *base, const unsigned long offset)
 
57
{
 
58
        register unsigned int val;
 
59
        __asm__ __volatile__(
 
60
                        "lwbrx %0,%1,%2\n\t"
 
61
                        "eieio"
 
62
                        : "=r" (val)
 
63
                        : "b" (base), "r" (offset),
 
64
                        "m" (*((volatile unsigned char *)base+offset)));
 
65
        return val;
 
66
}
 
67
 
 
68
#else
 
69
 
 
70
#define MMIO_OUT32(mmio, a, v)          (*(VOL32 *)((mmio) + (a)) = (v))
 
71
#define MMIO_IN32(mmio, a)              (*(VOL32 *)((mmio) + (a)))
 
72
 
 
73
#endif
 
74
 
 
75
typedef volatile CARD8  VOL8;
 
76
typedef volatile CARD16 VOL16;
 
77
typedef volatile CARD32 VOL32;
 
78
 
 
79
struct pci_id_entry {
 
80
        CARD16 vendor;
 
81
        CARD16 device;
 
82
        CARD8 caps;
 
83
        char *name;
 
84
};
 
85
 
 
86
struct backend_funcs {
 
87
        void    (*cardfini)(KdCardInfo *);
 
88
        void    (*scrfini)(KdScreenInfo *);
 
89
        Bool    (*initScreen)(ScreenPtr);
 
90
        Bool    (*finishInitScreen)(ScreenPtr pScreen);
 
91
        Bool    (*createRes)(ScreenPtr);
 
92
        void    (*preserve)(KdCardInfo *);
 
93
        void    (*restore)(KdCardInfo *);
 
94
        Bool    (*dpms)(ScreenPtr, int);
 
95
        Bool    (*enable)(ScreenPtr);
 
96
        void    (*disable)(ScreenPtr);
 
97
        void    (*getColors)(ScreenPtr, int, int, xColorItem *);
 
98
        void    (*putColors)(ScreenPtr, int, int, xColorItem *);
 
99
};
 
100
 
 
101
typedef struct _SiSCardInfo {
 
102
        union {
 
103
#ifdef KDRIVEFBDEV
 
104
                FbdevPriv fbdev;
 
105
#endif
 
106
#ifdef KDRIVEVESA
 
107
                VesaCardPrivRec vesa;
 
108
#endif
 
109
        } backend_priv;
 
110
        struct backend_funcs backend_funcs;
 
111
 
 
112
        struct pci_id_entry *pci_id;
 
113
        CARD8 *reg_base;
 
114
        Bool use_fbdev, use_vesa;
 
115
} SiSCardInfo;
 
116
 
 
117
#define getSiSCardInfo(kd)      ((SiSCardInfo *) ((kd)->card->driver))
 
118
#define SiSCardInfo(kd)         SiSCardInfo *sisc = getSiSCardInfo(kd)
 
119
 
 
120
typedef struct _SiSScreenInfo {
 
121
        union {
 
122
#ifdef KDRIVEFBDEV
 
123
                FbdevScrPriv fbdev;
 
124
#endif
 
125
#ifdef KDRIVEVESA
 
126
                VesaScreenPrivRec vesa;
 
127
#endif
 
128
        } backend_priv;
 
129
        CARD32 depthSet;        /* depth value for REG_BLT_SRCPITCH */
 
130
        KaaScreenInfoRec kaa;
 
131
        SiSCardInfo *sisc;
 
132
} SiSScreenInfo;
 
133
 
 
134
#define getSiSScreenInfo(kd)    ((SiSScreenInfo *) ((kd)->screen->driver))
 
135
#define SiSScreenInfo(kd)       SiSScreenInfo *siss = getSiSScreenInfo(kd)
 
136
 
 
137
Bool
 
138
SiSMapReg(KdCardInfo *card, SiSCardInfo *sisc);
 
139
 
 
140
void
 
141
SiSUnmapReg(KdCardInfo *card, SiSCardInfo *sisc);
 
142
 
 
143
Bool
 
144
SiSDrawSetup(ScreenPtr pScreen);
 
145
 
 
146
Bool
 
147
SiSDrawInit(ScreenPtr pScreen);
 
148
 
 
149
void
 
150
SiSDrawEnable(ScreenPtr pScreen);
 
151
 
 
152
void
 
153
SiSDrawSync(ScreenPtr pScreen);
 
154
 
 
155
void
 
156
SiSDrawDisable(ScreenPtr pScreen);
 
157
 
 
158
void
 
159
SiSDrawFini(ScreenPtr pScreen);
 
160
 
 
161
extern KdCardFuncs SiSFuncs;
 
162
 
 
163
#endif /* _SIS_H_ */