src/video/fbcon/riva_mmio.h
author Edgar Simo <bobbens@gmail.com>
Sun, 06 Jul 2008 17:06:37 +0000
branchgsoc2008_force_feedback
changeset 2498 ab567bd667bf
parent 1895 c121d94672cb
permissions -rw-r--r--
Fixed various mistakes in the doxygen.
slouken@133
     1
/***************************************************************************\
slouken@133
     2
|*                                                                           *|
slouken@133
     3
|*       Copyright 1993-1999 NVIDIA, Corporation.  All rights reserved.      *|
slouken@133
     4
|*                                                                           *|
slouken@133
     5
|*     NOTICE TO USER:   The source code  is copyrighted under  U.S. and     *|
slouken@133
     6
|*     international laws.  Users and possessors of this source code are     *|
slouken@133
     7
|*     hereby granted a nonexclusive,  royalty-free copyright license to     *|
slouken@133
     8
|*     use this code in individual and commercial software.                  *|
slouken@133
     9
|*                                                                           *|
slouken@133
    10
|*     Any use of this source code must include,  in the user documenta-     *|
slouken@133
    11
|*     tion and  internal comments to the code,  notices to the end user     *|
slouken@133
    12
|*     as follows:                                                           *|
slouken@133
    13
|*                                                                           *|
slouken@133
    14
|*       Copyright 1993-1999 NVIDIA, Corporation.  All rights reserved.      *|
slouken@133
    15
|*                                                                           *|
slouken@133
    16
|*     NVIDIA, CORPORATION MAKES NO REPRESENTATION ABOUT THE SUITABILITY     *|
slouken@133
    17
|*     OF  THIS SOURCE  CODE  FOR ANY PURPOSE.  IT IS  PROVIDED  "AS IS"     *|
slouken@133
    18
|*     WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.  NVIDIA, CORPOR-     *|
slouken@133
    19
|*     ATION DISCLAIMS ALL WARRANTIES  WITH REGARD  TO THIS SOURCE CODE,     *|
slouken@133
    20
|*     INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGE-     *|
slouken@133
    21
|*     MENT,  AND FITNESS  FOR A PARTICULAR PURPOSE.   IN NO EVENT SHALL     *|
slouken@133
    22
|*     NVIDIA, CORPORATION  BE LIABLE FOR ANY SPECIAL,  INDIRECT,  INCI-     *|
slouken@133
    23
|*     DENTAL, OR CONSEQUENTIAL DAMAGES,  OR ANY DAMAGES  WHATSOEVER RE-     *|
slouken@133
    24
|*     SULTING FROM LOSS OF USE,  DATA OR PROFITS,  WHETHER IN AN ACTION     *|
slouken@133
    25
|*     OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,  ARISING OUT OF     *|
slouken@133
    26
|*     OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE.     *|
slouken@133
    27
|*                                                                           *|
slouken@133
    28
|*     U.S. Government  End  Users.   This source code  is a "commercial     *|
slouken@133
    29
|*     item,"  as that  term is  defined at  48 C.F.R. 2.101 (OCT 1995),     *|
slouken@133
    30
|*     consisting  of "commercial  computer  software"  and  "commercial     *|
slouken@133
    31
|*     computer  software  documentation,"  as such  terms  are  used in     *|
slouken@133
    32
|*     48 C.F.R. 12.212 (SEPT 1995)  and is provided to the U.S. Govern-     *|
slouken@133
    33
|*     ment only as  a commercial end item.   Consistent with  48 C.F.R.     *|
slouken@133
    34
|*     12.212 and  48 C.F.R. 227.7202-1 through  227.7202-4 (JUNE 1995),     *|
slouken@133
    35
|*     all U.S. Government End Users  acquire the source code  with only     *|
slouken@133
    36
|*     those rights set forth herein.                                        *|
slouken@133
    37
|*                                                                           *|
slouken@133
    38
\***************************************************************************/
slouken@133
    39
slouken@133
    40
#ifndef __RIVA_HW_H__
slouken@133
    41
#define __RIVA_HW_H__
slouken@133
    42
#define RIVA_SW_VERSION 0x00010003
slouken@133
    43
slouken@133
    44
/*
slouken@133
    45
 * Typedefs to force certain sized values.
slouken@133
    46
 */
slouken@1895
    47
typedef Uint8 U008;
slouken@133
    48
