Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1.  
  2. #include "pci.h"
  3.  
  4. #include "rhd_regs.h"
  5.  
  6. typedef struct _ScrnInfoRec *ScrnInfoPtr;
  7. typedef struct RHDRec       *RHDPtr;
  8.  
  9. typedef struct {
  10.     int                 frameX0;
  11.     int                 frameY0;
  12.     int                 virtualX;
  13.     int                 virtualY;
  14.     int                 depth;
  15.     int                 fbbpp;
  16.   //  rgb     weight;
  17.   //  rgb     blackColour;
  18.   //  rgb     whiteColour;
  19.     int                 defaultVisual;
  20.     char **             modes;
  21.     pointer             options;
  22. } DispRec, *DispPtr;
  23.  
  24.  
  25. typedef struct _ScrnInfoRec
  26. {
  27.     int       scrnIndex;
  28.     RHDPtr    rhdPtr;
  29. //    int     driverVersion;
  30.     char *              driverName;             /* canonical name used in */
  31.                                                 /* the config file */
  32. //    ScreenPtr   pScreen;    /* Pointer to the ScreenRec */
  33. //    int     scrnIndex;    /* Number of this screen */
  34. //    Bool    configured;   /* Is this screen valid */
  35. //    int     origIndex;    /* initial number assigned to
  36. //             * this screen before
  37. //             * finalising the number of
  38. //             * available screens */
  39.  
  40.     /* Display-wide screenInfo values needed by this screen */
  41. //    int     imageByteOrder;
  42. //    int     bitmapScanlineUnit;
  43. //    int     bitmapScanlinePad;
  44. //    int     bitmapBitOrder;
  45. //    int     numFormats;
  46. //    PixmapFormatRec formats[MAXFORMATS];
  47. //    PixmapFormatRec fbFormat;
  48.  
  49.     int     bitsPerPixel;            /* fb bpp */
  50. //    Pix24Flags    pixmap24;          /* pixmap pref for depth 24 */
  51.     int     depth;                   /* depth of default visual */
  52. //    MessageType   depthFrom;         /* set from config? */
  53. //    MessageType   bitsPerPixelFrom; /* set from config? */
  54. //    rgb     weight;     /* r/g/b weights */
  55. //    rgb     mask;     /* rgb masks */
  56. //    rgb     offset;     /* rgb offsets */
  57. //    int     rgbBits;    /* Number of bits in r/g/b */
  58. //    Gamma   gamma;      /* Gamma of the monitor */
  59. //    int     defaultVisual;    /* default visual class */
  60.     int     maxHValue;               /* max horizontal timing */
  61.     int     maxVValue;               /* max vertical timing value */
  62.     int     virtualX;                /* Virtual width */
  63.     int     virtualY;                /* Virtual height */
  64.     int     xInc;                    /* Horizontal timing increment */
  65. //    MessageType   virtualFrom;    /* set from config? */
  66.     int     displayWidth;            /* memory pitch */
  67.     int     frameX0;                 /* viewport position */
  68.     int                 frameY0;
  69.     int                 frameX1;
  70.     int                 frameY1;
  71.     int     zoomLocked;              /* Disallow mode changes */
  72.     DisplayModePtr  modePool;        /* list of compatible modes */
  73.     DisplayModePtr  modes;           /* list of actual modes */
  74.     DisplayModePtr  currentMode;     /* current mode
  75.                                                  * This was previously
  76.                                                  * overloaded with the modes
  77.                                                  * field, which is a pointer
  78.                                                  * into a circular list */
  79. //    confScreenPtr confScreen;   /* Screen config info */
  80. //    MonPtr    monitor;    /* Monitor information */
  81.     DispPtr   display;               /* Display information */
  82. //    int *   entityList;   /* List of device entities */
  83. //    int     numEntities;
  84.     int     widthmm;                 /* physical display dimensions in mm */
  85.     int                 heightmm;
  86.     int     xDpi;                    /* width DPI */
  87.     int     yDpi;                    /* height DPI */
  88.     char *    name;                  /* Name to prefix messages */
  89. //    pointer   driverPrivate;    /* Driver private area */
  90. //    DevUnion *    privates;   /* Other privates can hook in
  91. //             * here */
  92. //    DriverPtr   drv;      /* xf86DriverList[] entry */
  93. //    pointer   module;     /* Pointer to module head */
  94. //    int     colorKey;
  95. //    int     overlayFlags;
  96.  
  97.     /* Some of these may be moved out of here into the driver private area */
  98.  
  99. //    char *    chipset;    /* chipset name */
  100. //    char *    ramdac;     /* ramdac name */
  101. //    char *    clockchip;    /* clock name */
  102.  //   Bool    progClock;    /* clock is programmable */
  103. //    int     numClocks;    /* number of clocks */
  104. //    int     clock[MAXCLOCKS]; /* list of clock frequencies */
  105. //    int     videoRam;   /* amount of video ram (kb) */
  106. //    unsigned long biosBase;   /* Base address of video BIOS */
  107. //    unsigned long memPhysBase;    /* Physical address of FB */
  108. //    unsigned long   fbOffset;   /* Offset of FB in the above */
  109. //    IOADDRESS     domainIOBase;   /* Domain I/O base address */
  110. //    int     memClk;     /* memory clock */
  111. //    int     textClockFreq;    /* clock of text mode */
  112. //    Bool    flipPixels;   /* swap default black/white */
  113. //    pointer   options;
  114.  
  115. //    int     chipID;
  116. //    int     chipRev;
  117. //    int     racMemFlags;
  118. //    int     racIoFlags;
  119. //    pointer   access;
  120. //    xf86CurrentAccessPtr CurrentAccess;
  121. //    resType   resourceType;
  122. //    pointer   busAccess;
  123.  
  124.     /* Allow screens to be enabled/disabled individually */
  125. //    Bool    vtSema;
  126. //    DevUnion    pixmapPrivate;    /* saved devPrivate from pixmap */
  127.  
  128.     /* hw cursor moves at SIGIO time */
  129. //    Bool    silkenMouse;
  130.  
  131.     /* Storage for clockRanges and adjustFlags for use with the VidMode ext */
  132. //    ClockRangesPtr  clockRanges;
  133. //    int     adjustFlags;
  134.  
  135.     /*
  136.      * These can be used when the minor ABI version is incremented.
  137.      * The NUM_* parameters must be reduced appropriately to keep the
  138.      * structure size and alignment unchanged.
  139.      */
  140. //    int     reservedInt[NUM_RESERVED_INTS];
  141.  
  142. //    int *   entityInstanceList;
  143. //    pointer   reservedPtr[NUM_RESERVED_POINTERS];
  144.  
  145.     /*
  146.      * Driver entry points.
  147.      *
  148.      */
  149.  
  150. /*
  151.     xf86ProbeProc                       *Probe;
  152.     xf86PreInitProc                     *PreInit;
  153.     xf86ScreenInitProc                  *ScreenInit;
  154.     xf86SwitchModeProc                  *SwitchMode;
  155.     xf86AdjustFrameProc                 *AdjustFrame;
  156.     xf86EnterVTProc                     *EnterVT;
  157.     xf86LeaveVTProc                     *LeaveVT;
  158.     xf86FreeScreenProc                  *FreeScreen;
  159.     xf86ValidModeProc                   *ValidMode;
  160.     xf86EnableDisableFBAccessProc       *EnableDisableFBAccess;
  161.     xf86SetDGAModeProc                  *SetDGAMode;
  162.     xf86ChangeGammaProc                 *ChangeGamma;
  163.     xf86PointerMovedProc                *PointerMoved;
  164.     xf86PMEventProc                     *PMEvent;
  165.     xf86HandleMessageProc               *HandleMessage;
  166.     xf86DPMSSetProc                     *DPMSSet;
  167.     xf86LoadPaletteProc                 *LoadPalette;
  168.     xf86SetOverscanProc                 *SetOverscan;
  169.     xorgRRFuncProc                      *RRFunc;
  170. */
  171.     /*
  172.      * This can be used when the minor ABI version is incremented.
  173.      * The NUM_* parameter must be reduced appropriately to keep the
  174.      * structure size and alignment unchanged.
  175.      */
  176. //    funcPointer   reservedFuncs[NUM_RESERVED_FUNCS];
  177.  
  178. } ScrnInfoRec;
  179.  
  180.  
  181.  
  182. #pragma pack(push, 1)
  183. typedef struct
  184. {
  185.   CARD16 device;
  186.   CARD16 family;
  187. }PciChipset_t;
  188. #pragma pack(pop)
  189.  
  190. #define VENDOR_ATI 0x1002
  191.  
  192. enum RHD_CHIPSETS {
  193.     RHD_UNKNOWN = 0,
  194.     /* R500 */
  195.     RHD_RV505,
  196.     RHD_RV515,
  197.     RHD_RV516,
  198.     RHD_R520,
  199.     RHD_RV530,
  200.     RHD_RV535,
  201.     RHD_RV550,
  202.     RHD_RV560,
  203.     RHD_RV570,
  204.     RHD_R580,
  205.     /* R500 Mobility */
  206.     RHD_M52,
  207.     RHD_M54,
  208.     RHD_M56,
  209.     RHD_M58,
  210.     RHD_M62,
  211.     RHD_M64,
  212.     RHD_M66,
  213.     RHD_M68,
  214.     RHD_M71,
  215.     /* R500 integrated */
  216.     RHD_RS600,
  217.     RHD_RS690,
  218.     RHD_RS740,
  219.     /* R600 */
  220.     RHD_R600,
  221.     RHD_RV610,
  222.     RHD_RV630,
  223.     /* R600 Mobility */
  224.     RHD_M72,
  225.     RHD_M74,
  226.     RHD_M76,
  227.     /* RV670 came into existence after RV6x0 and M7x */
  228.     RHD_RV670,
  229.     RHD_M88,
  230.     RHD_R680,
  231.     RHD_RV620,
  232.     RHD_M82,
  233.     RHD_RV635,
  234.     RHD_M86,
  235.     RHD_RS780,
  236.     RHD_RV770,
  237.     RHD_R700,
  238.     RHD_M98,
  239.     RHD_RV730,
  240.     RHD_M96,
  241.     RHD_RV710,
  242.     RHD_CHIP_END
  243. };
  244.  
  245. enum RHD_FAMILIES {
  246.     RHD_FAMILY_UNKNOWN = 0,
  247.     RHD_FAMILY_RV515,
  248.     RHD_FAMILY_R520,
  249.     RHD_FAMILY_RV530,
  250.     RHD_FAMILY_RV560,
  251.     RHD_FAMILY_RV570,
  252.     RHD_FAMILY_R580,
  253.     RHD_FAMILY_RS690,
  254.     RHD_FAMILY_R600,
  255.     RHD_FAMILY_RV610,
  256.     RHD_FAMILY_RV630,
  257.     RHD_FAMILY_RV670,
  258.     RHD_FAMILY_RV620,
  259.     RHD_FAMILY_RV635,
  260.     RHD_FAMILY_RS780
  261. };
  262.  
  263. enum RHD_HPD_USAGE {
  264.     RHD_HPD_USAGE_AUTO = 0,
  265.     RHD_HPD_USAGE_OFF,
  266.     RHD_HPD_USAGE_NORMAL,
  267.     RHD_HPD_USAGE_SWAP,
  268.     RHD_HPD_USAGE_AUTO_SWAP,
  269.     RHD_HPD_USAGE_AUTO_OFF
  270. };
  271.  
  272. enum RHD_TV_MODE {
  273.     RHD_TV_NONE = 0,
  274.     RHD_TV_NTSC = 1,
  275.     RHD_TV_NTSCJ = 1 << 2,
  276.     RHD_TV_PAL = 1 << 3,
  277.     RHD_TV_PALM = 1 << 4,
  278.     RHD_TV_PALCN = 1 << 5,
  279.     RHD_TV_PALN = 1 << 6,
  280.     RHD_TV_PAL60 = 1 << 7,
  281.     RHD_TV_SECAM = 1 << 8,
  282.     RHD_TV_CV = 1 << 9
  283. };
  284.  
  285. enum rhdPropertyAction {
  286.     rhdPropertyCheck,
  287.     rhdPropertyGet,
  288.     rhdPropertySet
  289. };
  290.  
  291. union rhdPropertyData
  292. {
  293.     CARD32 integer;
  294.     char *string;
  295.     Bool Bool;
  296. };
  297.  
  298. #define RHD_CONNECTORS_MAX 6
  299.  
  300. /* Just define where which PCI BAR lives for now. Will deal with different
  301.  * locations as soon as cards with a different BAR layout arrives.
  302.  */
  303. #define RHD_FB_BAR   0
  304. #define RHD_MMIO_BAR 2
  305.  
  306. /* More realistic powermanagement */
  307. #define RHD_POWER_ON       0
  308. #define RHD_POWER_RESET    1   /* off temporarily */
  309. #define RHD_POWER_SHUTDOWN 2   /* long term shutdown */
  310. #define RHD_POWER_UNKNOWN  3   /* initial state */
  311.  
  312. #define RHD_MEM_GART       1
  313. #define RHD_MEM_FB         2
  314.  
  315.  
  316. enum rhdCardType {
  317.     RHD_CARD_NONE,
  318.     RHD_CARD_AGP,
  319.     RHD_CARD_PCIE
  320. };
  321.  
  322. enum {
  323.     RHD_PCI_CAPID_AGP    = 0x02,
  324.     RHD_PCI_CAPID_PCIE   = 0x10
  325. };
  326.  
  327. typedef struct BIOSScratchOutputPrivate rhdOutputDriverPrivate;
  328. typedef struct _rhdI2CRec *rhdI2CPtr;
  329. typedef struct _atomBiosHandle *atomBiosHandlePtr;
  330. typedef struct _rhdShadowRec *rhdShadowPtr;
  331.  
  332. typedef struct _RHDopt {
  333.     Bool set;
  334.     union  {
  335.         Bool bool;
  336.         int integer;
  337.         unsigned long uslong;
  338.         double real;
  339.         double freq;
  340.         char *string;
  341.     } val;
  342. } RHDOpt, *RHDOptPtr;
  343.  
  344.  
  345. ////////////////////////////
  346. typedef enum
  347. {
  348.     CONNECTOR_NONE,            // 0
  349.     CONNECTOR_VGA,             // 1
  350.     CONNECTOR_DVI_I,           // 2
  351.     CONNECTOR_DVI_D,           // 3
  352.     CONNECTOR_DVI_A,           // 4
  353.     CONNECTOR_STV,             // 5
  354.     CONNECTOR_CTV,             // 6
  355.     CONNECTOR_LVDS,            // 7
  356.     CONNECTOR_DIGITAL,         // 8
  357.     CONNECTOR_SCART,           // 9
  358.     CONNECTOR_HDMI_TYPE_A,     // 10
  359.     CONNECTOR_HDMI_TYPE_B,     // 11
  360.     CONNECTOR_0XC,             // 12
  361.     CONNECTOR_0XD,             // 13
  362.     CONNECTOR_DIN,             // 14
  363.     CONNECTOR_DISPLAY_PORT,    // 15
  364.     CONNECTOR_UNSUPPORTED
  365. } RADEONConnectorType;
  366.  
  367. typedef enum
  368. {
  369.     DAC_NONE    = 0,
  370.     DAC_PRIMARY = 1,
  371.     DAC_TVDAC   = 2,
  372.     DAC_EXT     = 3
  373. } RADEONDacType;
  374.  
  375. typedef enum
  376. {
  377.     TMDS_NONE    = 0,
  378.     TMDS_INT     = 1,
  379.     TMDS_EXT     = 2,
  380.     TMDS_LVTMA   = 3,
  381.     TMDS_DDIA    = 4
  382. } RADEONTmdsType;
  383.  
  384. typedef struct
  385. {
  386.     Bool   valid;
  387.     CARD32 mask_clk_reg;
  388.     CARD32 mask_data_reg;
  389.     CARD32 put_clk_reg;
  390.     CARD32 put_data_reg;
  391.     CARD32 get_clk_reg;
  392.     CARD32 get_data_reg;
  393.     CARD32 mask_clk_mask;
  394.     CARD32 mask_data_mask;
  395.     CARD32 put_clk_mask;
  396.     CARD32 put_data_mask;
  397.     CARD32 get_clk_mask;
  398.     CARD32 get_data_mask;
  399. } RADEONI2CBusRec, *RADEONI2CBusPtr;
  400.  
  401. typedef struct {
  402.     RADEONDacType DACType;
  403.     RADEONTmdsType TMDSType;
  404.     RADEONConnectorType ConnectorType;
  405.     Bool valid;
  406.     int output_id;
  407.     int devices;
  408.     int hpd_mask;
  409.     RADEONI2CBusRec ddc_i2c;
  410. } RADEONBIOSConnector;
  411.  
  412. ///////////////////////////////////////////
  413.  
  414.  
  415.  
  416. typedef struct RHDRec
  417. {
  418.   ScrnInfoPtr            pScrn;
  419.   int                    scrnIndex;
  420.  
  421.   CARD32                 MMIOBase;
  422.   CARD32                 MMIOMapSize;
  423.   CARD32                 videoRam;
  424.  
  425.   enum RHD_HPD_USAGE     hpdUsage;
  426.   RHDOpt                 forceReduced;
  427.  
  428.   CARD32                 FbBase;            /* map base of fb   */
  429.   CARD32                 FbIntAddress;      /* card internal address of FB */
  430.  CARD32                  FbIntSize;         /* card internal FB aperture size */
  431.  
  432.   CARD32                 FbMapSize;
  433.  
  434.   CARD32                 FbFreeStart;
  435.   CARD32                 FbFreeSize;
  436.  
  437.   /* visible part of the framebuffer */
  438.   unsigned int           FbScanoutStart;
  439.   unsigned int           FbScanoutSize;
  440.  
  441.   unsigned char*         BIOSCopy;
  442.  
  443.   enum RHD_CHIPSETS      ChipSet;
  444.   struct rhdCard         *Card;
  445.   char                   *chipset_name;
  446.  
  447.   Bool                   IsMobility;
  448.   Bool                   IsIGP;
  449.   Bool                   HasCRTC2;
  450.   Bool                   HasSingleDAC;
  451.   Bool                   InternalTVOut;
  452.  
  453.   u32_t                  bus;
  454.   u32_t                  devfn;
  455.  
  456.   PCITAG                 PciTag;
  457.   PCITAG                 NBPciTag;
  458.  
  459.   CARD16                 PciDeviceID;
  460.   enum rhdCardType       cardType;
  461.  
  462.   CARD16                 subvendor_id;
  463.   CARD16                 subdevice_id;
  464.   pciVideoRec            pci;
  465.  
  466.   struct _I2CBusRec     **I2C;               /* I2C bus list */
  467.   atomBiosHandlePtr      atomBIOS;           /* handle for AtomBIOS */
  468.  
  469.   struct rhdMC          *MC;
  470.   struct rhdVGA         *VGA;
  471.   struct rhdCrtc        *Crtc[2];
  472.   struct rhdPLL         *PLLs[2];            /* Pixelclock PLLs */
  473.  
  474.   struct rhdLUTStore    *LUTStore;
  475.   struct rhdLUT         *LUT[2];
  476.  
  477.   struct rhdConnector   *Connector[RHD_CONNECTORS_MAX];
  478.  
  479.   struct rhdOutput      *Outputs;
  480.  
  481.   struct rhdHPD         *HPD;                /* Hot plug detect subsystem */
  482.   enum RHD_TV_MODE       tvMode;
  483.   struct rhdMonitor     *ConfigMonitor;
  484.  
  485.   struct mem_block      *fb_heap;
  486.   struct mem_block      *gart_heap;
  487.  
  488.   RHDOpt                 scaleTypeOpt;
  489.  
  490.   int                    verbosity;
  491.  
  492.  
  493.    /* AtomBIOS usage */
  494.   RHDOpt                 UseAtomBIOS;
  495.   CARD32                 UseAtomFlags;
  496.  
  497.   struct rhdOutput *DigEncoderOutput[2];
  498. }RHD_t;
  499.  
  500. typedef struct {
  501.     int                 token;          /* id of the token */
  502.     const char *        name;           /* token name */
  503. } SymTabRec, *SymTabPtr;
  504.  
  505. extern inline CARD32 _RHDRegRead(RHDPtr rhdPtr, CARD16 offset)
  506. {
  507.   return *(volatile CARD32 *)((CARD8*)(rhdPtr->MMIOBase + offset));
  508. }
  509.  
  510. extern inline void
  511. _RHDRegWrite(RHDPtr rhdPtr, CARD16 offset, CARD32 value)
  512. {
  513.   *(volatile CARD32 *)((CARD8 *)(rhdPtr->MMIOBase + offset)) = value;
  514. }
  515.  
  516. extern inline void
  517. _RHDRegMask(RHDPtr rhdPtr, CARD16 offset, CARD32 value, CARD32 mask)
  518. {
  519.   CARD32 tmp;
  520.  
  521.   tmp = _RHDRegRead(rhdPtr, offset);
  522.   tmp &= ~mask;
  523.   tmp |= (value & mask);
  524.   _RHDRegWrite(rhdPtr, offset, tmp);
  525. };
  526.  
  527. extern inline CARD32
  528. _RHDReadPLL(RHDPtr rhdPtr, CARD16 offset)
  529. {
  530.   _RHDRegWrite(rhdPtr, CLOCK_CNTL_INDEX, (offset & PLL_ADDR));
  531.   return _RHDRegRead(rhdPtr, CLOCK_CNTL_DATA);
  532. }
  533.  
  534. extern inline void
  535. _RHDWritePLL(RHDPtr rhdPtr, CARD16 offset, CARD32 data)
  536. {
  537.   _RHDRegWrite(rhdPtr, CLOCK_CNTL_INDEX, (offset & PLL_ADDR) | PLL_WR_EN);
  538.   _RHDRegWrite(rhdPtr, CLOCK_CNTL_DATA, data);
  539. }
  540.  
  541.  
  542. enum RHD_FAMILIES RHDFamily(enum RHD_CHIPSETS chipset);
  543.  
  544. extern CARD32 _RHDReadMC(int scrnIndex, CARD32 addr);
  545. #define RHDReadMC(ptr,addr) _RHDReadMC((int)(ptr),(addr))
  546.  
  547. extern void _RHDWriteMC(int scrnIndex, CARD32 addr, CARD32 data);
  548. #define RHDWriteMC(ptr,addr,value) _RHDWriteMC((int)(ptr),(addr),(value))
  549.  
  550. #define RHDRegRead(ptr, offset) \
  551.         _RHDRegRead((RHDPtr)((ptr)->scrnIndex), (offset))
  552.  
  553. #define RHDRegWrite(ptr, offset, value) \
  554.         _RHDRegWrite((RHDPtr)((ptr)->scrnIndex), (offset), (value))
  555.  
  556. #define RHDRegMask(ptr, offset, value, mask) \
  557.         _RHDRegMask((RHDPtr)((ptr)->scrnIndex), (offset), (value), (mask))
  558.  
  559. #define RHDRegMaskD(ptr, offset, value, mask) \
  560.         RHDRegMask(ptr, offset, value, mask)
  561.  
  562. char * RhdAppendString(char *s1, const char *s2);
  563.  
  564.  
  565.  
  566. #define  LOG_DEBUG    0
  567.  
  568. #define  X_ERROR      0
  569. #define  X_WARNING    1
  570. #define  X_INFO       2
  571. #define  X_NONE       3
  572. #define  X_PROBED     4
  573.  
  574. /*
  575. #ifdef DBG_ALL
  576.  #undef  DBG_CALL
  577.  #undef  DBG_MSG
  578.  #undef  DBG_CAIL
  579.  
  580.  #define DBG_CALL
  581.  #define DBG_MSG
  582.  #define DBG_CAIL
  583. #endif
  584. */
  585.  
  586.  
  587. #ifdef DBG_CALL
  588.   #define RHDFUNC(ptr) dbgprintf("FUNCTION: %s\n", __func__)
  589. #else
  590.   #define RHDFUNC(ptr)
  591. #endif
  592.  
  593. #ifdef DBG_MSG
  594.   #define xf86Msg(a, format,...)            dbgprintf(format,##__VA_ARGS__)
  595.   #define xf86MsgVerb(a,b,format,...)       dbgprintf(format,##__VA_ARGS__)
  596.   #define xf86DrvMsg(a,b,format,...)        dbgprintf(format,##__VA_ARGS__)
  597.   #define xf86DrvMsgVerb(a,b,c,format,...)  dbgprintf(format,##__VA_ARGS__)
  598.   #define xf86VDrvMsgVerb(a,b,c,format,...) dbgprintf(format,##__VA_ARGS__)
  599.  
  600.   #define RHDDebug(a,format,...)            dbgprintf(format,##__VA_ARGS__)
  601.   #define RHDDebugCont(format,...)          dbgprintf(format,##__VA_ARGS__)
  602.   #define RHDDebugVerb(a,b,format,...)      dbgprintf(format,##__VA_ARGS__)
  603. #else
  604.   #define xf86Msg(a, format,...)
  605.   #define xf86MsgVerb(a,b,format,...)
  606.   #define xf86DrvMsg(a,b,format,...)
  607.   #define xf86DrvMsgVerb(a,b,c,format,...)
  608.   #define xf86VDrvMsgVerb(a,b,c,format,...)
  609.  
  610.   #define RHDDebug(a,format,...)
  611.   #define RHDDebugCont(format,...)
  612.   #define RHDDebugVerb(a,b,format,...)
  613. #endif
  614.  
  615. #ifdef DBG_CAIL
  616.   #define CAILFUNC(a)             dbgprintf("CAIL: %s\n", __func__)
  617.   #define CailDebug(a,format,...) dbgprintf(format,##__VA_ARGS__)
  618. #else
  619.   #define CAILFUNC(a)
  620.   #define CailDebug(a,format,...)
  621. #endif
  622.  
  623. #define DBG(x) x
  624. #define ErrorF dbgprintf
  625.  
  626. #define ASSERT(expr)
  627.  
  628. #define ASSERTF(expr,format)
  629.  
  630. #define RHDPTRI(p)  ((RHDPtr)((p)->scrnIndex))
  631. #define RHDPTR(p)   ((p)->rhdPtr)
  632.  
  633. #define RHDFUNCI(scrnIndex) RHDDebug(scrnIndex, "FUNCTION: %s\n", __func__)
  634.  
  635. enum atomSubSystem {
  636.     atomUsageCrtc,
  637.     atomUsagePLL,
  638.     atomUsageOutput,
  639.     atomUsageAny
  640. };
  641.  
  642. extern Bool RHDUseAtom(RHDPtr rhdPtr, enum RHD_CHIPSETS *BlackList, enum atomSubSystem subsys);
  643.  
  644. //git://anongit.freedesktop.org/git/xorg/driver/xf86-video-nv
  645. //git://anongit.freedesktop.org/git/nouveau/xf86-video-nouveau
  646.