From 646a884c14429913eb74f860b9b614db9f17f13c Mon Sep 17 00:00:00 2001 From: Alexander Gottwald Date: Wed, 17 Mar 2004 20:30:45 +0000 Subject: merge with XORG-RELEASE-1 (tag XORG-CYGWIN-LAST-MERGE) --- src/mga_dacG.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'src/mga_dacG.c') diff --git a/src/mga_dacG.c b/src/mga_dacG.c index 842e75e..0a3a7e2 100644 --- a/src/mga_dacG.c +++ b/src/mga_dacG.c @@ -2,7 +2,7 @@ * MGA-1064, MGA-G100, MGA-G200, MGA-G400, MGA-G550 RAMDAC driver */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c,v 1.54 2003/11/03 05:11:17 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c,v 1.54tsi Exp $ */ /* * This is a first cut at a non-accelerated version to work with the @@ -548,6 +548,14 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode) MGACRTC2GetPitch(pScrn, &ModeInfo); MGACRTC2GetDisplayStart(pScrn, &ModeInfo,0,0,0); } + +#if X_BYTE_ORDER == X_BIG_ENDIAN + /* Disable byte-swapping for big-endian architectures - the XFree + driver seems to like a little-endian framebuffer -ReneR */ + /* pReg->Option |= 0x80000000; */ + pReg->Option &= ~0x80000000; +#endif + return(TRUE); } @@ -670,6 +678,14 @@ MGAGRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg, } if(!pMga->SecondCrtc) { + /* Do not set the memory config for primary cards as it + should be correct already. Only on little endian architectures + since we need to modify the byteswap bit. -ReneR */ +#if X_BYTE_ORDER == X_BIG_ENDIAN + optionMask = OPTION1_MASK; +#else + optionMask = (pMga->Primary) ? OPTION1_MASK_PRIMARY : OPTION1_MASK; +#endif MGA_NOT_HAL( /* @@ -695,10 +711,6 @@ MGA_NOT_HAL( outMGAdac(i, mgaReg->DacRegs[i]); } - /* Do not set the memory config for primary cards as it - should be correct already */ - optionMask = (pMga->Primary) ? OPTION1_MASK_PRIMARY : OPTION1_MASK; - if (!MGAISGx50(pMga)) { /* restore pci_option register */ pciSetBitsLong(pMga->PciTag, PCI_OPTION_REG, optionMask, @@ -939,6 +951,7 @@ MGAGSetCursorPosition(ScrnInfoPtr pScrn, int x, int y) MGAPtr pMga = MGAPTR(pScrn); x += 64; y += 64; + #ifdef USEMGAHAL MGA_HAL( x += pMga->HALGranularityOffX; @@ -1033,7 +1046,8 @@ MGAG_ddc1Read(ScrnInfoPtr pScrn) static void MGAG_I2CGetBits(I2CBusPtr b, int *clock, int *data) { - MGAPtr pMga = MGAPTR(xf86Screens[b->scrnIndex]); + ScrnInfoPtr pScrn = xf86Screens[b->scrnIndex]; + MGAPtr pMga = MGAPTR(pScrn); unsigned char val; /* Get the result. */ @@ -1054,7 +1068,8 @@ MGAG_I2CGetBits(I2CBusPtr b, int *clock, int *data) static void MGAG_I2CPutBits(I2CBusPtr b, int clock, int data) { - MGAPtr pMga = MGAPTR(xf86Screens[b->scrnIndex]); + ScrnInfoPtr pScrn = xf86Screens[b->scrnIndex]; + MGAPtr pMga = MGAPTR(pScrn); unsigned char drv, val; val = (clock ? DDC_SCL_MASK : 0) | (data ? DDC_SDA_MASK : 0); -- cgit v1.2.3