typedef Uint16 U016;
slouken@133
    49
typedef Uint32 U032;
slouken@133
    50
slouken@133
    51
/*
slouken@133
    52
 * HW access macros.
slouken@133
    53
 */
slouken@133
    54
#define NV_WR08(p,i,d)  (((U008 *)(p))[i]=(d))
slouken@133
    55
#define NV_RD08(p,i)    (((U008 *)(p))[i])
slouken@133
    56
#define NV_WR16(p,i,d)  (((U016 *)(p))[(i)/2]=(d))
slouken@133
    57
#define NV_RD16(p,i)    (((U016 *)(p))[(i)/2])
slouken@133
    58
#define NV_WR32(p,i,d)  (((U032 *)(p))[(i)/4]=(d))
slouken@133
    59
#define NV_RD32(p,i)    (((U032 *)(p))[(i)/4])
slouken@133
    60
#define VGA_WR08(p,i,d) NV_WR08(p,i,d)
slouken@133
    61
#define VGA_RD08(p,i)   NV_RD08(p,i)
slouken@133
    62
slouken@133
    63
/*
slouken@133
    64
 * Define supported architectures.
slouken@133
    65
 */
slouken@133
    66
#define NV_ARCH_03  0x03
slouken@133
    67
#define NV_ARCH_04  0x04
slouken@133
    68
#define NV_ARCH_10  0x10
slouken@133
    69
/***************************************************************************\
slouken@133
    70
*                                                                           *
slouken@133
    71
*                             FIFO registers.                               *
slouken@133
    72
*                                                                           *
slouken@133
    73
\***************************************************************************/
slouken@133
    74
slouken@133
    75
/*
slouken@133
    76
 * Raster OPeration. Windows style ROP3.
slouken@133
    77
 */
slouken@133
    78
typedef volatile struct
slouken@133
    79
{
slouken@133
    80
    U032 reserved00[4];
slouken@133
    81
    U016 FifoFree;
slouken@133
    82
    U016 Nop;
slouken@133
    83
    U032 reserved01[0x0BB];
slouken@133
    84
    U032 Rop3;
slouken@133
    85
} RivaRop;
slouken@133
    86
/*
slouken@133
    87
 * 8X8 Monochrome pattern.
slouken@133
    88
 */
slouken@133
    89
typedef volatile struct
slouken@133
    90
{
slouken@133
    91
    U032 reserved00[4];
slouken@133
    92
    U016 FifoFree;
slouken@133
    93
    U016 Nop;
slouken@133
    94
    U032 reserved01[0x0BD];
slouken@133
    95
    U032 Shape;
slouken@133
    96
    U032 reserved03[0x001];
slouken@133
    97
    U032 Color0;
slouken@133
    98
    U032 Color1;
slouken@133
    99
    U032 Monochrome[2];
slouken@133
   100
} RivaPattern;
slouken@133
   101
/*
slouken@133
   102
 * Scissor clip rectangle.
slouken@133
   103
 */
slouken@133
   104
typedef volatile struct
slouken@133
   105
{
slouken@133
   106
    U032 reserved00[4];
slouken@133
   107
    U016 FifoFree;
slouken@133
   108
    U016 Nop;
slouken@133
   109
    U032 reserved01[0x0BB];
slouken@133
   110
    U032 TopLeft;
slouken@133
   111
    U032 WidthHeight;
slouken@133
   112
} RivaClip;
slouken@133
   113
/*
slouken@133
   114
 * 2D filled rectangle.
slouken@133
   115
 */
slouken@133
   116
typedef volatile struct
slouken@133
   117
{
slouken@133
   118
    U032 reserved00[4];
slouken@133
   119
    U016 FifoFree;
slouken@133
   120
    U016 Nop[1];
slouken@133
   121
    U032 reserved01[0x0BC];
slouken@133
   122
    U032 Color;
slouken@133
   123
    U032 reserved03[0x03E];
slouken@133
   124
    U032 TopLeft;
slouken@133
   125
    U032 WidthHeight;
slouken@133
   126
} RivaRectangle;
slouken@133
   127
/*
slouken@133
   128
 * 2D screen-screen BLT.
slouken@133
   129
 */
slouken@133
   130
