summaryrefslogtreecommitdiff
path: root/src/atidac.h
blob: 8dd6d53ae99d71f4a81b8651840da39e893b3887 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/* $XFree86$ */
/*
 * Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
 *
 * Permission to use, copy, modify, distribute, and sell this software and its
 * documentation for any purpose is hereby granted without fee, provided that
 * the above copyright notice appear in all copies and that both that copyright
 * notice and this permission notice appear in supporting documentation, and
 * that the name of Marc Aurele La France not be used in advertising or
 * publicity pertaining to distribution of the software without specific,
 * written prior permission.  Marc Aurele La France makes no representations
 * about the suitability of this software for any purpose.  It is provided
 * "as-is" without express or implied warranty.
 *
 * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO
 * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */

#ifndef ___ATIDAC_H___

#if !defined(___ATI_H___) && defined(XFree86Module)
# error missing #include "ati.h" before #include "atidac.h"
# undef XFree86Module
#endif

#define ___ATIDAC_H___ 1

#include "aticrtc.h"
#include "atipriv.h"
#include "atiproto.h"

#include "xf86str.h"

#include "colormapst.h"

/*
 * RAMDAC-related definitions.
 */
#define ATI_DAC_MAX_TYPE         MaxBits(DACTYPE)
#define ATI_DAC_MAX_SUBTYPE      MaxBits(BIOS_INIT_DAC_SUBTYPE)

#define ATI_DAC(_Type, _Subtype) (((_Type) << 4) | (_Subtype))

#define ATI_DAC_ATI68830         ATI_DAC(0x0U, 0x0U)
#define ATI_DAC_SC11483          ATI_DAC(0x1U, 0x0U)
#define ATI_DAC_ATI68875         ATI_DAC(0x2U, 0x0U)
#define ATI_DAC_TVP3026_A        ATI_DAC(0x2U, 0x7U)
#define ATI_DAC_GENERIC          ATI_DAC(0x3U, 0x0U)
#define ATI_DAC_BT481            ATI_DAC(0x4U, 0x0U)
#define ATI_DAC_ATT20C491        ATI_DAC(0x4U, 0x1U)
#define ATI_DAC_SC15026          ATI_DAC(0x4U, 0x2U)
#define ATI_DAC_MU9C1880         ATI_DAC(0x4U, 0x3U)
#define ATI_DAC_IMSG174          ATI_DAC(0x4U, 0x4U)
#define ATI_DAC_ATI68860_B       ATI_DAC(0x5U, 0x0U)
#define ATI_DAC_ATI68860_C       ATI_DAC(0x5U, 0x1U)
#define ATI_DAC_TVP3026_B        ATI_DAC(0x5U, 0x7U)
#define ATI_DAC_STG1700          ATI_DAC(0x6U, 0x0U)
#define ATI_DAC_ATT20C498        ATI_DAC(0x6U, 0x1U)
#define ATI_DAC_STG1702          ATI_DAC(0x7U, 0x0U)
#define ATI_DAC_SC15021          ATI_DAC(0x7U, 0x1U)
#define ATI_DAC_ATT21C498        ATI_DAC(0x7U, 0x2U)
#define ATI_DAC_STG1703          ATI_DAC(0x7U, 0x3U)
#define ATI_DAC_CH8398           ATI_DAC(0x7U, 0x4U)
#define ATI_DAC_ATT20C408        ATI_DAC(0x7U, 0x5U)
#define ATI_DAC_INTERNAL         ATI_DAC(0x8U, 0x0U)
#define ATI_DAC_IBMRGB514        ATI_DAC(0x9U, 0x0U)
#define ATI_DAC_UNKNOWN          ATI_DAC((ATI_DAC_MAX_TYPE << 2) + 3, \
                                         ATI_DAC_MAX_SUBTYPE)
extern const SymTabRec ATIDACDescriptors[];

#ifdef AVOID_CPIO

#   define DACDelay     /* Nothing */

#else /* AVOID_CPIO */

#   define DACDelay                         \
        do                                  \
        {                                   \
            (void)inb(pATI->CPIO_DAC_WAIT); \
            (void)inb(pATI->CPIO_DAC_WAIT); \
        } while (0)

    extern void ATISetDACIOPorts FunctionPrototype((ATIPtr, ATICRTCType));

#endif /* AVOID_CPIO */

extern CARD8 ATIGetDACCmdReg     FunctionPrototype((ATIPtr));

extern void ATIDACPreInit        FunctionPrototype((ScrnInfoPtr, ATIPtr,
                                                    ATIHWPtr));
extern void ATIDACSave           FunctionPrototype((ATIPtr, ATIHWPtr));
extern void ATIDACSet            FunctionPrototype((ATIPtr, ATIHWPtr));

extern void ATILoadPalette       FunctionPrototype((ScrnInfoPtr, int, int *,
                                                    LOCO *, VisualPtr));

#endif /* ___ATIDAC_H___ */