Home | History | Annotate | Line # | Download | only in src
      1 /*
      2  * Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi (at) xfree86.org
      3  *
      4  * Permission to use, copy, modify, distribute, and sell this software and its
      5  * documentation for any purpose is hereby granted without fee, provided that
      6  * the above copyright notice appear in all copies and that both that copyright
      7  * notice and this permission notice appear in supporting documentation, and
      8  * that the name of Marc Aurele La France not be used in advertising or
      9  * publicity pertaining to distribution of the software without specific,
     10  * written prior permission.  Marc Aurele La France makes no representations
     11  * about the suitability of this software for any purpose.  It is provided
     12  * "as-is" without express or implied warranty.
     13  *
     14  * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
     15  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO
     16  * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
     17  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
     18  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
     19  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
     20  * PERFORMANCE OF THIS SOFTWARE.
     21  */
     22 
     23 #ifndef ___ATIDAC_H___
     24 
     25 #if !defined(___ATI_H___) && defined(XFree86Module)
     26 # error missing #include "ati.h" before #include "atidac.h"
     27 # undef XFree86Module
     28 #endif
     29 
     30 #define ___ATIDAC_H___ 1
     31 
     32 #include "aticrtc.h"
     33 #include "atipriv.h"
     34 
     35 #include "xf86str.h"
     36 
     37 #include "colormapst.h"
     38 
     39 /*
     40  * RAMDAC-related definitions.
     41  */
     42 #define ATI_DAC_MAX_TYPE         MaxBits(DACTYPE)
     43 #define ATI_DAC_MAX_SUBTYPE      MaxBits(BIOS_INIT_DAC_SUBTYPE)
     44 
     45 #define ATI_DAC(_Type, _Subtype) (((_Type) << 4) | (_Subtype))
     46 
     47 #define ATI_DAC_ATI68830         ATI_DAC(0x0U, 0x0U)
     48 #define ATI_DAC_SC11483          ATI_DAC(0x1U, 0x0U)
     49 #define ATI_DAC_ATI68875         ATI_DAC(0x2U, 0x0U)
     50 #define ATI_DAC_TVP3026_A        ATI_DAC(0x2U, 0x7U)
     51 #define ATI_DAC_GENERIC          ATI_DAC(0x3U, 0x0U)
     52 #define ATI_DAC_BT481            ATI_DAC(0x4U, 0x0U)
     53 #define ATI_DAC_ATT20C491        ATI_DAC(0x4U, 0x1U)
     54 #define ATI_DAC_SC15026          ATI_DAC(0x4U, 0x2U)
     55 #define ATI_DAC_MU9C1880         ATI_DAC(0x4U, 0x3U)
     56 #define ATI_DAC_IMSG174          ATI_DAC(0x4U, 0x4U)
     57 #define ATI_DAC_ATI68860_B       ATI_DAC(0x5U, 0x0U)
     58 #define ATI_DAC_ATI68860_C       ATI_DAC(0x5U, 0x1U)
     59 #define ATI_DAC_TVP3026_B        ATI_DAC(0x5U, 0x7U)
     60 #define ATI_DAC_STG1700          ATI_DAC(0x6U, 0x0U)
     61 #define ATI_DAC_ATT20C498        ATI_DAC(0x6U, 0x1U)
     62 #define ATI_DAC_STG1702          ATI_DAC(0x7U, 0x0U)
     63 #define ATI_DAC_SC15021          ATI_DAC(0x7U, 0x1U)
     64 #define ATI_DAC_ATT21C498        ATI_DAC(0x7U, 0x2U)
     65 #define ATI_DAC_STG1703          ATI_DAC(0x7U, 0x3U)
     66 #define ATI_DAC_CH8398           ATI_DAC(0x7U, 0x4U)
     67 #define ATI_DAC_ATT20C408        ATI_DAC(0x7U, 0x5U)
     68 #define ATI_DAC_INTERNAL         ATI_DAC(0x8U, 0x0U)
     69 #define ATI_DAC_IBMRGB514        ATI_DAC(0x9U, 0x0U)
     70 #define ATI_DAC_UNKNOWN          ATI_DAC((ATI_DAC_MAX_TYPE << 2) + 3, \
     71                                          ATI_DAC_MAX_SUBTYPE)
     72 extern const SymTabRec ATIDACDescriptors[];
     73 
     74 #ifdef AVOID_CPIO
     75 
     76 #   define DACDelay     /* Nothing */
     77 
     78 #else /* AVOID_CPIO */
     79 
     80 #   define DACDelay                         \
     81         do                                  \
     82         {                                   \
     83             (void)inb(pATI->CPIO_DAC_WAIT); \
     84             (void)inb(pATI->CPIO_DAC_WAIT); \
     85         } while (0)
     86 
     87     extern void ATISetDACIOPorts(ATIPtr, ATICRTCType);
     88 
     89 #endif /* AVOID_CPIO */
     90 
     91 extern CARD8 ATIGetDACCmdReg(ATIPtr);
     92 
     93 extern void ATIDACPreInit(ScrnInfoPtr, ATIPtr, ATIHWPtr);
     94 extern void ATIDACSave(ATIPtr, ATIHWPtr);
     95 extern void ATIDACSet(ATIPtr, ATIHWPtr);
     96 
     97 extern void ATILoadPalette(ScrnInfoPtr, int, int *, LOCO *, VisualPtr);
     98 
     99 #endif /* ___ATIDAC_H___ */
    100