typedef volatile struct
slouken@133
   131
{
slouken@133
   132
    U032 reserved00[4];
slouken@133
   133
    U016 FifoFree;
slouken@133
   134
    U016 Nop;
slouken@133
   135
    U032 reserved01[0x0BB];
slouken@133
   136
    U032 TopLeftSrc;
slouken@133
   137
    U032 TopLeftDst;
slouken@133
   138
    U032 WidthHeight;
slouken@133
   139
} RivaScreenBlt;
slouken@133
   140
/*
slouken@133
   141
 * 2D pixel BLT.
slouken@133
   142
 */
slouken@133
   143
typedef volatile struct
slouken@133
   144
{
slouken@133
   145
    U032 reserved00[4];
slouken@133
   146
    U016 FifoFree;
slouken@133
   147
    U016 Nop[1];
slouken@133
   148
    U032 reserved01[0x0BC];
slouken@133
   149
    U032 TopLeft;
slouken@133
   150
    U032 WidthHeight;
slouken@133
   151
    U032 WidthHeightIn;
slouken@133
   152
    U032 reserved02[0x03C];
slouken@133
   153
    U032 Pixels;
slouken@133
   154
} RivaPixmap;
slouken@133
   155
/*
slouken@133
   156
 * Filled rectangle combined with monochrome expand.  Useful for glyphs.
slouken@133
   157
 */
slouken@133
   158
typedef volatile struct
slouken@133
   159
{
slouken@133
   160
    U032 reserved00[4];
slouken@133
   161
    U016 FifoFree;
slouken@133
   162
    U016 Nop;
slouken@133
   163
    U032 reserved01[0x0BB];
slouken@1895
   164
    U032 reserved03[(0x040) - 1];
slouken@133
   165
    U032 Color1A;
slouken@133
   166
    struct
slouken@133
   167
    {
slouken@133
   168
        U032 TopLeft;
slouken@133
   169
        U032 WidthHeight;
slouken@133
   170
    } UnclippedRectangle[64];
slouken@1895
   171
    U032 reserved04[(0x080) - 3];
slouken@133
   172
    struct
slouken@133
   173
    {
slouken@133
   174
        U032 TopLeft;
slouken@133
   175
        U032 BottomRight;
slouken@133
   176
    } ClipB;
slouken@133
   177
    U032 Color1B;
slouken@133
   178
    struct
slouken@133
   179
    {
slouken@133
   180
        U032 TopLeft;
slouken@133
   181
        U032 BottomRight;
slouken@133
   182
    } ClippedRectangle[64];
slouken@1895
   183
    U032 reserved05[(0x080) - 5];
slouken@133
   184
    struct
slouken@133
   185
    {
slouken@133
   186
        U032 TopLeft;
slouken@133
   187
        U032 BottomRight;
slouken@133
   188
    } ClipC;
slouken@133
   189
    U032 Color1C;
slouken@133
   190
    U032 WidthHeightC;
slouken@133
   191
    U032 PointC;
slouken@133
   192
    U032 MonochromeData1C;
slouken@1895
   193
    U032 reserved06[(0x080) + 121];
slouken@133
   194
    struct
slouken@133
   195
    {
slouken@133
   196
        U032 TopLeft;
slouken@133
   197
        U032 BottomRight;
slouken@133
   198
    } ClipD;
slouken@133
   199
    U032 Color1D;
slouken@133
   200
    U032 WidthHeightInD;
slouken@133
   201
    U032 WidthHeightOutD;
slouken@133
   202
    U032 PointD;
slouken@133
   203
    U032 MonochromeData1D;
slouken@1895
   204
    U032 reserved07[(0x080) + 120];
slouken@133
   205
    struct
slouken@133
   206
    {
slouken@133
   207
        U032 TopLeft;
slouken@133
   208
        U032 BottomRight;
slouken@133
   209
    } ClipE;
slouken@133
   210
    U032 Color0E;
slouken@133
   211
    U032 Color1E;
slouken@133
   212
    U032 WidthHeightInE;
slouken@133
   213
    U032 WidthHeightOutE;
slouken@133
   214
    U032 PointE;
slouken@133
   215
    U032 MonochromeData01E;
slouken@133
   216
} RivaBitmap;
slouken@133
   217
/*
slouken@133
   218
 * 3D textured, Z buffered triangle.
slouken@133
   219
 */
slouken@133
   220
