diff options
author | Tilman Sauerbeck <tilman@code-monkey.de> | 2006-08-10 22:01:19 +0200 |
---|---|---|
committer | Tilman Sauerbeck <tilman@code-monkey.de> | 2006-08-10 22:01:19 +0200 |
commit | 9b24934be499fe5de9fdc02a71e41906c50791d9 (patch) | |
tree | f0ce19333938e7ebe8a0fd717086c62257b5ff67 /src | |
parent | 398447c041cffdc712a86f9fe9b58c3f5189c86e (diff) |
Switched the MACCESS code to the stuff from mga_storm.c.
Diffstat (limited to 'src')
-rw-r--r-- | src/mga_exa.c | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/src/mga_exa.c b/src/mga_exa.c index 3e3fbac..d89e42a 100644 --- a/src/mga_exa.c +++ b/src/mga_exa.c @@ -61,12 +61,6 @@ #define BLIT_LEFT 1 #define BLIT_UP 4 -/* stolen from kdrive's mga.h. needs to go into mga_reg.h */ -#define MGA_PW8 0 -#define MGA_PW16 1 -#define MGA_PW24 2 -#define MGA_PW32 3 - static const CARD32 mgaRop[16] = { /* GXclear */ MGADWG_RPL | 0x00000000, /* 0 */ /* GXand */ MGADWG_RSTR | 0x00080000, /* src AND dst */ @@ -153,22 +147,22 @@ mgaSetup(ScreenPtr pScreen, int dest_bpp, int wait) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; MGAPtr pMga = pScrn->driverPrivate; + unsigned int maccess = 0; + static const unsigned int maccess_table[5] = { + 0, /* dummy */ + 0, /* 8 bpp, PW8 */ + 1, /* 16 bpp, PW16 */ + 3, /* 24 bpp, PW24 */ + 2, /* 32 bpp, PW32 */ + }; WAITFIFO(wait + 4); - /* Set the format of the destination pixmap */ - switch (dest_bpp) { - case 8: - OUTREG(MGAREG_MACCESS, MGA_PW8); - break; - case 16: - OUTREG(MGAREG_MACCESS, MGA_PW16); - break; - case 24: - case 32: - OUTREG(MGAREG_MACCESS, MGA_PW24); - break; - } + /* Set the format of the destination pixmap. + * Taken from MGAStormEngineInit(). + */ + maccess |= maccess_table[dest_bpp / 8]; + OUTREG(MGAREG_MACCESS, maccess); OUTREG(MGAREG_CXBNDRY, 0xffff0000); OUTREG(MGAREG_YTOP, 0x00000000); |