summaryrefslogtreecommitdiff
path: root/src/mga_dacG.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2004-06-16 09:23:24 +0000
committerEric Anholt <anholt@freebsd.org>2004-06-16 09:23:24 +0000
commit7cbb9f870b020742a254f1e9aadd0209b1f0a876 (patch)
tree9073a10b01308b5925b2969f828e755be1fffa22 /src/mga_dacG.c
parent9dd51de1d530c6081333d30f945afb6d9208a77f (diff)
DRI XFree86-4_3_99_12-merge importDRI-XFree86-4_3_99_12-merge
Diffstat (limited to 'src/mga_dacG.c')
-rw-r--r--src/mga_dacG.c38
1 files changed, 13 insertions, 25 deletions
diff --git a/src/mga_dacG.c b/src/mga_dacG.c
index 0a3a7e2..00e6ce0 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.54tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c,v 1.52 2003/04/24 20:05:34 eich Exp $ */
/*
* This is a first cut at a non-accelerated version to work with the
@@ -208,13 +208,16 @@ MGAGSetPCLK( ScrnInfoPtr pScrn, long f_out )
/* Pixel clock values */
int m, n, p, s;
+ /* The actual frequency output by the clock */
+ double f_pll;
+
if(MGAISGx50(pMga)) {
pReg->Clock = f_out;
return;
}
/* Do the calculations for m, n, p and s */
- (void) MGAGCalcClock( pScrn, f_out, &m, &n, &p, &s );
+ f_pll = MGAGCalcClock( pScrn, f_out, &m, &n, &p, &s );
/* Values for the pixel clock PLL registers */
pReg->DacRegs[ MGA1064_PIX_PLLC_M ] = m & 0x1F;
@@ -244,7 +247,7 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
/* 0x48: */ 0, 0, 0, 0, 0, 0, 0, 0
};
- int i;
+ int i, weight555 = FALSE;
int hd, hs, he, ht, vd, vs, ve, vt, wd;
int BppShift;
MGAPtr pMga;
@@ -408,6 +411,7 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
pReg->DacRegs[ MGA1064_MUL_CTL ] = MGA1064_MUL_CTL_16bits;
if ( (pLayout->weight.red == 5) && (pLayout->weight.green == 5)
&& (pLayout->weight.blue == 5) ) {
+ weight555 = TRUE;
pReg->DacRegs[ MGA1064_MUL_CTL ] = MGA1064_MUL_CTL_15bits;
}
break;
@@ -548,14 +552,6 @@ 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);
}
@@ -678,14 +674,6 @@ 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(
/*
@@ -711,6 +699,10 @@ 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,
@@ -951,7 +943,6 @@ MGAGSetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
MGAPtr pMga = MGAPTR(pScrn);
x += 64;
y += 64;
-
#ifdef USEMGAHAL
MGA_HAL(
x += pMga->HALGranularityOffX;
@@ -1046,8 +1037,7 @@ MGAG_ddc1Read(ScrnInfoPtr pScrn)
static void
MGAG_I2CGetBits(I2CBusPtr b, int *clock, int *data)
{
- ScrnInfoPtr pScrn = xf86Screens[b->scrnIndex];
- MGAPtr pMga = MGAPTR(pScrn);
+ MGAPtr pMga = MGAPTR(xf86Screens[b->scrnIndex]);
unsigned char val;
/* Get the result. */
@@ -1068,8 +1058,7 @@ MGAG_I2CGetBits(I2CBusPtr b, int *clock, int *data)
static void
MGAG_I2CPutBits(I2CBusPtr b, int clock, int data)
{
- ScrnInfoPtr pScrn = xf86Screens[b->scrnIndex];
- MGAPtr pMga = MGAPTR(pScrn);
+ MGAPtr pMga = MGAPTR(xf86Screens[b->scrnIndex]);
unsigned char drv, val;
val = (clock ? DDC_SCL_MASK : 0) | (data ? DDC_SDA_MASK : 0);
@@ -1142,7 +1131,6 @@ MGAGRamdacInit(ScrnInfoPtr pScrn)
HARDWARE_CURSOR_TRUECOLOR_AT_8BPP;
MGAdac->LoadPalette = MGAGLoadPalette;
- MGAdac->RestorePalette = MGAGRestorePalette;
if ( pMga->Bios2.PinID && pMga->Bios2.PclkMax != 0xFF )
{