typedef volatile struct
slouken@133
   221
{
slouken@133
   222
    U032 reserved00[4];
slouken@133
   223
    U016 FifoFree;
slouken@133
   224
    U016 Nop;
slouken@133
   225
    U032 reserved01[0x0BC];
slouken@133
   226
    U032 TextureOffset;
slouken@133
   227
    U032 TextureFormat;
slouken@133
   228
    U032 TextureFilter;
slouken@133
   229
    U032 FogColor;
slouken@133
   230
/* This is a problem on LynxOS */
slouken@133
   231
#ifdef Control
slouken@133
   232
#undef Control
slouken@133
   233
#endif
slouken@133
   234
    U032 Control;
slouken@133
   235
    U032 AlphaTest;
slouken@133
   236
    U032 reserved02[0x339];
slouken@133
   237
    U032 FogAndIndex;
slouken@133
   238
    U032 Color;
slouken@133
   239
    float ScreenX;
slouken@133
   240
    float ScreenY;
slouken@133
   241
    float ScreenZ;
slouken@133
   242
    float EyeM;
slouken@133
   243
    float TextureS;
slouken@133
   244
    float TextureT;
slouken@133
   245
} RivaTexturedTriangle03;
slouken@133
   246
typedef volatile struct
slouken@133
   247
{
slouken@133
   248
    U032 reserved00[4];
slouken@133
   249
    U016 FifoFree;
slouken@133
   250
    U016 Nop;
slouken@133
   251
    U032 reserved01[0x0BB];
slouken@133
   252
    U032 ColorKey;
slouken@133
   253
    U032 TextureOffset;
slouken@133
   254
    U032 TextureFormat;
slouken@133
   255
    U032 TextureFilter;
slouken@133
   256
    U032 Blend;
slouken@133
   257
/* This is a problem on LynxOS */
slouken@133
   258
#ifdef Control
slouken@133
   259
#undef Control
slouken@133
   260
#endif
slouken@133
   261
    U032 Control;
slouken@133
   262
    U032 FogColor;
slouken@133
   263
    U032 reserved02[0x39];
slouken@133
   264
    struct
slouken@133
   265
    {
slouken@133
   266
        float ScreenX;
slouken@133
   267
        float ScreenY;
slouken@133
   268
        float ScreenZ;
slouken@133
   269
        float EyeM;
slouken@133
   270
        U032 Color;
slouken@133
   271
        U032 Specular;
slouken@133
   272
        float TextureS;
slouken@133
   273
        float TextureT;
slouken@133
   274
    } Vertex[16];
slouken@133
   275
    U032 DrawTriangle3D;
slouken@133
   276
} RivaTexturedTriangle05;
slouken@133
   277
/*
slouken@133
   278
 * 2D line.
slouken@133
   279
 */
slouken@133
   280
typedef volatile struct
slouken@133
   281
{
slouken@133
   282
    U032 reserved00[4];
slouken@133
   283
    U016 FifoFree;
slouken@133
   284
    U016 Nop[1];
slouken@133
   285
    U032 reserved01[0x0BC];
slouken@1895
   286
    U032 Color;                 /* source color               0304-0307 */
slouken@133
   287
    U032 Reserved02[0x03e];
slouken@1895
   288
    struct
slouken@1895
   289
    {                           /* start aliased methods in array   0400-    */
slouken@1895
   290
        U032 point0;            /* y_x S16_S16 in pixels            0-   3 */
slouken@1895
   291
        U032 point1;            /* y_x S16_S16 in pixels            4-   7 */
slouken@1895
   292
    } Lin[16];                  /* end of aliased methods in array      -047f */
slouken@1895
   293
    struct
slouken@1895
   294
    {                           /* start aliased methods in array   0480-    */
slouken@1895
   295
        U032 point0X;           /* in pixels, 0 at left                0-   3 */
slouken@1895
   296
        U032 point0Y;           /* in pixels, 0 at top                 4-   7 */
slouken@1895
   297
        U032 point1X;           /* in pixels, 0 at left                8-   b */
slouken@1895
   298
        U032 point1Y;           /* in pixels, 0 at top                 c-   f */
slouken@1895
   299
    } Lin32[8];                 /* end of aliased methods in array      -04ff */
slouken@1895
   300
    U032 PolyLin[32];           /* y_x S16_S16 in pixels         0500-057f */
slouken@1895
   301
    struct
slouken@1895
   302
    {                           /* start aliased methods in array   0580-    */
slouken@1895
   303
        U032 x;                 /* in pixels, 0 at left                0-   3 */
slouken@1895
   304
        U032 y;                 /* in pixels, 0 at top                 4-   7 */
slouken@1895
   305
    } PolyLin32[16];            /* end of aliased methods in array      -05ff */
slouken@1895
   306
    struct
slouken@1895
   307
    {                           /* start aliased methods in array   0600-    */
slouken@1895
   308
        U032 color;             /* source color                     0-   3 */
slouken@1895
   309
        U032 point;             /* y_x S16_S16 in pixels            4-   7 */
slouken@1895
   310
    } ColorPolyLin[16];         /* end of aliased methods in array      -067f */
slouken@133
   311
} RivaLine;
slouken@133
   312
