Subversion Repositories Kolibri OS

Rev

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

  1.  
  2. typedef void *pointer;
  3.  
  4.  
  5. typedef unsigned int memType;
  6.  
  7. typedef struct { float hi, lo; } range;
  8.  
  9.  
  10.  
  11. #define PCI_CMD_STAT_REG        0x04
  12.  
  13. typedef enum
  14. {
  15.     CHIP_FAMILY_UNKNOW,
  16.     CHIP_FAMILY_LEGACY,
  17.     CHIP_FAMILY_RADEON,
  18.     CHIP_FAMILY_RV100,
  19.     CHIP_FAMILY_RS100,    /* U1 (IGP320M) or A3 (IGP320)*/
  20.     CHIP_FAMILY_RV200,
  21.     CHIP_FAMILY_RS200,    /* U2 (IGP330M/340M/350M) or A4 (IGP330/340/345/350), RS250 (IGP 7000) */
  22.     CHIP_FAMILY_R200,
  23.     CHIP_FAMILY_RV250,
  24.     CHIP_FAMILY_RS300,    /* RS300/RS350 */
  25.     CHIP_FAMILY_RV280,
  26.     CHIP_FAMILY_R300,
  27.     CHIP_FAMILY_R350,
  28.     CHIP_FAMILY_RV350,
  29.     CHIP_FAMILY_RV380,    /* RV370/RV380/M22/M24 */
  30.     CHIP_FAMILY_R420,     /* R420/R423/M18 */
  31.     CHIP_FAMILY_RV410,    /* RV410, M26 */
  32.     CHIP_FAMILY_RS400,    /* xpress 200, 200m (RS400) Intel */
  33.     CHIP_FAMILY_RS480,    /* xpress 200, 200m (RS410/480/482/485) AMD */
  34.     CHIP_FAMILY_RV515,    /* rv515 */
  35.     CHIP_FAMILY_R520,     /* r520 */
  36.     CHIP_FAMILY_RV530,    /* rv530 */
  37.     CHIP_FAMILY_R580,     /* r580 */
  38.     CHIP_FAMILY_RV560,    /* rv560 */
  39.     CHIP_FAMILY_RV570,    /* rv570 */
  40.     CHIP_FAMILY_RS600,
  41.     CHIP_FAMILY_RS690,
  42.     CHIP_FAMILY_RS740,
  43.     CHIP_FAMILY_R600,     /* r600 */
  44.     CHIP_FAMILY_R630,
  45.     CHIP_FAMILY_RV610,
  46.     CHIP_FAMILY_RV630,
  47.     CHIP_FAMILY_RV670,
  48.     CHIP_FAMILY_RV620,
  49.     CHIP_FAMILY_RV635,
  50.     CHIP_FAMILY_RS780,
  51.     CHIP_FAMILY_RV770,
  52.     CHIP_FAMILY_LAST
  53. } RADEONChipFamily;
  54.  
  55. #define IS_RV100_VARIANT ((rhdPtr->ChipFamily == CHIP_FAMILY_RV100)  ||  \
  56.         (rhdPtr->ChipFamily == CHIP_FAMILY_RV200)  ||  \
  57.         (rhdPtr->ChipFamily == CHIP_FAMILY_RS100)  ||  \
  58.         (rhdPtr->ChipFamily == CHIP_FAMILY_RS200)  ||  \
  59.         (rhdPtr->ChipFamily == CHIP_FAMILY_RV250)  ||  \
  60.         (rhdPtr->ChipFamily == CHIP_FAMILY_RV280)  ||  \
  61.         (rhdPtr->ChipFamily == CHIP_FAMILY_RS300))
  62.  
  63.  
  64. #define IS_R300_VARIANT ((info->ChipFamily == CHIP_FAMILY_R300)  ||  \
  65.         (info->ChipFamily == CHIP_FAMILY_RV350) ||  \
  66.         (info->ChipFamily == CHIP_FAMILY_R350)  ||  \
  67.         (info->ChipFamily == CHIP_FAMILY_RV380) ||  \
  68.         (info->ChipFamily == CHIP_FAMILY_R420)  ||  \
  69.         (info->ChipFamily == CHIP_FAMILY_RV410) ||  \
  70.         (info->ChipFamily == CHIP_FAMILY_RS400) ||  \
  71.         (info->ChipFamily == CHIP_FAMILY_RS480))
  72.  
  73. #define IS_AVIVO_VARIANT ((info->ChipFamily >= CHIP_FAMILY_RV515))
  74.  
  75. #define IS_DCE3_VARIANT ((info->ChipFamily >= CHIP_FAMILY_RV620))
  76.  
  77. #define IS_R500_3D ((info->ChipFamily == CHIP_FAMILY_RV515)  ||  \
  78.         (info->ChipFamily == CHIP_FAMILY_R520)   ||  \
  79.         (info->ChipFamily == CHIP_FAMILY_RV530)  ||  \
  80.         (info->ChipFamily == CHIP_FAMILY_R580)   ||  \
  81.         (info->ChipFamily == CHIP_FAMILY_RV560)  ||  \
  82.         (info->ChipFamily == CHIP_FAMILY_RV570))
  83.  
  84. #define IS_R300_3D ((info->ChipFamily == CHIP_FAMILY_R300)  ||  \
  85.         (info->ChipFamily == CHIP_FAMILY_RV350) ||  \
  86.         (info->ChipFamily == CHIP_FAMILY_R350)  ||  \
  87.         (info->ChipFamily == CHIP_FAMILY_RV380) ||  \
  88.         (info->ChipFamily == CHIP_FAMILY_R420)  ||  \
  89.         (info->ChipFamily == CHIP_FAMILY_RV410) ||  \
  90.         (info->ChipFamily == CHIP_FAMILY_RS690) ||  \
  91.         (info->ChipFamily == CHIP_FAMILY_RS600) ||  \
  92.         (info->ChipFamily == CHIP_FAMILY_RS740) ||  \
  93.         (info->ChipFamily == CHIP_FAMILY_RS400) ||  \
  94.         (info->ChipFamily == CHIP_FAMILY_RS480))
  95.  
  96.  
  97.  
  98. typedef enum {
  99.         CARD_PCI,
  100.         CARD_AGP,
  101.         CARD_PCIE
  102. } RADEONCardType;
  103.  
  104. /*
  105.  * Errata workarounds
  106.  */
  107. typedef enum {
  108.        CHIP_ERRATA_R300_CG             = 0x00000001,
  109.        CHIP_ERRATA_PLL_DUMMYREADS      = 0x00000002,
  110.        CHIP_ERRATA_PLL_DELAY           = 0x00000004
  111. } RADEONErrata;
  112.  
  113. typedef struct
  114. {
  115.     u32_t pci_device_id;
  116.     RADEONChipFamily chip_family;
  117.     int mobility;
  118.     int igp;
  119.     int nocrtc2;
  120.     int nointtvout;
  121.     int singledac;
  122. } RADEONCardInfo;
  123.  
  124.  
  125. #define RHD_FB_BAR         0
  126. #define RHD_MMIO_BAR       2
  127.  
  128. #define RHD_MEM_GART       1
  129. #define RHD_MEM_FB         2
  130.  
  131. #define RADEON_DEFAULT_GART_SIZE         8       /* MB (must be 2^n and > 4MB) */
  132. #define R300_DEFAULT_GART_SIZE           32      /* MB (for R300 and above) */
  133. #define RADEON_DEFAULT_RING_SIZE         1       /* MB (must be page aligned) */
  134. #define RADEON_DEFAULT_BUFFER_SIZE       2       /* MB (must be page aligned) */
  135. #define RADEON_DEFAULT_GART_TEX_SIZE     1       /* MB (must be page aligned) */
  136.  
  137. #define RADEON_DEFAULT_CP_TIMEOUT        100000  /* usecs */
  138.  
  139. #define RADEON_DEFAULT_PCI_APER_SIZE     32      /* in MB */
  140.  
  141.  
  142. typedef struct RHDRec
  143. {
  144.   u32_t            MMIOBase;
  145.   u32_t            MMIOMapSize;
  146.  
  147. //  CARD32            FbBase;            /* map base of fb   */
  148.  // u32_t            PhisBase;
  149.  // u32_t            FbIntAddress;       /* card internal address of FB */
  150.  // u32_t            FbMapSize;
  151.  
  152.   u32_t            FbFreeStart;
  153.   u32_t            FbFreeSize;
  154.  
  155.   /* visible part of the framebuffer */
  156. //  unsigned int      FbScanoutStart;
  157. //  unsigned int      FbScanoutSize;
  158.  
  159.   u32_t            LinearAddr;           /* Frame buffer physical address     */
  160.  
  161.   u32_t            fbLocation;
  162.   u32_t            mc_fb_location;
  163.   u32_t            mc_agp_location;
  164.   u32_t            mc_agp_location_hi;
  165.  
  166.   u32_t            videoRam;
  167.  
  168.   u32_t            MemCntl;
  169.   u32_t            BusCntl;
  170.   unsigned long    FbMapSize;            /* Size of frame buffer, in bytes    */
  171.   unsigned long    FbSecureSize;         /* Size of secured fb area at end of
  172.                                             framebuffer */
  173.  
  174.  
  175.   RADEONChipFamily ChipFamily;
  176.   RADEONErrata     ChipErrata;
  177.  
  178.   char             *chipset;
  179.  
  180.   Bool              IsIGP;
  181.   Bool              IsMobility;
  182.   Bool              HasCRTC2;
  183.  
  184.   u32_t            bus;
  185.   u32_t            devfn;
  186.  
  187.   PCITAG           PciTag;
  188.   u16_t            PciDeviceID;
  189.  
  190.   u16_t            subvendor_id;
  191.   u16_t            subdevice_id;
  192.  
  193.   RADEONCardType   cardType;            /* Current card is a PCI card */
  194.  
  195.   u32_t            memBase[6];
  196.   u32_t            ioBase[6];
  197.   u32_t            memtype[6];
  198.   u32_t            memsize[6];
  199.  
  200.   struct mem_block  *fb_heap;
  201.   struct mem_block  *gart_heap;
  202.  
  203.   u32_t            displayWidth;
  204.   u32_t            displayHeight;
  205.  
  206.   u32_t            gartSize;
  207.  
  208.   u32_t*           ringBase;
  209.   u32_t            ring_rp;
  210.   u32_t            ring_wp;
  211.   u32_t            ringSize;
  212.   u32_t            ring_avail;
  213.  
  214.   u32_t            bufSize;
  215.   u32_t            gartTexSize;
  216.   u32_t            pciAperSize;
  217.   u32_t            CPusecTimeout;
  218.  
  219.   int              __xmin;
  220.   int              __ymin;
  221.   int              __xmax;
  222.   int              __ymax;
  223.  
  224.   u32_t            gui_control;
  225.   u32_t            dst_pitch_offset;
  226.   u32_t            surface_cntl;
  227.  
  228.  
  229.   volatile u32_t   host_rp   __attribute__ ((aligned (128)));
  230.  
  231.   volatile u32_t   scratch0  __attribute__ ((aligned (128)));
  232.   volatile u32_t   scratch1;
  233.   volatile u32_t   scratch2;
  234.   volatile u32_t   scratch3;
  235.   volatile u32_t   scratch4;
  236.   volatile u32_t   scratch5;
  237.   volatile u32_t   scratch6;
  238.   volatile u32_t   scratch7;
  239.  
  240.   int              RamWidth  __attribute__ ((aligned (128)));
  241.   Bool             IsDDR;
  242.  
  243.   int              num_gb_pipes;
  244.   int              has_tcl;
  245.  
  246. }RHD_t, *RHDPtr;
  247.  
  248. extern RHD_t rhd;
  249.  
  250.  
  251.  
  252. #define R5XX_DP_BRUSH_BKGD_CLR            0x1478
  253. #define R5XX_DP_BRUSH_FRGD_CLR            0x147c
  254. #define R5XX_BRUSH_DATA0                  0x1480
  255. #define R5XX_BRUSH_DATA1                  0x1484
  256.  
  257. # define RADEON_GMC_SRC_PITCH_OFFSET_CNTL (1 << 0)
  258. #       define RADEON_GMC_DST_PITCH_OFFSET_CNTL (1 << 1)
  259. # define RADEON_GMC_BRUSH_SOLID_COLOR     (13 << 4)
  260. # define RADEON_GMC_BRUSH_NONE            (15 << 4)
  261. # define RADEON_GMC_DST_16BPP             (4 << 8)
  262. # define RADEON_GMC_DST_24BPP             (5 << 8)
  263. # define RADEON_GMC_DST_32BPP             (6 << 8)
  264. # define RADEON_GMC_DST_DATATYPE_SHIFT     8
  265. # define RADEON_GMC_SRC_DATATYPE_COLOR    (3 << 12)
  266. # define RADEON_DP_SRC_SOURCE_MEMORY      (2 << 24)
  267. # define RADEON_DP_SRC_SOURCE_HOST_DATA   (3 << 24)
  268. # define RADEON_GMC_CLR_CMP_CNTL_DIS      (1 << 28)
  269. # define RADEON_GMC_WR_MSK_DIS            (1 << 30)
  270. # define RADEON_ROP3_S                 0x00cc0000
  271. # define RADEON_ROP3_P                 0x00f00000
  272.  
  273. #define RADEON_CP_PACKET0              0x00000000
  274. #define RADEON_CP_PACKET1              0x40000000
  275. #define RADEON_CP_PACKET2              0x80000000
  276. #define RADEON_CP_PACKET3              0xC0000000
  277.  
  278. # define RADEON_CNTL_PAINT             0x00009100
  279. # define RADEON_CNTL_BITBLT            0x00009200
  280. # define RADEON_CNTL_TRANBLT           0x00009C00
  281.  
  282. # define RADEON_CNTL_PAINT_POLYLINE    0x00009500
  283. # define RADEON_CNTL_PAINT_MULTI       0x00009A00
  284.  
  285. #define CP_PACKET0(reg, n)            \
  286.     (RADEON_CP_PACKET0 | ((n - 1 ) << 16) | ((reg) >> 2))
  287.  
  288. #define CP_PACKET1(reg0, reg1)            \
  289.         (RADEON_CP_PACKET1 | (((reg1) >> 2) << 11) | ((reg0) >> 2))
  290.  
  291. #define CP_PACKET2()                     \
  292.   (RADEON_CP_PACKET2)
  293.  
  294. #define CP_PACKET3( pkt, n )             \
  295.         (RADEON_CP_PACKET3 | (pkt) | ((n) << 16))
  296.  
  297.  
  298. #define BEGIN_RING( req ) do {                                     \
  299.      int avail = rhd.ring_rp-rhd.ring_wp;                          \
  300.      if (avail <=0 ) avail+= 0x4000;                                \
  301.      if( (req)+128 > avail)                                        \
  302.      {                                                             \
  303.         rhd.ring_rp = INREG(RADEON_CP_RB_RPTR);                    \
  304.         avail = rhd.ring_rp-rhd.ring_wp;                           \
  305.         if (avail <= 0) avail+= 0x4000;                             \
  306.         if( (req)+128 > avail){                                    \
  307.            safe_sti(ifl);                                          \
  308.            return 0;                                               \
  309.         };                                                         \
  310.      }                                                             \
  311.      ring = &rhd.ringBase[rhd.ring_wp];                            \
  312. }while(0);
  313.  
  314. #define ADVANCE_RING()
  315.  
  316. #define OUT_RING( x )        *ring++ = (x)
  317.  
  318. #define CP_REG(reg, val)                 \
  319. do {                                     \
  320.     ring[0]  = CP_PACKET0((reg), 1);     \
  321.     ring[1]  = (val);                    \
  322.     ring+=  2;                           \
  323. } while (0)
  324.  
  325. #define DRM_MEMORYBARRIER()  __asm volatile("lock; addl $0,0(%%esp)" : : : "memory");
  326.  
  327. #define COMMIT_RING() do {                             \
  328.   rhd.ring_wp = (ring - rhd.ringBase) & 0x3FFF;        \
  329.   /* Flush writes to ring */                           \
  330.     DRM_MEMORYBARRIER();                               \
  331.   /*GET_RING_HEAD( dev_priv );          */             \
  332.   OUTREG( RADEON_CP_RB_WPTR, rhd.ring_wp);             \
  333.     /* read from PCI bus to ensure correct posting */  \
  334. /*  INREG( RADEON_CP_RB_RPTR );    */                  \
  335. } while (0)
  336.  
  337.  
  338.  
  339. typedef struct {
  340.     int                 token;          /* id of the token */
  341.     const char *        name;           /* token name */
  342. } SymTabRec, *SymTabPtr;
  343.  
  344.  
  345.  
  346. extern inline void
  347. OUTREG8(u16_t offset, u8_t value)
  348. {
  349.   *(volatile u8_t *)((u8_t *)(rhd.MMIOBase + offset)) = value;
  350. }
  351.  
  352.  
  353. extern inline u32_t INREG(u16_t offset)
  354. {
  355.   return *(volatile u32_t *)((u8_t*)(rhd.MMIOBase + offset));
  356. }
  357.  
  358.  
  359. extern inline void OUTREG(u16_t offset, u32_t value)
  360. {
  361.   *(volatile u32_t *)((u8_t *)(rhd.MMIOBase + offset)) = value;
  362. }
  363.  
  364. //#define OUTREG( offset, value) \
  365. //  *(volatile u32_t *)((u8_t *)(rhd.MMIOBase + (u32_t)(offset))) = (u32_t)value
  366.  
  367.  
  368. extern inline u32_t _RHDRegRead(RHDPtr rhdPtr, u16_t offset)
  369. {
  370.   return *(volatile u32_t *)((u8_t*)(rhdPtr->MMIOBase + offset));
  371. }
  372.  
  373. extern inline void
  374. MASKREG(u16_t offset, u32_t value, u32_t mask)
  375. {
  376.   u32_t tmp;
  377.  
  378.   tmp = INREG(offset);
  379.   tmp &= ~mask;
  380.   tmp |= (value & mask);
  381.   OUTREG(offset, tmp);
  382. };
  383.  
  384.  
  385. #define INPLL( addr) RADEONINPLL( addr)
  386.  
  387. #define OUTPLL( addr, val) RADEONOUTPLL( addr, val)
  388.  
  389.  
  390. extern inline void
  391. _RHDRegWrite(RHDPtr rhdPtr, u16_t offset, u32_t value)
  392. {
  393.   *(volatile u32_t *)((u8_t *)(rhdPtr->MMIOBase + offset)) = value;
  394. }
  395.  
  396. extern inline void
  397. _RHDRegMask(RHDPtr rhdPtr, u16_t offset, u32_t value, u32_t mask)
  398. {
  399.   u32_t tmp;
  400.  
  401.   tmp = _RHDRegRead(rhdPtr, offset);
  402.   tmp &= ~mask;
  403.   tmp |= (value & mask);
  404.   _RHDRegWrite(rhdPtr, offset, tmp);
  405. };
  406.  
  407. #define RHDRegRead(ptr, offset) _RHDRegRead((ptr)->rhdPtr, (offset))
  408. #define RHDRegWrite(ptr, offset, value) _RHDRegWrite((ptr)->rhdPtr, (offset), (value))
  409. #define RHDRegMask(ptr, offset, value, mask) _RHDRegMask((ptr)->rhdPtr, (offset), (value), (mask))
  410.  
  411.  
  412. RHDPtr FindPciDevice();
  413.  
  414. Bool RHDPreInit();
  415. int rhdInitHeap(RHDPtr rhdPtr);
  416.  
  417. #define RHDFUNC(ptr)
  418.  
  419. #define DBG(x) x
  420. //  #define DBG(x)
  421.  
  422. #pragma pack (push,1)
  423. typedef struct s_cursor
  424. {
  425.    u32_t   magic;                           // 'CURS'
  426.    void  (*destroy)(struct s_cursor*);    // destructor
  427.    u32_t   fd;                              // next object in list
  428.    u32_t   bk;                              // prev object in list
  429.    u32_t   pid;                             // owner id
  430.  
  431.    void *base;                            // allocated memory
  432.    u32_t   hot_x;                           // hotspot coords
  433.    u32_t   hot_y;
  434. }cursor_t;
  435. #pragma pack (pop)
  436.  
  437. #define LOAD_FROM_FILE   0
  438. #define LOAD_FROM_MEM    1
  439. #define LOAD_INDIRECT    2
  440.  
  441. cursor_t *create_cursor(u32_t pid, void *src, u32_t flags);
  442. void __stdcall copy_cursor(void *img, void *src);
  443. void destroy_cursor(cursor_t *cursor);
  444. void __destroy_cursor(cursor_t *cursor);                // wrap
  445.  
  446. void __stdcall r500_SelectCursor(cursor_t *cursor);
  447. void __stdcall r500_SetCursor(cursor_t *cursor, int x, int y);
  448. void __stdcall r500_CursorRestore(int x, int y);
  449.  
  450. void  R5xx2DInit();
  451.  
  452.  
  453. typedef struct {
  454.     u32_t x ;
  455.     u32_t y ;
  456. } xPointFixed;
  457.  
  458. typedef u32_t   xFixed_16_16;
  459.  
  460. typedef xFixed_16_16  xFixed;
  461.  
  462. #define XFIXED_BITS 16
  463.  
  464. #define xFixedToInt(f)  (int) ((f) >> XFIXED_BITS)
  465. #define IntToxFixed(i)  ((xFixed) (i) << XFIXED_BITS)
  466.  
  467. #define xFixedToFloat(f) (((float) (f)) / 65536)
  468.  
  469. #define PICT_FORMAT(bpp,type,a,r,g,b) (((bpp) << 24) |  \
  470.                                          ((type) << 16) | \
  471.                                          ((a) << 12) | \
  472.                                          ((r) << 8) | \
  473.                                          ((g) << 4) | \
  474.                                          ((b)))
  475.  
  476. #define PICT_FORMAT_A(f)  (((f) >> 12) & 0x0f)
  477. #define PICT_FORMAT_RGB(f)  (((f)      ) & 0xfff)
  478.  
  479. #define PICT_TYPE_OTHER 0
  480. #define PICT_TYPE_A     1
  481. #define PICT_TYPE_ARGB  2
  482. #define PICT_TYPE_ABGR  3
  483. #define PICT_TYPE_COLOR 4
  484. #define PICT_TYPE_GRAY  5
  485.  
  486. typedef enum _PictFormatShort {
  487.    PICT_a8r8g8b8 =      PICT_FORMAT(32,PICT_TYPE_ARGB,8,8,8,8),
  488.    PICT_x8r8g8b8 =      PICT_FORMAT(32,PICT_TYPE_ARGB,0,8,8,8),
  489.    PICT_a8b8g8r8 =      PICT_FORMAT(32,PICT_TYPE_ABGR,8,8,8,8),
  490.    PICT_x8b8g8r8 =      PICT_FORMAT(32,PICT_TYPE_ABGR,0,8,8,8),
  491.  
  492. /* 24bpp formats */
  493.    PICT_r8g8b8 =        PICT_FORMAT(24,PICT_TYPE_ARGB,0,8,8,8),
  494.    PICT_b8g8r8 =        PICT_FORMAT(24,PICT_TYPE_ABGR,0,8,8,8),
  495.  
  496. /* 16bpp formats */
  497.    PICT_r5g6b5 =        PICT_FORMAT(16,PICT_TYPE_ARGB,0,5,6,5),
  498.    PICT_b5g6r5 =        PICT_FORMAT(16,PICT_TYPE_ABGR,0,5,6,5),
  499.  
  500.    PICT_a1r5g5b5 =      PICT_FORMAT(16,PICT_TYPE_ARGB,1,5,5,5),
  501.    PICT_x1r5g5b5 =      PICT_FORMAT(16,PICT_TYPE_ARGB,0,5,5,5),
  502.    PICT_a1b5g5r5 =      PICT_FORMAT(16,PICT_TYPE_ABGR,1,5,5,5),
  503.    PICT_x1b5g5r5 =      PICT_FORMAT(16,PICT_TYPE_ABGR,0,5,5,5),
  504.    PICT_a4r4g4b4 =      PICT_FORMAT(16,PICT_TYPE_ARGB,4,4,4,4),
  505.    PICT_x4r4g4b4 =      PICT_FORMAT(16,PICT_TYPE_ARGB,0,4,4,4),
  506.    PICT_a4b4g4r4 =      PICT_FORMAT(16,PICT_TYPE_ABGR,4,4,4,4),
  507.    PICT_x4b4g4r4 =      PICT_FORMAT(16,PICT_TYPE_ABGR,0,4,4,4),
  508.  
  509. /* 8bpp formats */
  510.    PICT_a8 =            PICT_FORMAT(8,PICT_TYPE_A,8,0,0,0),
  511.    PICT_r3g3b2 =        PICT_FORMAT(8,PICT_TYPE_ARGB,0,3,3,2),
  512.    PICT_b2g3r3 =        PICT_FORMAT(8,PICT_TYPE_ABGR,0,3,3,2),
  513.    PICT_a2r2g2b2 =      PICT_FORMAT(8,PICT_TYPE_ARGB,2,2,2,2),
  514.    PICT_a2b2g2r2 =      PICT_FORMAT(8,PICT_TYPE_ABGR,2,2,2,2),
  515.  
  516.    PICT_c8 =            PICT_FORMAT(8,PICT_TYPE_COLOR,0,0,0,0),
  517.    PICT_g8 =            PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0),
  518.  
  519.    PICT_x4a4 =          PICT_FORMAT(8,PICT_TYPE_A,4,0,0,0),
  520.  
  521.    PICT_x4c4 =          PICT_FORMAT(8,PICT_TYPE_COLOR,0,0,0,0),
  522.    PICT_x4g4 =          PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0),
  523.  
  524. /* 4bpp formats */
  525.    PICT_a4 =            PICT_FORMAT(4,PICT_TYPE_A,4,0,0,0),
  526.    PICT_r1g2b1 =        PICT_FORMAT(4,PICT_TYPE_ARGB,0,1,2,1),
  527.    PICT_b1g2r1 =        PICT_FORMAT(4,PICT_TYPE_ABGR,0,1,2,1),
  528.    PICT_a1r1g1b1 =      PICT_FORMAT(4,PICT_TYPE_ARGB,1,1,1,1),
  529.    PICT_a1b1g1r1 =      PICT_FORMAT(4,PICT_TYPE_ABGR,1,1,1,1),
  530.  
  531.    PICT_c4 =            PICT_FORMAT(4,PICT_TYPE_COLOR,0,0,0,0),
  532.    PICT_g4 =            PICT_FORMAT(4,PICT_TYPE_GRAY,0,0,0,0),
  533.  
  534. /* 1bpp formats */
  535.    PICT_a1 =            PICT_FORMAT(1,PICT_TYPE_A,1,0,0,0),
  536.  
  537.    PICT_g1 =            PICT_FORMAT(1,PICT_TYPE_GRAY,0,0,0,0),
  538. } PictFormatShort;
  539.  
  540. void dump_mem();
  541.