~ubuntu-branches/debian/squeeze/xserver-xorg-video-voodoo/squeeze

« back to all changes in this revision

Viewing changes to src/voodoo_hardware.c

  • Committer: Bazaar Package Importer
  • Author(s): Julien Cristau
  • Date: 2009-04-09 13:29:08 UTC
  • mfrom: (1.1.10 upstream) (0.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20090409132908-r0t99gdhinm4ul66
* Run autoreconf on build.
* Allow parallel builds.
* New upstream release.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
#include "micmap.h"
44
44
#include "xf86.h"
45
45
#include "xf86_OSproc.h"
46
 
#include "xf86Version.h"
47
46
#include "xf86PciInfo.h"
48
47
#include "xf86Pci.h"
49
48
#include "xf86cmap.h"
50
49
#include "shadowfb.h"
51
50
#include "vgaHW.h"
52
 
#include "xf86DDC.h"
53
51
#include "xf86RAC.h"
54
52
#include "xf86Resources.h"
55
53
#include "xaa.h"
65
63
#include "mipict.h"
66
64
#include "dixstruct.h"
67
65
 
 
66
#include <unistd.h>
 
67
 
 
68
 
 
69
#if 0
 
70
static void VoodooReadWriteBank(ScreenPtr pScreen, int bank);
 
71
#endif
 
72
static Bool VoodooSetupForCPUToScreenAlphaTexture(ScrnInfoPtr pScrn, int op,
 
73
        CARD16 red, CARD16 green, CARD16 blue, CARD16 alpha, int alphaType,
 
74
        CARD8 *alphaPtr, int alphaPitch, int width, int height, int flags);
 
75
static void VoodooSubsequentCPUToScreenAlphaTexture(ScrnInfoPtr pScrn,
 
76
        int dstx, int dsty, int srcx, int srcy, int width, int height);
 
77
static Bool VoodooSetupForCPUToScreenTexture(ScrnInfoPtr pScrn, int op,
 
78
        int texType, CARD8 *texPtr, int texPitch, int width, int height,
 
79
        int flags);
 
80
static void VoodooSubsequentCPUToScreenTexture(ScrnInfoPtr pScrn,
 
81
        int dstx, int dsty, int srcx, int srcy, int width, int height);
 
82
 
 
83
 
68
84
static int debug = 0;
69
85
 
70
86
/*
669
685
}       
670
686
 
671
687
/*
 
688
 *     Voodoo exit logic
 
689
 */
 
690
 
 
691
void VoodooRestorePassThrough(VoodooPtr pVoo)
 
692
{
 
693
    pci_enable(pVoo, 1, 0, 0);
 
694
    mmio32_w(pVoo, 0x210, 0);
 
695
    pci_enable(pVoo, 0, 0, 1);
 
696
}
 
697
 
 
698
/*
672
699
 *      Copiers for Voodoo1
673
700
 *
674
701
 *      Voodoo1 has no CPU to screen blit, and also lacks SGRAM fill
814
841
        mmio32_w(pVoo, 0x114, pVoo->lfbMode);
815
842
}
816
843
 
817
 
void VoodooReadWriteBank(ScreenPtr pScreen, int bank)
 
844
#if 0
 
845
static void VoodooReadWriteBank(ScreenPtr pScreen, int bank)
818
846
{
819
847
        ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
820
848
        VoodooPtr pVoo = VoodooPTR(pScrn);
832
860
        }
833
861
        mmio32_w(pVoo, 0x114, pVoo->lfbMode);
834
862
}
 
863
#endif
835
864
 
836
865
/*
837
866
 *      We normally want to load all four rop variants at once so
951
980
                        int rop, unsigned int planemask)
952
981
{
953
982
        VoodooPtr pVoo = VoodooPTR(pScrn);
 
983
        if (debug)
 
984
            ErrorF("Setup for solid fill colour %04X, rop %d, Mask %04X.\n",
 
985
                   color, rop, planemask);
954
986
        Voodoo2Setup2D(pVoo);
955
987
        mmio32_w_chuck(pVoo, 0x2EC, ropxlate[rop]);     /* rop */
956
988
        mmio32_w_chuck(pVoo, 0x2F0, color);             /* fg color */
961
993
                        int w, int h)
962
994
{
963
995
        VoodooPtr pVoo = VoodooPTR(pScrn);
 
996
        if (debug)
 
997
            ErrorF("Fill (%d, %d) for (%d, %d)\n", x, y, w, h);
964
998
        wait_idle(pVoo);
965
999
        mmio32_w_chuck(pVoo, 0x2E4, (y<<16) | x);       /* Dst x,y */
966
1000
        /* Set size and fire */
1183
1217
 */
1184
1218
 
1185
1219
 
1186
 
Bool VoodooSetupForCPUToScreenAlphaTexture(ScrnInfoPtr pScrn, int op, CARD16 red, 
1187
 
        CARD16 green, CARD16 blue, CARD16 alpha, int alphaType, CARD8 *alphaPtr,
1188
 
        int alphaPitch, int width, int height, int flags)
 
1220
static Bool VoodooSetupForCPUToScreenAlphaTexture(ScrnInfoPtr pScrn, int op,
 
1221
        CARD16 red, CARD16 green, CARD16 blue, CARD16 alpha, int alphaType,
 
1222
        CARD8 *alphaPtr, int alphaPitch, int width, int height, int flags)
1189
1223
{
1190
1224
        VoodooPtr pVoo = VoodooPTR(pScrn);
1191
1225
 
1210
1244
        return TRUE;    
1211
1245
}       
1212
1246
 
1213
 
void VoodooSubsequentCPUToScreenAlphaTexture(ScrnInfoPtr pScrn, int dstx, int dsty, int srcx, int srcy, int width, int height)
 
1247
static void VoodooSubsequentCPUToScreenAlphaTexture(ScrnInfoPtr pScrn,
 
1248
        int dstx, int dsty, int srcx, int srcy, int width, int height)
1214
1249
{
1215
1250
        VoodooPtr pVoo = VoodooPTR(pScrn);
1216
1251
        /* 32bit LFB write mode */
1258
1293
        mmio32_w(pVoo, 0x10C, 0);
1259
1294
}
1260
1295
 
1261
 
Bool VoodooSetupForCPUToScreenTexture(ScrnInfoPtr pScrn, int op, int texType,
1262
 
        CARD8 *texPtr, int texPitch, int width, int height, int flags)
 
1296
static Bool VoodooSetupForCPUToScreenTexture(ScrnInfoPtr pScrn, int op,
 
1297
        int texType, CARD8 *texPtr, int texPitch, int width, int height,
 
1298
        int flags)
1263
1299
{
1264
1300
        VoodooPtr pVoo = VoodooPTR(pScrn);
1265
1301
        
1283
1319
        return TRUE;
1284
1320
}
1285
1321
 
1286
 
void VoodooSubsequentCPUToScreenTexture(ScrnInfoPtr pScrn, int dstx, int dsty, int srcx, int srcy, int width, int height)
 
1322
static void VoodooSubsequentCPUToScreenTexture(ScrnInfoPtr pScrn,
 
1323
        int dstx, int dsty, int srcx, int srcy, int width, int height)
1287
1324
{
1288
1325
        VoodooPtr pVoo = VoodooPTR(pScrn);
1289
1326
        /* 32bit LFB write mode */