/*
slouken@133
   313
 * 2D/3D surfaces
slouken@133
   314
 */
slouken@133
   315
typedef volatile struct
slouken@133
   316
{
slouken@133
   317
    U032 reserved00[4];
slouken@133
   318
    U016 FifoFree;
slouken@133
   319
    U016 Nop;
slouken@133
   320
    U032 reserved01[0x0BE];
slouken@133
   321
    U032 Offset;
slouken@133
   322
} RivaSurface;
slouken@133
   323
typedef volatile struct
slouken@133
   324
{
slouken@133
   325
    U032 reserved00[4];
slouken@133
   326
    U016 FifoFree;
slouken@133
   327
    U016 Nop;
slouken@133
   328
    U032 reserved01[0x0BD];
slouken@133
   329
    U032 Pitch;
slouken@133
   330
    U032 RenderBufferOffset;
slouken@133
   331
    U032 ZBufferOffset;
slouken@133
   332
} RivaSurface3D;
slouken@1895
   333
slouken@133
   334
/***************************************************************************\
slouken@133
   335
*                                                                           *
slouken@133
   336
*                        Virtualized RIVA H/W interface.                    *
slouken@133
   337
*                                                                           *
slouken@133
   338
\***************************************************************************/
slouken@133
   339
slouken@133
   340
struct _riva_hw_inst;
slouken@133
   341
struct _riva_hw_state;
slouken@133
   342
/*
slouken@133
   343
 * Virtialized chip interface. Makes RIVA 128 and TNT look alike.
slouken@133
   344
 */
slouken@133
   345
