summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuc Verhaegen <libv@skynet.be>2005-12-28 16:00:54 +0000
committerLuc Verhaegen <libv@skynet.be>2005-12-28 16:00:54 +0000
commitaa5f3bcad160020f4d586ad06da371b624161057 (patch)
tree80d95a0df6632bf851cd5f550f633674381d82a5
parenta1e18cfd64ec2f70f28fd2635084112a126255c2 (diff)
[devel-Option_CRTGamma] This hopefully gives users like erc a workaround
for weird colours. I'm unable to reproduce this problem though.
-rw-r--r--src/via_driver.c17
-rw-r--r--src/via_driver.h1
2 files changed, 17 insertions, 1 deletions
diff --git a/src/via_driver.c b/src/via_driver.c
index 5319151..cb25718 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -133,6 +133,7 @@ typedef enum {
OPTION_VIDEORAM,
OPTION_FORCEMEMCLOCK,
OPTION_ACTIVEDEVICE,
+ OPTION_CRTGAMMA,
OPTION_DISABLEVQ,
OPTION_DRIXINERAMA,
OPTION_DISABLEIRQ,
@@ -159,6 +160,7 @@ static OptionInfoRec VIAOptions[] =
{OPTION_VIDEORAM, "VideoRAM", OPTV_INTEGER, {0}, FALSE},
{OPTION_FORCEMEMCLOCK, "ForceMemClock", OPTV_INTEGER, {0}, FALSE},
{OPTION_ACTIVEDEVICE, "ActiveDevice", OPTV_ANYSTR, {0}, FALSE},
+ {OPTION_CRTGAMMA, "CRTGamma", OPTV_BOOLEAN, {0}, FALSE},
{OPTION_DISABLEVQ, "DisableVQ", OPTV_BOOLEAN, {0}, FALSE},
{OPTION_DRIXINERAMA, "DRIXINERAMA", OPTV_BOOLEAN, {0}, FALSE},
{OPTION_DISABLEIRQ, "DisableIRQ", OPTV_BOOLEAN, {0}, FALSE},
@@ -1044,6 +1046,14 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
pVia->ActiveDevice |= VIA_DEVICE_TV;
}
+ if (xf86ReturnOptValBool(VIAOptions, OPTION_CRTGAMMA, TRUE))
+ pVia->CRTGamma = TRUE;
+ else {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: Disabling gamma"
+ "correction for the CRT.\n");
+ pVia->CRTGamma = FALSE;
+ }
+
pVia->PciInfo = xf86GetPciInfoForEntity(pEnt->index);
xf86RegisterResources(pEnt->index, NULL, ResNone);
/*
@@ -1812,8 +1822,13 @@ ViaPaletteLoad(ScrnInfoPtr pScrn, int numColors, int *indices,
hwp->writeDacData(hwp, colors[index].blue);
}
+ hwp->disablePalette(hwp);
+
/* enable CLT glammal collection */
- ViaSeqMask(hwp, 0x16, 0x80, 0x80);
+ if (VIAPTR(pScrn)->CRTGamma)
+ ViaSeqMask(hwp, 0x16, 0x80, 0x80);
+ else
+ ViaSeqMask(hwp, 0x16, 0x00, 0x80);
}
/*
diff --git a/src/via_driver.h b/src/via_driver.h
index a811653..af9fd88 100644
--- a/src/via_driver.h
+++ b/src/via_driver.h
@@ -170,6 +170,7 @@ typedef struct _VIA {
Bool NoAccel;
Bool shadowFB;
int rotate;
+ Bool CRTGamma;
CloseScreenProcPtr CloseScreen;
pciVideoPtr PciInfo;