typedef struct _riva_hw_inst
slouken@133
   346
{
slouken@133
   347
    /*
slouken@133
   348
     * Chip specific settings.
slouken@133
   349
     */
slouken@133
   350
    U032 Architecture;
slouken@133
   351
    U032 Version;
slouken@133
   352
    U032 CrystalFreqKHz;
slouken@133
   353
    U032 RamAmountKBytes;
slouken@133
   354
    U032 MaxVClockFreqKHz;
slouken@133
   355
    U032 RamBandwidthKBytesPerSec;
slouken@133
   356
    U032 EnableIRQ;
slouken@133
   357
    U032 IO;
slouken@133
   358
    U032 VBlankBit;
slouken@133
   359
    U032 FifoFreeCount;
slouken@133
   360
    U032 FifoEmptyCount;
slouken@133
   361
    /*
slouken@133
   362
     * Non-FIFO registers.
slouken@133
   363
     */
slouken@133
   364
    volatile U032 *PCRTC;
slouken@133
   365
    volatile U032 *PRAMDAC;
slouken@133
   366
    volatile U032 *PFB;
slouken@133
   367
    volatile U032 *PFIFO;
slouken@133
   368
    volatile U032 *PGRAPH;
slouken@133
   369
    volatile U032 *PEXTDEV;
slouken@133
   370
    volatile U032 *PTIMER;
slouken@133
   371
    volatile U032 *PMC;
slouken@133
   372
    volatile U032 *PRAMIN;
slouken@133
   373
    volatile U032 *FIFO;
slouken@133
   374
    volatile U032 *CURSOR;
slouken@133
   375
    volatile U032 *CURSORPOS;
slouken@133
   376
    volatile U032 *VBLANKENABLE;
slouken@133
   377
    volatile U032 *VBLANK;
slouken@133
   378
    volatile U008 *PCIO;
slouken@133
   379
    volatile U008 *PVIO;
slouken@133
   380
    volatile U008 *PDIO;
slouken@133
   381
    /*
slouken@133
   382
     * Common chip functions.
slouken@133
   383
     */
slouken@1895
   384
    int (*Busy) (struct _riva_hw_inst *);
slouken@1895
   385
    void (*CalcStateExt) (struct _riva_hw_inst *, struct _riva_hw_state *,
slouken@1895
   386
                          int, int, int, int, int, int, int, int, int, int,
slouken@1895
   387
                          int, int, int);
slouken@1895
   388
    void (*LoadStateExt) (struct _riva_hw_inst *, struct _riva_hw_state *);
slouken@1895
   389
    void (*UnloadStateExt) (struct _riva_hw_inst *, struct _riva_hw_state *);
slouken@1895
   390
    void (*SetStartAddress) (struct _riva_hw_inst *, U032);
slouken@1895
   391
    void (*SetSurfaces2D) (struct _riva_hw_inst *, U032, U032);
slouken@1895
   392
    void (*SetSurfaces3D) (struct _riva_hw_inst *, U032, U032);
slouken@1895
   393
    int (*ShowHideCursor) (struct _riva_hw_inst *, int);
slouken@1895
   394
    void (*LockUnlock) (struct _riva_hw_inst *, int);
slouken@133
   395
    /*
slouken@133
   396
     * Current extended mode settings.
slouken@133
   397
     */
slouken@133
   398
    struct _riva_hw_state *CurrentState;
slouken@133
   399
    /*
slouken@133
   400
     * FIFO registers.
slouken@133
   401
     */
slouken@1895
   402
    RivaRop *Rop;
slouken@1895
   403
    RivaPattern *Patt;
slouken@1895
   404
    RivaClip *Clip;
slouken@1895
   405
    RivaPixmap *Pixmap;
slouken@1895
   406
    RivaScreenBlt *Blt;
slouken@1895
   407
    RivaBitmap *Bitmap;
slouken@1895
   408
    RivaLine *Line;
slouken@1895
   409
    RivaTexturedTriangle03 *Tri03;
slouken@1895
   410
    RivaTexturedTriangle05 *Tri05;
slouken@133
   411
} RIVA_HW_INST;
slouken@133
   412
/*
slouken@133
   413
 * Extended mode state information.
slouken@133
   414
 */
slouken@133
   415
typedef struct _riva_hw_state
slouken@133
   416
{
slouken@133
   417
    U032 bpp;
slouken@133
   418
    U032 width;
slouken@133
   419
    U032 height;
slouken@133
   420
    U032 repaint0;
slouken@133
   421
    U032 repaint1;
slouken@133
   422
    U032 screen;
slouken@133
   423
    U032 pixel;
slouken@133
   424
    U032 horiz;
slouken@133
   425
    U032 arbitration0;
slouken@133
   426
    U032 arbitration1;
slouken@133
   427
    U032 vpll;
slouken@133
   428
    U032 pllsel;
slouken@133
   429
    U032 general;
slouken@133
   430
    U032 config;
slouken@133
   431
    U032 cursor0;
slouken@133
   432
    U032 cursor1;
slouken@133
   433
    U032 cursor2;
slouken@133
   434
    U032 offset0;
slouken@133
   435
    U032 offset1;
slouken@133
   436
    U032 offset2;
slouken@133
   437
    U032 offset3;
slouken@133
   438
    U032 pitch0;
slouken@133
   439
    U032 pitch1;
slouken@133
   440
    U032 pitch2;
slouken@133
   441
    U032 pitch3;
slouken@133
   442
} RIVA_HW_STATE;
slouken@133
   443
slouken@133
   444
/*
slouken@133
   445
 * FIFO Free Count. Should attempt to yield processor if RIVA is busy.
slouken@133
   446
 */
slouken@133
   447
slouken@133
   448
#define RIVA_FIFO_FREE(hwptr,cnt)                                  \
slouken@133
   449
{                                                                  \
slouken@133
   450
   while (FifoFreeCount < (cnt))                                   \
slouken@133
   451
	FifoFreeCount = hwptr->FifoFree >> 2;                      \
slouken@133
   452
   FifoFreeCount -= (cnt);                                         \
slouken@133
   453
}
slouken@133
   454
#endif /* __RIVA_HW_H__ */
slouken@1895
   455
/* vi: set ts=4 sw=4 expandtab: */