configure.ac | 2 src/via_analog.c | 52 +++---- src/via_ch7xxx.c | 204 +++++++++++++-------------- src/via_display.c | 24 +-- src/via_driver.c | 64 ++++---- src/via_driver.h | 4 src/via_fp.c | 50 +++--- src/via_i2c.c | 70 ++++++--- src/via_outputs.c | 4 src/via_tmds.c | 12 - src/via_tv.c | 142 +++++++++---------- src/via_ums.c | 12 - src/via_ums.h | 12 - src/via_vt162x.c | 372 +++++++++++++++++++++++++-------------------------- src/via_xv_overlay.c | 14 - 15 files changed, 528 insertions(+), 510 deletions(-)
New commits: commit dc43d44f0cb9d8160897f02c9376a58d7f5c8493 Author: Kevin Brace <kevinbr...@gmx.com> Date: Fri May 19 04:04:34 2017 -0700 Version bumped to 0.6.115 Performed many code cleaning activities along with I2C bus initialization improvement. Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/configure.ac b/configure.ac index db97bf1..c3a93d7 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ # Initialize Autoconf AC_PREREQ(2.57) AC_INIT([xf86-video-openchrome], - [0.6.114], + [0.6.115], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome], [xf86-video-openchrome]) commit 544ca89c4d2f251ace2310af1299983ee327b2e5 Author: Kevin Brace <kevinbr...@gmx.com> Date: Fri May 19 04:01:19 2017 -0700 Improvements in how I2C bus 1 through 3 are initialized Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/src/via_i2c.c b/src/via_i2c.c index c985dc2..7425a90 100644 --- a/src/via_i2c.c +++ b/src/via_i2c.c @@ -61,7 +61,10 @@ static void ViaI2C1GetBits(I2CBusPtr Bus, int *clock, int *data) { vgaHWPtr hwp = Bus->DriverPrivate.ptr; - CARD8 value = hwp->readSeq(hwp, 0x26); + CARD8 value; + + ViaSeqMask(hwp, 0x26, 0x01, 0x01); + value = hwp->readSeq(hwp, 0x26); *clock = (value & SCL_READ) != 0; *data = (value & SDA_READ) != 0; @@ -88,13 +91,19 @@ ViaI2CBus1Init(ScrnInfoPtr pScrn) pI2CBus->BusName = "I2C Bus 1"; pI2CBus->scrnIndex = pScrn->scrnIndex; + pI2CBus->I2CPutBits = ViaI2C1PutBits; pI2CBus->I2CGetBits = ViaI2C1GetBits; + pI2CBus->DriverPrivate.ptr = hwp; - pI2CBus->ByteTimeout = 2200; - pI2CBus->StartTimeout = 550; + pI2CBus->HoldTime = 40; + pI2CBus->BitTimeout = 40; + pI2CBus->ByteTimeout = 2200; + pI2CBus->AcknTimeout = 40; + pI2CBus->StartTimeout = 550; + pI2CBus->RiseFallTime = 20; if (!xf86I2CBusInit(pI2CBus)) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -135,7 +144,10 @@ static void ViaI2C2GetBits(I2CBusPtr Bus, int *clock, int *data) { vgaHWPtr hwp = Bus->DriverPrivate.ptr; - CARD8 value = hwp->readSeq(hwp, 0x31); + CARD8 value; + + ViaSeqMask(hwp, 0x31, 0x01, 0x01); + value = hwp->readSeq(hwp, 0x31); *clock = (value & SCL_READ) != 0; *data = (value & SDA_READ) != 0; @@ -162,10 +174,20 @@ ViaI2CBus2Init(ScrnInfoPtr pScrn) pI2CBus->BusName = "I2C Bus 2"; pI2CBus->scrnIndex = pScrn->scrnIndex; + pI2CBus->I2CPutBits = ViaI2C2PutBits; pI2CBus->I2CGetBits = ViaI2C2GetBits; + pI2CBus->DriverPrivate.ptr = hwp; + pI2CBus->HoldTime = 40; + + pI2CBus->BitTimeout = 40; + pI2CBus->ByteTimeout = 2200; + pI2CBus->AcknTimeout = 40; + pI2CBus->StartTimeout = 550; + pI2CBus->RiseFallTime = 20; + if (!xf86I2CBusInit(pI2CBus)) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "xf86I2CBusInit failed.\n")); @@ -388,31 +410,27 @@ ViaI2CBus3Init(ScrnInfoPtr pScrn) pI2CBus->BusName = "I2C Bus 3"; pI2CBus->scrnIndex = pScrn->scrnIndex; - pI2CBus->DriverPrivate.ptr = hwp; - switch (pVia->Chipset) { - case VIA_P4M800PRO: - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "using alternative PutBits/GetBits functions for I2C Bus 3\n")); - pI2CBus->I2CPutBits = ViaI2C3SimplePutBits; - pI2CBus->I2CGetBits = ViaI2C3SimpleGetBits; - break; - default: - pI2CBus->I2CAddress = ViaI2C3Address; + pI2CBus->I2CPutBits = ViaI2C3SimplePutBits; + pI2CBus->I2CGetBits = ViaI2C3SimpleGetBits; + #ifdef X_NEED_I2CSTART - pI2CBus->I2CStart = ViaI2C3Start; + pI2CBus->I2CStart = ViaI2C3Start; #endif - pI2CBus->I2CStop = ViaI2C3Stop; - pI2CBus->I2CPutByte = ViaI2C3PutByte; - pI2CBus->I2CGetByte = ViaI2C3GetByte; - pI2CBus->DriverPrivate.ptr = hwp; - - pI2CBus->BitTimeout = 10; - pI2CBus->ByteTimeout = 10; - pI2CBus->HoldTime = 10; - pI2CBus->StartTimeout = 10; - break; - } + pI2CBus->I2CAddress = ViaI2C3Address; + pI2CBus->I2CStop = ViaI2C3Stop; + pI2CBus->I2CPutByte = ViaI2C3PutByte; + pI2CBus->I2CGetByte = ViaI2C3GetByte; + + pI2CBus->DriverPrivate.ptr = hwp; + + pI2CBus->HoldTime = 40; + + pI2CBus->BitTimeout = 40; + pI2CBus->ByteTimeout = 2200; + pI2CBus->AcknTimeout = 40; + pI2CBus->StartTimeout = 550; + pI2CBus->RiseFallTime = 20; if (!xf86I2CBusInit(pI2CBus)) { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_ERROR, commit 8a4cd7a38eaff6aa14012602a89ca4cff864f3c7 Author: Kevin Brace <kevinbr...@gmx.com> Date: Fri May 19 03:55:26 2017 -0700 Changed integrated TMDS (DVI) record related names Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/src/via_tmds.c b/src/via_tmds.c index 709e1f7..1a87ee0 100644 --- a/src/via_tmds.c +++ b/src/via_tmds.c @@ -1020,7 +1020,7 @@ viaTMDSInit(ScrnInfoPtr pScrn) xf86OutputPtr output; vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); - VIATMDSRecPtr pVIATMDSRec = NULL; + VIATMDSPtr pVIATMDS = NULL; CARD8 sr13, sr5a; Bool status = FALSE; char outputNameBuffer[32]; @@ -1057,8 +1057,8 @@ viaTMDSInit(ScrnInfoPtr pScrn) goto exit; } - pVIATMDSRec = xnfcalloc(1, sizeof(VIATMDSRec)); - if (!pVIATMDSRec) { + pVIATMDS = xnfcalloc(1, sizeof(VIATMDSRec)); + if (!pVIATMDS) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to allocate working storage for integrated " "TMDS transmitter.\n"); @@ -1068,21 +1068,21 @@ viaTMDSInit(ScrnInfoPtr pScrn) /* Leaving a hint for mode setting and DPMS to know which port * to access. For CX700 / VX700 and VX800 integrated TMDS * transmitter, it is fixed to LVDS1 (TMDS uses LVDS1 wires). */ - pVIATMDSRec->diPortType = VIA_DI_PORT_TMDS; + pVIATMDS->diPortType = VIA_DI_PORT_TMDS; /* The code to dynamically designate the particular DVI (i.e., DVI-1, * DVI-2, etc.) for xrandr was borrowed from xf86-video-r128 DDX. */ sprintf(outputNameBuffer, "DVI-%d", (pVia->numberDVI + 1)); output = xf86OutputCreate(pScrn, &via_tmds_funcs, outputNameBuffer); if (!output) { - free(pVIATMDSRec); + free(pVIATMDS); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to allocate X Server display output record for " "integrated TMDS transmitter.\n"); goto exit; } - output->driver_private = pVIATMDSRec; + output->driver_private = pVIATMDS; /* Since there are two (2) display controllers registered with the * X.Org Server and both IGA1 and IGA2 can handle DVI without any diff --git a/src/via_ums.h b/src/via_ums.h index 7be59fa..e955599 100644 --- a/src/via_ums.h +++ b/src/via_ums.h @@ -209,10 +209,10 @@ typedef struct _VIAFP { I2CBusPtr pVIAFPI2CBus; } VIAFPRec, *VIAFPPtr; -typedef struct _VIATMDSRec { +typedef struct _VIATMDS { I2CBusPtr pVIATMDSI2CBus; CARD8 diPortType; -} VIATMDSRec, *VIATMDSRecPtr; +} VIATMDSRec, *VIATMDSPtr; typedef struct { commit af94e0b2fcf50c1d623057e861b9e91bf91ae905 Author: Kevin Brace <kevinbr...@gmx.com> Date: Fri May 19 02:54:29 2017 -0700 Changed FP record related names Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/src/via_fp.c b/src/via_fp.c index e3252f7..31e1528 100644 --- a/src/via_fp.c +++ b/src/via_fp.c @@ -1053,7 +1053,7 @@ viaLVDSGetFPInfoFromScratchPad(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; vgaHWPtr hwp = VGAHWPTR(pScrn); - viaFPRecPtr panel = output->driver_private; + VIAFPPtr pVIAFP = output->driver_private; CARD8 index; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, @@ -1061,25 +1061,25 @@ viaLVDSGetFPInfoFromScratchPad(xf86OutputPtr output) index = hwp->readCrtc(hwp, 0x3F) & 0x0F; - panel->NativeModeIndex = index; - panel->NativeWidth = ViaPanelNativeModes[index].Width; - panel->NativeHeight = ViaPanelNativeModes[index].Height; - panel->useDualEdge = ViaPanelNativeModes[index].useDualEdge; - panel->useDithering = ViaPanelNativeModes[index].useDithering; + pVIAFP->NativeModeIndex = index; + pVIAFP->NativeWidth = ViaPanelNativeModes[index].Width; + pVIAFP->NativeHeight = ViaPanelNativeModes[index].Height; + pVIAFP->useDualEdge = ViaPanelNativeModes[index].useDualEdge; + pVIAFP->useDithering = ViaPanelNativeModes[index].useDithering; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIA Technologies VGA BIOS Scratch Pad Register " "Flat Panel Index: %d\n", - panel->NativeModeIndex); + pVIAFP->NativeModeIndex); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Flat Panel Native Resolution: %dx%d\n", - panel->NativeWidth, panel->NativeHeight); + pVIAFP->NativeWidth, pVIAFP->NativeHeight); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Flat Panel Dual Edge Transfer: %s\n", - panel->useDualEdge ? "On" : "Off"); + pVIAFP->useDualEdge ? "On" : "Off"); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Flat Panel Output Color Dithering: %s\n", - panel->useDithering ? "On (18 bit)" : "Off (24 bit)"); + pVIAFP->useDithering ? "On (18 bit)" : "Off (24 bit)"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaLVDSGetFPInfoFromScratchPad.\n")); @@ -1309,7 +1309,7 @@ static int via_lvds_mode_valid(xf86OutputPtr output, DisplayModePtr pMode) { ScrnInfoPtr pScrn = output->scrn; - viaFPRecPtr Panel = output->driver_private; + VIAFPPtr Panel = output->driver_private; if (Panel->NativeWidth < pMode->HDisplay || Panel->NativeHeight < pMode->VDisplay) @@ -1329,7 +1329,7 @@ static Bool via_lvds_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjusted_mode) { - viaFPRecPtr Panel = output->driver_private; + VIAFPPtr Panel = output->driver_private; xf86SetModeCrtc(adjusted_mode, 0); if (!Panel->Center && (mode->HDisplay < Panel->NativeWidth || @@ -1364,7 +1364,7 @@ static void via_lvds_mode_set(xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjusted_mode) { - viaFPRecPtr Panel = output->driver_private; + VIAFPPtr Panel = output->driver_private; ScrnInfoPtr pScrn = output->scrn; drmmode_crtc_private_ptr iga = output->crtc->driver_private; VIAPtr pVia = VIAPTR(pScrn); @@ -1426,7 +1426,7 @@ via_lvds_detect(xf86OutputPtr output) xf86OutputStatus status = XF86OutputStatusDisconnected; ScrnInfoPtr pScrn = output->scrn; VIAPtr pVia = VIAPTR(pScrn); - viaFPRecPtr panel = output->driver_private; + VIAFPPtr pVIAFP = output->driver_private; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_lvds_detect.\n")); @@ -1435,8 +1435,8 @@ via_lvds_detect(xf86OutputPtr output) if (pVia->IsOLPCXO15) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Setting up OLPC XO-1.5 flat panel.\n"); - panel->NativeWidth = 1200; - panel->NativeHeight = 900; + pVIAFP->NativeWidth = 1200; + pVIAFP->NativeHeight = 900; status = XF86OutputStatusConnected; goto exit; } @@ -1458,7 +1458,7 @@ exit: static DisplayModePtr via_lvds_get_modes(xf86OutputPtr output) { - viaFPRecPtr pPanel = output->driver_private; + VIAFPPtr pPanel = output->driver_private; ScrnInfoPtr pScrn = output->scrn; DisplayModePtr pDisplay_Mode = NULL; @@ -1564,7 +1564,7 @@ static const xf86OutputFuncsRec via_lvds_funcs = { void via_lvds_init(ScrnInfoPtr pScrn) { - viaFPRecPtr Panel = (viaFPRecPtr) xnfcalloc(sizeof(viaFPRec), 1); + VIAFPPtr pVIAFP = (VIAFPPtr) xnfcalloc(sizeof(VIAFPRec), 1); OptionInfoPtr Options = xnfalloc(sizeof(ViaPanelOptions)); MessageType from = X_DEFAULT; VIAPtr pVia = VIAPTR(pScrn); @@ -1574,7 +1574,7 @@ via_lvds_init(ScrnInfoPtr pScrn) CARD8 cr3b_mask = 0x00; char outputNameBuffer[32]; - if (!Panel) + if (!pVIAFP) return; /* Apparently this is the way VIA Technologies passes */ @@ -1595,14 +1595,14 @@ via_lvds_init(ScrnInfoPtr pScrn) memcpy(Options, ViaPanelOptions, sizeof(ViaPanelOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, Options); - Panel->NativeModeIndex = VIA_PANEL_INVALID; + pVIAFP->NativeModeIndex = VIA_PANEL_INVALID; /* LCD Center/Expend Option */ - Panel->Center = FALSE; - from = xf86GetOptValBool(Options, OPTION_CENTER, &Panel->Center) + pVIAFP->Center = FALSE; + from = xf86GetOptValBool(Options, OPTION_CENTER, &pVIAFP->Center) ? X_CONFIG : X_DEFAULT; xf86DrvMsg(pScrn->scrnIndex, from, "LVDS-0 : DVI Center is %s.\n", - Panel->Center ? "enabled" : "disabled"); + pVIAFP->Center ? "enabled" : "disabled"); /* The code to dynamically designate a particular FP (i.e., FP-1, * FP-2, etc.) for xrandr was borrowed from xf86-video-r128 DDX. */ @@ -1610,7 +1610,7 @@ via_lvds_init(ScrnInfoPtr pScrn) output = xf86OutputCreate(pScrn, &via_lvds_funcs, outputNameBuffer); if (output) { - output->driver_private = Panel; + output->driver_private = pVIAFP; /* While there are two (2) display controllers registered with the * X.Org Server, it is often desirable to fix FP (Flat Panel) to @@ -1630,6 +1630,6 @@ via_lvds_init(ScrnInfoPtr pScrn) output->mm_width = 114; } } else { - free(Panel); + free(pVIAFP); } } diff --git a/src/via_ums.h b/src/via_ums.h index ba93992..7be59fa 100644 --- a/src/via_ums.h +++ b/src/via_ums.h @@ -181,7 +181,7 @@ typedef struct _VIADISPLAY { /* * Record for storing FP (Flat Panel) specific information. */ -typedef struct _viaFPRec { +typedef struct _VIAFP { Bool IsActive ; /* Native physical resolution */ int NativeHeight; @@ -207,7 +207,7 @@ typedef struct _viaFPRec { int resY; I2CBusPtr pVIAFPI2CBus; -} viaFPRec, *viaFPRecPtr; +} VIAFPRec, *VIAFPPtr; typedef struct _VIATMDSRec { I2CBusPtr pVIATMDSI2CBus; commit e14f7dd957cb67b882cbc7d5a1b61091d7e4d250 Author: Kevin Brace <kevinbr...@gmx.com> Date: Thu May 18 20:06:54 2017 -0700 Changed VIABIOSInfo record to VIADisplay Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/src/via_analog.c b/src/via_analog.c index 49c098c..6c6fda6 100644 --- a/src/via_analog.c +++ b/src/via_analog.c @@ -375,7 +375,7 @@ void via_analog_init(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); - VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; + VIADisplayPtr pVIADisplay = pVia->pVIADisplay; xf86OutputPtr output = NULL; char outputNameBuffer[32]; @@ -408,7 +408,7 @@ via_analog_init(ScrnInfoPtr pScrn) output->possible_clones = 0; output->interlaceAllowed = TRUE; output->doubleScanAllowed = FALSE; - pBIOSInfo->analog = output; + pVIADisplay->analog = output; /* Increment the number of analog VGA connectors. */ pVia->numberVGA++; diff --git a/src/via_ch7xxx.c b/src/via_ch7xxx.c index 48689a6..20c15b9 100644 --- a/src/via_ch7xxx.c +++ b/src/via_ch7xxx.c @@ -40,14 +40,14 @@ static void CH7xxxPrintRegs(ScrnInfoPtr pScrn) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; CARD8 i, buf; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Printing registers for %s\n", - pBIOSInfo->TVI2CDev->DevName); + pVIADisplay->TVI2CDev->DevName); - for (i = 0; i < pBIOSInfo->TVNumRegs; i++) { - xf86I2CReadByte(pBIOSInfo->TVI2CDev, i, &buf); + for (i = 0; i < pVIADisplay->TVNumRegs; i++) { + xf86I2CReadByte(pVIADisplay->TVI2CDev, i, &buf); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV%02X: 0x%02X\n", i, buf); } @@ -61,7 +61,7 @@ CH7xxxPrintRegs(ScrnInfoPtr pScrn) I2CDevPtr ViaCH7xxxDetect(ScrnInfoPtr pScrn, I2CBusPtr pBus, CARD8 Address) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; I2CDevPtr pDev = xf86CreateI2CDevRec(); CARD8 buf; @@ -86,40 +86,40 @@ ViaCH7xxxDetect(ScrnInfoPtr pScrn, I2CBusPtr pBus, CARD8 Address) switch (buf) { case 0x17: xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected Chrontel CH7011 TV Encoder\n"); - pBIOSInfo->TVEncoder = VIA_CH7011; + pVIADisplay->TVEncoder = VIA_CH7011; pDev->DevName="CH7011"; break; case 0x19: xf86I2CReadByte(pDev, 0x4A, &buf); if (buf == 0x81) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected Chrontel CH7019A LVDS Transmitter/TV Encoder\n"); - pBIOSInfo->TVEncoder = VIA_CH7019A; + pVIADisplay->TVEncoder = VIA_CH7019A; pDev->DevName="CH7019A"; } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected Chrontel CH7019B LVDS Transmitter/TV Encoder\n"); - pBIOSInfo->TVEncoder = VIA_CH7019B; + pVIADisplay->TVEncoder = VIA_CH7019B; pDev->DevName="CH7019B"; } break; case 0x1B: xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected Chrontel CH7017 LVDS Transmitter\n"); - pBIOSInfo->TVEncoder = VIA_CH7017; + pVIADisplay->TVEncoder = VIA_CH7017; pDev->DevName="CH7017"; break; case 0x3A: /* single init table --> single channel LVDS transmitter ? */ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected Chrontel CH7304 LVDS Transmitter\n"); - pBIOSInfo->TVEncoder = VIA_CH7304; + pVIADisplay->TVEncoder = VIA_CH7304; pDev->DevName="CH7304"; break; case 0x3B: /* dual init table --> dual channel LVDS transmitter ? */ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected Chrontel CH7305 LVDS Transmitter\n"); - pBIOSInfo->TVEncoder = VIA_CH7305; + pVIADisplay->TVEncoder = VIA_CH7305; pDev->DevName="CH7305"; break; default: - pBIOSInfo->TVEncoder = VIA_NONETV; + pVIADisplay->TVEncoder = VIA_NONETV; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Unknown CH7xxx" " device found. [%x:0x1B contains %x]\n", Address, buf); @@ -140,12 +140,12 @@ static void CH7xxxSave(ScrnInfoPtr pScrn) { int i; - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7xxxSave\n")); - for (i = 0; i < pBIOSInfo->TVNumRegs; i++) - xf86I2CReadByte(pBIOSInfo->TVI2CDev, i, &(pBIOSInfo->TVRegs[i])); + for (i = 0; i < pVIADisplay->TVNumRegs; i++) + xf86I2CReadByte(pVIADisplay->TVI2CDev, i, &(pVIADisplay->TVRegs[i])); } @@ -153,12 +153,12 @@ static void CH7xxxRestore(ScrnInfoPtr pScrn) { int i; - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7xxxRestore\n")); - for (i = 0; i < pBIOSInfo->TVNumRegs; i++) - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, i, pBIOSInfo->TVRegs[i]); + for (i = 0; i < pVIADisplay->TVNumRegs; i++) + xf86I2CWriteByte(pVIADisplay->TVI2CDev, i, pVIADisplay->TVRegs[i]); } static CARD8 @@ -201,17 +201,17 @@ CH7xxxDACSenseI2C(I2CDevPtr pDev) static Bool CH7xxxDACSense(ScrnInfoPtr pScrn) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; CARD8 sense; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7xxxDACDetect\n")); /* is this needed? IH */ - if (!pBIOSInfo->TVI2CDev || - !pBIOSInfo->TVEncoder) + if (!pVIADisplay->TVI2CDev || + !pVIADisplay->TVEncoder) return FALSE; - sense = CH7xxxDACSenseI2C(pBIOSInfo->TVI2CDev); + sense = CH7xxxDACSenseI2C(pVIADisplay->TVI2CDev); /* I'm sure these case values are correct, * but we should get something in any case. @@ -220,27 +220,27 @@ CH7xxxDACSense(ScrnInfoPtr pScrn) */ switch (sense) { case 0x10: - pBIOSInfo->TVOutput = TVOUTPUT_COMPOSITE; + pVIADisplay->TVOutput = TVOUTPUT_COMPOSITE; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CH7xxx: Composite connected.\n"); return TRUE; case 0x0C: - pBIOSInfo->TVOutput = TVOUTPUT_SVIDEO; + pVIADisplay->TVOutput = TVOUTPUT_SVIDEO; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CH7xxx: S-Video connected.\n"); return TRUE; case 0x02: - pBIOSInfo->TVOutput = TVOUTPUT_SC; + pVIADisplay->TVOutput = TVOUTPUT_SC; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CHxxx: Composite+S-Video connected.\n"); return TRUE; case 0x04: - pBIOSInfo->TVOutput = TVOUTPUT_YCBCR; + pVIADisplay->TVOutput = TVOUTPUT_YCBCR; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CHxxx: YcBcR Connected.\n"); return TRUE; case 0x00: - pBIOSInfo->TVOutput = TVOUTPUT_NONE; + pVIADisplay->TVOutput = TVOUTPUT_NONE; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CH7xxx: Nothing connected.\n"); return FALSE; default: - pBIOSInfo->TVOutput = TVOUTPUT_NONE; + pVIADisplay->TVOutput = TVOUTPUT_NONE; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "CH7xxx: Unknown cable combination: 0x0%2X.\n",sense); return FALSE; } @@ -249,14 +249,14 @@ CH7xxxDACSense(ScrnInfoPtr pScrn) static CARD8 CH7011ModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; int i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7011ModeIndex\n")); for (i = 0; CH7011Table[i].Width; i++) { if ((CH7011Table[i].Width == mode->CrtcHDisplay) && (CH7011Table[i].Height == mode->CrtcVDisplay) && - (CH7011Table[i].Standard == pBIOSInfo->TVType) && + (CH7011Table[i].Standard == pVIADisplay->TVType) && !(strcmp(CH7011Table[i].name, mode->name))) return i; } @@ -268,14 +268,14 @@ CH7011ModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode) static CARD8 CH7019ModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; int i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7019ModeIndex\n")); for (i = 0; CH7019Table[i].Width; i++) { if ((CH7019Table[i].Width == mode->CrtcHDisplay) && (CH7019Table[i].Height == mode->CrtcVDisplay) && - (CH7019Table[i].Standard == pBIOSInfo->TVType) && + (CH7019Table[i].Standard == pVIADisplay->TVType) && !(strcmp(CH7019Table[i].name, mode->name))) return i; } @@ -290,7 +290,7 @@ CH7019ModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode) static ModeStatus CH7xxxModeValid(ScrnInfoPtr pScrn, DisplayModePtr mode) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7xxxModeValid\n")); @@ -301,17 +301,17 @@ CH7xxxModeValid(ScrnInfoPtr pScrn, DisplayModePtr mode) return MODE_BAD; } - if ((pBIOSInfo->TVType == TVTYPE_NTSC) && + if ((pVIADisplay->TVType == TVTYPE_NTSC) && (mode->Private != (void *) &CH7xxxModePrivateNTSC)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is NTSC. This is a PAL mode.\n"); return MODE_BAD; - } else if ((pBIOSInfo->TVType == TVTYPE_PAL) && + } else if ((pVIADisplay->TVType == TVTYPE_PAL) && (mode->Private != (void *) &CH7xxxModePrivatePAL)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is PAL. This is a NTSC mode.\n"); return MODE_BAD; } - if (pBIOSInfo->TVEncoder == VIA_CH7011) + if (pVIADisplay->TVEncoder == VIA_CH7011) { if (CH7011ModeIndex(pScrn, mode) != 0xFF) return MODE_OK; @@ -328,14 +328,14 @@ static void CH7xxxModeI2C(ScrnInfoPtr pScrn, DisplayModePtr mode) { VIAPtr pVia = VIAPTR(pScrn); - VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; + VIADisplayPtr pVIADisplay = pVia->pVIADisplay; CARD8 i, j; VIABIOSTVMASKTableRec Mask; struct CH7xxxTableRec Table; - if (pBIOSInfo->TVEncoder == VIA_CH7011) + if (pVIADisplay->TVEncoder == VIA_CH7011) { Table = CH7011Table[CH7011ModeIndex(pScrn, mode)]; Mask = ch7011MaskTable; @@ -348,19 +348,19 @@ CH7xxxModeI2C(ScrnInfoPtr pScrn, DisplayModePtr mode) DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7011ModeI2C\n")); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x49, 0x3E); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x1E, 0xD0); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x49, 0x3E); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x1E, 0xD0); for (i = 0,j = 0; (j < Mask.numTV) && (i < VIA_BIOS_TABLE_NUM_TV_REG); i++) { if (Mask.TV[i] == 0xFF) { - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, i, Table.TV[i]); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, i, Table.TV[i]); j++; } else { - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, i, pBIOSInfo->TVRegs[i]); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, i, pVIADisplay->TVRegs[i]); } } - if ((pBIOSInfo->TVType == TVTYPE_NTSC) && pBIOSInfo->TVDotCrawl) { + if ((pVIADisplay->TVType == TVTYPE_NTSC) && pVIADisplay->TVDotCrawl) { CARD16 *DotCrawl = Table.DotCrawlNTSC; CARD8 address, save; @@ -368,25 +368,25 @@ CH7xxxModeI2C(ScrnInfoPtr pScrn, DisplayModePtr mode) address = (CARD8)(DotCrawl[i] & 0xFF); save = (CARD8)(DotCrawl[i] >> 8); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, address, save); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, address, save); } } /* * Only Composite and SVideo have been tested. */ - switch(pBIOSInfo->TVOutput){ + switch(pVIADisplay->TVOutput){ case TVOUTPUT_COMPOSITE: - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x49, 0x2E); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x49, 0x2E); break; case TVOUTPUT_SVIDEO: - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x49, 0x32); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x49, 0x32); break; case TVOUTPUT_SC: - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x49, 0x3C); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x49, 0x3C); break; case TVOUTPUT_YCBCR: - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x49, 0x3A); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x49, 0x3A); break; default: break; @@ -395,7 +395,7 @@ CH7xxxModeI2C(ScrnInfoPtr pScrn, DisplayModePtr mode) if (pVia->IsSecondary) { /* Patch as setting 2nd path */ j = (CARD8)(Mask.misc2 >> 5); for (i = 0; i < j; i++) - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, Table.Patch2[i] & 0xFF, Table.Patch2[i] >> 8); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, Table.Patch2[i] & 0xFF, Table.Patch2[i] >> 8); } } @@ -405,14 +405,14 @@ CH7xxxModeCrtc(xf86CrtcPtr crtc, DisplayModePtr mode) ScrnInfoPtr pScrn = crtc->scrn; vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); - VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; + VIADisplayPtr pVIADisplay = pVia->pVIADisplay; CARD8 *CRTC, *Misc; int i, j; VIABIOSTVMASKTableRec Mask; struct CH7xxxTableRec Table; - if (pBIOSInfo->TVEncoder == VIA_CH7011) + if (pVIADisplay->TVEncoder == VIA_CH7011) { Table = CH7011Table[CH7011ModeIndex(pScrn, mode)]; Mask = ch7011MaskTable; @@ -449,7 +449,7 @@ CH7xxxModeCrtc(xf86CrtcPtr crtc, DisplayModePtr mode) } if (Mask.misc2 & 0x18) { - pBIOSInfo->Clock = (Misc[3] << 8) & Misc[4]; + pVIADisplay->Clock = (Misc[3] << 8) & Misc[4]; /* VIASetUseExternalClock(hwp); */ } @@ -488,9 +488,9 @@ CH7xxxModeCrtc(xf86CrtcPtr crtc, DisplayModePtr mode) /* CLE266Ax use 2x XCLK */ if ((pVia->Chipset == VIA_CLE266) && CLE266_REV_IS_AX(pVia->ChipRev)) - pBIOSInfo->Clock = 0x471C; + pVIADisplay->Clock = 0x471C; else - pBIOSInfo->Clock = (Misc[4] << 8) | Misc[5]; + pVIADisplay->Clock = (Misc[4] << 8) | Misc[5]; } ViaCrtcMask(hwp, 0x6A, 0x40, 0x40); @@ -508,22 +508,22 @@ CH7xxxModeCrtc(xf86CrtcPtr crtc, DisplayModePtr mode) static void CH7xxxTVPower(ScrnInfoPtr pScrn, Bool On) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; if (On){ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7xxxTVPower: On\n")); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x49, 0x20); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x49, 0x20); }else{ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7xxxTVPower: Off\n")); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x49, 0x3E); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x1E, 0xD0); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x49, 0x3E); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x1E, 0xD0); } } static void CH7019LCDPower(ScrnInfoPtr pScrn, Bool On) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; CARD8 W_Buffer[2], R_Buffer[1]; int i; @@ -531,45 +531,45 @@ CH7019LCDPower(ScrnInfoPtr pScrn, Bool On) DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7xxxLCDPower: On\n")); W_Buffer[0] = 0x63; W_Buffer[1] = 0x4B; - xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,2, NULL,0); + xf86I2CWriteRead(pVIADisplay->TVI2CDev, W_Buffer,2, NULL,0); W_Buffer[0] = 0x66; W_Buffer[1] = 0x20; - xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,2, NULL,0); + xf86I2CWriteRead(pVIADisplay->TVI2CDev, W_Buffer,2, NULL,0); for (i = 0; i < 10; i++) { W_Buffer[0] = 0x63; - xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,1, R_Buffer,1); + xf86I2CWriteRead(pVIADisplay->TVI2CDev, W_Buffer,1, R_Buffer,1); usleep(100); W_Buffer[0] = 0x63; W_Buffer[1] = (R_Buffer[0] | 0x40); - xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,2, NULL,0); + xf86I2CWriteRead(pVIADisplay->TVI2CDev, W_Buffer,2, NULL,0); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CH7xxxLCDPower: [%d]write 0x63 = %X!\n", i+1, W_Buffer[1])); usleep(1); W_Buffer[0] = 0x63; W_Buffer[1] &= ~0x40; - xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,2, NULL,0); + xf86I2CWriteRead(pVIADisplay->TVI2CDev, W_Buffer,2, NULL,0); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CH7xxxLCDPower: [%d]write 0x63 = %X!\n", i+1, W_Buffer[1])); usleep(100); W_Buffer[0] = 0x66; - xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,1, R_Buffer,1); + xf86I2CWriteRead(pVIADisplay->TVI2CDev, W_Buffer,1, R_Buffer,1); if (((R_Buffer[0] & 0x44) == 0x44) || (i >= 9)) { /* PLL lock OK, Turn on VDD */ usleep(500); W_Buffer[1] = R_Buffer[0] | 0x01; - xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,2, NULL,0); + xf86I2CWriteRead(pVIADisplay->TVI2CDev, W_Buffer,2, NULL,0); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "CH7xxxLCDPower: CH7019 PLL lock ok!\n")); /* reset data path */ W_Buffer[0] = 0x48; - xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,1, R_Buffer,1); + xf86I2CWriteRead(pVIADisplay->TVI2CDev, W_Buffer,1, R_Buffer,1); W_Buffer[1] = R_Buffer[0] & ~0x08; - xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,2, NULL,0); + xf86I2CWriteRead(pVIADisplay->TVI2CDev, W_Buffer,2, NULL,0); usleep(1); W_Buffer[1] = R_Buffer[0]; - xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,2, NULL,0); + xf86I2CWriteRead(pVIADisplay->TVI2CDev, W_Buffer,2, NULL,0); break; } @@ -582,15 +582,15 @@ CH7019LCDPower(ScrnInfoPtr pScrn, Bool On) DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7xxxLCDPower: Off\n")); /* Turn off VDD (Turn off backlignt only) */ W_Buffer[0] = 0x66; - xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,1, R_Buffer,1); + xf86I2CWriteRead(pVIADisplay->TVI2CDev, W_Buffer,1, R_Buffer,1); W_Buffer[1] &= ~0x01; - xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,2, NULL,0); + xf86I2CWriteRead(pVIADisplay->TVI2CDev, W_Buffer,2, NULL,0); usleep(100); /* Turn off LVDS path */ W_Buffer[0] = 0x63; - xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,1, R_Buffer,1); + xf86I2CWriteRead(pVIADisplay->TVI2CDev, W_Buffer,1, R_Buffer,1); W_Buffer[1] = (R_Buffer[0] | 0x40); - xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,2, NULL,0); + xf86I2CWriteRead(pVIADisplay->TVI2CDev, W_Buffer,2, NULL,0); } } @@ -600,42 +600,42 @@ CH7019LCDPower(ScrnInfoPtr pScrn, Bool On) void ViaCH7xxxInit(ScrnInfoPtr pScrn) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaCH7xxxInit\n")); - switch (pBIOSInfo->TVEncoder) { + switch (pVIADisplay->TVEncoder) { case VIA_CH7011: - pBIOSInfo->TVSave = CH7xxxSave; - pBIOSInfo->TVRestore = CH7xxxRestore; - pBIOSInfo->TVDACSense = CH7xxxDACSense; - pBIOSInfo->TVModeValid = CH7xxxModeValid; - pBIOSInfo->TVModeI2C = CH7xxxModeI2C; - pBIOSInfo->TVModeCrtc = CH7xxxModeCrtc; - pBIOSInfo->TVPower = CH7xxxTVPower; - pBIOSInfo->TVModes = CH7011Modes; - pBIOSInfo->TVNumModes = sizeof(CH7011Modes) / sizeof(DisplayModeRec); - pBIOSInfo->LCDPower = NULL; - pBIOSInfo->TVNumRegs = CH_7011_MAX_NUM_REG; + pVIADisplay->TVSave = CH7xxxSave; + pVIADisplay->TVRestore = CH7xxxRestore; + pVIADisplay->TVDACSense = CH7xxxDACSense; + pVIADisplay->TVModeValid = CH7xxxModeValid; + pVIADisplay->TVModeI2C = CH7xxxModeI2C; + pVIADisplay->TVModeCrtc = CH7xxxModeCrtc; + pVIADisplay->TVPower = CH7xxxTVPower; + pVIADisplay->TVModes = CH7011Modes; + pVIADisplay->TVNumModes = sizeof(CH7011Modes) / sizeof(DisplayModeRec); + pVIADisplay->LCDPower = NULL; + pVIADisplay->TVNumRegs = CH_7011_MAX_NUM_REG; #ifdef HAVE_DEBUG - pBIOSInfo->TVPrintRegs = CH7xxxPrintRegs; + pVIADisplay->TVPrintRegs = CH7xxxPrintRegs; #endif break; case VIA_CH7019A: case VIA_CH7019B: - pBIOSInfo->TVDACSense = CH7xxxDACSense; - pBIOSInfo->TVSave = CH7xxxSave; - pBIOSInfo->TVRestore = CH7xxxRestore; - pBIOSInfo->TVModeValid = CH7xxxModeValid; - pBIOSInfo->TVModeI2C = CH7xxxModeI2C; - pBIOSInfo->TVModeCrtc = CH7xxxModeCrtc; - pBIOSInfo->TVPower = CH7xxxTVPower; - pBIOSInfo->TVModes = CH7019Modes; - pBIOSInfo->TVNumModes = sizeof(CH7019Modes) / sizeof(DisplayModeRec); - pBIOSInfo->LCDPower = CH7019LCDPower; - pBIOSInfo->TVNumRegs = CH_7019_MAX_NUM_REG; + pVIADisplay->TVDACSense = CH7xxxDACSense; + pVIADisplay->TVSave = CH7xxxSave; + pVIADisplay->TVRestore = CH7xxxRestore; + pVIADisplay->TVModeValid = CH7xxxModeValid; + pVIADisplay->TVModeI2C = CH7xxxModeI2C; + pVIADisplay->TVModeCrtc = CH7xxxModeCrtc; + pVIADisplay->TVPower = CH7xxxTVPower; + pVIADisplay->TVModes = CH7019Modes; + pVIADisplay->TVNumModes = sizeof(CH7019Modes) / sizeof(DisplayModeRec); + pVIADisplay->LCDPower = CH7019LCDPower; + pVIADisplay->TVNumRegs = CH_7019_MAX_NUM_REG; #ifdef HAVE_DEBUG - pBIOSInfo->TVPrintRegs = CH7xxxPrintRegs; + pVIADisplay->TVPrintRegs = CH7xxxPrintRegs; #endif break; default: @@ -644,6 +644,6 @@ ViaCH7xxxInit(ScrnInfoPtr pScrn) } /* Save before continuing */ - if (pBIOSInfo->TVSave) - pBIOSInfo->TVSave(pScrn); + if (pVIADisplay->TVSave) + pVIADisplay->TVSave(pScrn); } diff --git a/src/via_display.c b/src/via_display.c index 141ce03..b405361 100644 --- a/src/via_display.c +++ b/src/via_display.c @@ -3723,10 +3723,10 @@ iga1_crtc_mode_fixup(xf86CrtcPtr crtc, DisplayModePtr mode, temp = mode->CrtcHDisplay * mode->CrtcVDisplay * mode->VRefresh * (pScrn->bitsPerPixel >> 3); - if (pVia->pBIOSInfo->Bandwidth < temp) { + if (pVia->pVIADisplay->Bandwidth < temp) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Required bandwidth is not available. (%u > %u)\n", - (unsigned)temp, (unsigned)pVia->pBIOSInfo->Bandwidth); + (unsigned)temp, (unsigned)pVia->pVIADisplay->Bandwidth); return FALSE; } @@ -3785,7 +3785,7 @@ iga1_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode, ScrnInfoPtr pScrn = crtc->scrn; vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); - VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; + VIADisplayPtr pVIADisplay = pVia->pVIADisplay; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered iga1_crtc_mode_set.\n")); @@ -3815,9 +3815,9 @@ iga1_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode, ViaSetPrimaryFIFO(pScrn, adjusted_mode); - pBIOSInfo->Clock = ViaModeDotClockTranslate(pScrn, adjusted_mode); - pBIOSInfo->ClockExternal = FALSE; - ViaSetPrimaryDotclock(pScrn, pBIOSInfo->Clock); + pVIADisplay->Clock = ViaModeDotClockTranslate(pScrn, adjusted_mode); + pVIADisplay->ClockExternal = FALSE; + ViaSetPrimaryDotclock(pScrn, pVIADisplay->Clock); ViaSetUseExternalClock(hwp); ViaCrtcMask(hwp, 0x6B, 0x00, 0x01); @@ -4139,10 +4139,10 @@ iga2_crtc_mode_fixup(xf86CrtcPtr crtc, DisplayModePtr mode, temp = mode->CrtcHDisplay * mode->CrtcVDisplay * mode->VRefresh * (pScrn->bitsPerPixel >> 3); - if (pVia->pBIOSInfo->Bandwidth < temp) { + if (pVia->pVIADisplay->Bandwidth < temp) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Required bandwidth is not available. (%u > %u)\n", - (unsigned)temp, (unsigned)pVia->pBIOSInfo->Bandwidth); + (unsigned)temp, (unsigned)pVia->pVIADisplay->Bandwidth); return FALSE; } @@ -4200,7 +4200,7 @@ iga2_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode, ScrnInfoPtr pScrn = crtc->scrn; vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); - VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; + VIADisplayPtr pVIADisplay = pVia->pVIADisplay; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered iga2_crtc_mode_set.\n")); @@ -4223,9 +4223,9 @@ iga2_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode, viaIGA2SetDisplayRegister(pScrn, adjusted_mode); ViaSetSecondaryFIFO(pScrn, adjusted_mode); - pBIOSInfo->Clock = ViaModeDotClockTranslate(pScrn, adjusted_mode); - pBIOSInfo->ClockExternal = FALSE; - ViaSetSecondaryDotclock(pScrn, pBIOSInfo->Clock); + pVIADisplay->Clock = ViaModeDotClockTranslate(pScrn, adjusted_mode); + pVIADisplay->ClockExternal = FALSE; + ViaSetSecondaryDotclock(pScrn, pVIADisplay->Clock); ViaSetUseExternalClock(hwp); viaIGA2SetFBStartingAddress(crtc, x, y); diff --git a/src/via_driver.c b/src/via_driver.c index 439313c..2979039 100644 --- a/src/via_driver.c +++ b/src/via_driver.c @@ -405,14 +405,14 @@ VIAFreeRec(ScrnInfoPtr pScrn) if (!pScrn->driverPrivate) return; - VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; + VIADisplayPtr pVIADisplay = pVia->pVIADisplay; - if (pBIOSInfo) { - if (pBIOSInfo->TVI2CDev) - xf86DestroyI2CDevRec(pBIOSInfo->TVI2CDev, TRUE); + if (pVIADisplay) { + if (pVIADisplay->TVI2CDev) + xf86DestroyI2CDevRec(pVIADisplay->TVI2CDev, TRUE); - pVia->pBIOSInfo = NULL; - free(pBIOSInfo); + pVia->pVIADisplay = NULL; + free(pVIADisplay); } if (pVia->VideoRegs) @@ -719,15 +719,15 @@ VIAGetRec(ScrnInfoPtr pScrn) /* allocate VIARec */ pVia = (VIARec *) xnfcalloc(sizeof(VIARec), 1); if (pVia) { - pVia->pBIOSInfo = xnfcalloc(sizeof(VIABIOSInfoRec), 1); - VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; + pVia->pVIADisplay = xnfcalloc(sizeof(VIADisplayRec), 1); + VIADisplayPtr pVIADisplay = pVia->pVIADisplay; - if (pBIOSInfo) { - pBIOSInfo->TVI2CDev = NULL; + if (pVIADisplay) { + pVIADisplay->TVI2CDev = NULL; pVia->VideoRegs = (video_via_regs *) xnfcalloc(sizeof(video_via_regs), 1); if (!pVia->VideoRegs) { - free(pBIOSInfo); + free(pVIADisplay); free(pVia); } else { pScrn->driverPrivate = pVia; @@ -924,7 +924,7 @@ viaPreInit(ScrnInfoPtr pScrn, int flags) XF86OptionPtr option = xf86NewOption("MigrationHeuristic", "greedy"); EntityInfoPtr pEnt; VIAPtr pVia; - VIABIOSInfoPtr pBIOSInfo; + VIADisplayPtr pVIADisplay; MessageType from = X_DEFAULT; const char *s = NULL; #ifdef HAVE_DRI @@ -1373,41 +1373,41 @@ viaPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, from, "Will try to allocate %d kB of AGP memory.\n", pVia->agpMem); - pBIOSInfo = pVia->pBIOSInfo; - pBIOSInfo->TVDotCrawl = FALSE; + pVIADisplay = pVia->pVIADisplay; + pVIADisplay->TVDotCrawl = FALSE; from = xf86GetOptValBool(VIAOptions, OPTION_TVDOTCRAWL, - &pBIOSInfo->TVDotCrawl) + &pVIADisplay->TVDotCrawl) ? X_CONFIG : X_DEFAULT; xf86DrvMsg(pScrn->scrnIndex, from, "TV dotCrawl is %s.\n", - pBIOSInfo->TVDotCrawl ? "enabled" : "disabled"); + pVIADisplay->TVDotCrawl ? "enabled" : "disabled"); /* TV Deflicker */ - pBIOSInfo->TVDeflicker = 0; + pVIADisplay->TVDeflicker = 0; from = xf86GetOptValInteger(VIAOptions, OPTION_TVDEFLICKER, - &pBIOSInfo->TVDeflicker) + &pVIADisplay->TVDeflicker) ? X_CONFIG : X_DEFAULT; xf86DrvMsg(pScrn->scrnIndex, from, "TV deflicker is set to %d.\n", - pBIOSInfo->TVDeflicker); + pVIADisplay->TVDeflicker); - pBIOSInfo->TVType = TVTYPE_NONE; + pVIADisplay->TVType = TVTYPE_NONE; if ((s = xf86GetOptValString(VIAOptions, OPTION_TVTYPE))) { if (!xf86NameCmp(s, "NTSC")) { - pBIOSInfo->TVType = TVTYPE_NTSC; + pVIADisplay->TVType = TVTYPE_NTSC; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Type is NTSC.\n"); } else if (!xf86NameCmp(s, "PAL")) { - pBIOSInfo->TVType = TVTYPE_PAL; + pVIADisplay->TVType = TVTYPE_PAL; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Type is PAL.\n"); } else if (!xf86NameCmp(s, "480P")) { - pBIOSInfo->TVType = TVTYPE_480P; + pVIADisplay->TVType = TVTYPE_480P; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Type is SDTV 480P.\n"); } else if (!xf86NameCmp(s, "576P")) { - pBIOSInfo->TVType = TVTYPE_576P; + pVIADisplay->TVType = TVTYPE_576P; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Type is SDTV 576P.\n"); } else if (!xf86NameCmp(s, "720P")) { - pBIOSInfo->TVType = TVTYPE_720P; + pVIADisplay->TVType = TVTYPE_720P; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Type is HDTV 720P.\n"); } else if (!xf86NameCmp(s, "1080I")) { - pBIOSInfo->TVType = TVTYPE_1080I; + pVIADisplay->TVType = TVTYPE_1080I; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Type is HDTV 1080i.\n"); } } else { @@ -1415,25 +1415,25 @@ viaPreInit(ScrnInfoPtr pScrn, int flags) } /* TV output signal Option */ - pBIOSInfo->TVOutput = TVOUTPUT_NONE; + pVIADisplay->TVOutput = TVOUTPUT_NONE; if ((s = xf86GetOptValString(VIAOptions, OPTION_TVOUTPUT))) { if (!xf86NameCmp(s, "S-Video")) { - pBIOSInfo->TVOutput = TVOUTPUT_SVIDEO; + pVIADisplay->TVOutput = TVOUTPUT_SVIDEO; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Output Signal is S-Video.\n"); } else if (!xf86NameCmp(s, "Composite")) { - pBIOSInfo->TVOutput = TVOUTPUT_COMPOSITE; + pVIADisplay->TVOutput = TVOUTPUT_COMPOSITE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Output Signal is Composite.\n"); } else if (!xf86NameCmp(s, "SC")) { - pBIOSInfo->TVOutput = TVOUTPUT_SC; + pVIADisplay->TVOutput = TVOUTPUT_SC; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Output Signal is SC.\n"); } else if (!xf86NameCmp(s, "RGB")) { - pBIOSInfo->TVOutput = TVOUTPUT_RGB; + pVIADisplay->TVOutput = TVOUTPUT_RGB; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Output Signal is RGB.\n"); } else if (!xf86NameCmp(s, "YCbCr")) { - pBIOSInfo->TVOutput = TVOUTPUT_YCBCR; + pVIADisplay->TVOutput = TVOUTPUT_YCBCR; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Output Signal is YCbCr.\n"); } diff --git a/src/via_driver.h b/src/via_driver.h index a1ad2f5..4cffda5 100644 --- a/src/via_driver.h +++ b/src/via_driver.h @@ -281,8 +281,8 @@ typedef struct _VIA { /* Rotation */ Bool RandRRotation; - /* BIOS Info Ptr */ - VIABIOSInfoPtr pBIOSInfo; + /* Display Record Pointer */ + VIADisplayPtr pVIADisplay; /* VIA Technologies NanoBook reference design. Examples include Everex CloudBook and Sylvania g netbook. diff --git a/src/via_outputs.c b/src/via_outputs.c index 9468ef6..34acd92 100644 --- a/src/via_outputs.c +++ b/src/via_outputs.c @@ -649,12 +649,12 @@ void viaOutputDetect(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); - VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; + VIADisplayPtr pVIADisplay = pVia->pVIADisplay; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered viaOutputDetect.\n")); - pBIOSInfo->analog = NULL; + pVIADisplay->analog = NULL; /* Initialize the number of VGA connectors. */ pVia->numberVGA = 0; diff --git a/src/via_tv.c b/src/via_tv.c index 2492a65..c051821 100644 --- a/src/via_tv.c +++ b/src/via_tv.c @@ -538,28 +538,28 @@ viaTVSetDataDriveStrength(ScrnInfoPtr pScrn, CARD8 dataDriveStrength) static void ViaTVSave(ScrnInfoPtr pScrn) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; - if (pBIOSInfo->TVSave) - pBIOSInfo->TVSave(pScrn); + if (pVIADisplay->TVSave) + pVIADisplay->TVSave(pScrn); } static void ViaTVRestore(ScrnInfoPtr pScrn) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; - if (pBIOSInfo->TVRestore) - pBIOSInfo->TVRestore(pScrn); + if (pVIADisplay->TVRestore) + pVIADisplay->TVRestore(pScrn); } static Bool ViaTVDACSense(ScrnInfoPtr pScrn) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; - if (pBIOSInfo->TVDACSense) - return pBIOSInfo->TVDACSense(pScrn); + if (pVIADisplay->TVDACSense) + return pVIADisplay->TVDACSense(pScrn); return FALSE; } @@ -568,23 +568,23 @@ ViaTVSetMode(xf86CrtcPtr crtc, DisplayModePtr mode) { ScrnInfoPtr pScrn = crtc->scrn; VIAPtr pVia = VIAPTR(pScrn); - VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; + VIADisplayPtr pVIADisplay = pVia->pVIADisplay; - if (pBIOSInfo->TVModeI2C) - pBIOSInfo->TVModeI2C(pScrn, mode); + if (pVIADisplay->TVModeI2C) + pVIADisplay->TVModeI2C(pScrn, mode); - if (pBIOSInfo->TVModeCrtc) - pBIOSInfo->TVModeCrtc(crtc, mode); + if (pVIADisplay->TVModeCrtc) + pVIADisplay->TVModeCrtc(crtc, mode); /* TV reset. */ - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x1D, 0x00); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x1D, 0x80); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x1D, 0x00); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x1D, 0x80); } static void ViaTVPower(ScrnInfoPtr pScrn, Bool On) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; #ifdef HAVE_DEBUG if (On) @@ -593,18 +593,18 @@ ViaTVPower(ScrnInfoPtr pScrn, Bool On) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaTVPower: Off.\n"); #endif - if (pBIOSInfo->TVPower) - pBIOSInfo->TVPower(pScrn, On); + if (pVIADisplay->TVPower) + pVIADisplay->TVPower(pScrn, On); } #ifdef HAVE_DEBUG void ViaTVPrintRegs(ScrnInfoPtr pScrn) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; - if (pBIOSInfo->TVPrintRegs) - pBIOSInfo->TVPrintRegs(pScrn); + if (pVIADisplay->TVPrintRegs) + pVIADisplay->TVPrintRegs(pScrn); } #endif /* HAVE_DEBUG */ @@ -736,8 +736,8 @@ via_tv_get_modes(xf86OutputPtr output) VIAPtr pVia = VIAPTR(pScrn); int i; - for (i = 0; i < pVia->pBIOSInfo->TVNumModes; i++) { - mode = xf86DuplicateMode(&pVia->pBIOSInfo->TVModes[i]); + for (i = 0; i < pVia->pVIADisplay->TVNumModes; i++) { + mode = xf86DuplicateMode(&pVia->pVIADisplay->TVModes[i]); modes = xf86ModesAdd(modes, mode); } return modes; @@ -776,43 +776,43 @@ Bool via_tv_init(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); - VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; + VIADisplayPtr pVIADisplay = pVia->pVIADisplay; xf86OutputPtr output = NULL; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_tv_init.\n")); - /* preset some pBIOSInfo TV related values -- move up */ - pBIOSInfo->TVEncoder = VIA_NONETV; - pBIOSInfo->TVI2CDev = NULL; - pBIOSInfo->TVSave = NULL; - pBIOSInfo->TVRestore = NULL; - pBIOSInfo->TVDACSense = NULL; - pBIOSInfo->TVModeValid = NULL; - pBIOSInfo->TVModeI2C = NULL; - pBIOSInfo->TVModeCrtc = NULL; - pBIOSInfo->TVPower = NULL; - pBIOSInfo->TVModes = NULL; - pBIOSInfo->TVPrintRegs = NULL; - pBIOSInfo->LCDPower = NULL; - pBIOSInfo->TVNumRegs = 0; + /* preset some pVIADisplay TV related values -- move up */ + pVIADisplay->TVEncoder = VIA_NONETV; + pVIADisplay->TVI2CDev = NULL; + pVIADisplay->TVSave = NULL; + pVIADisplay->TVRestore = NULL; + pVIADisplay->TVDACSense = NULL; + pVIADisplay->TVModeValid = NULL; + pVIADisplay->TVModeI2C = NULL; + pVIADisplay->TVModeCrtc = NULL; + pVIADisplay->TVPower = NULL; + pVIADisplay->TVModes = NULL; + pVIADisplay->TVPrintRegs = NULL; + pVIADisplay->LCDPower = NULL; + pVIADisplay->TVNumRegs = 0; /* * On an SK43G (KM400/Ch7011), false positive detections at a VT162x * chip were observed, so try to detect the Ch7011 first. */ if (pVia->pI2CBus2 && xf86I2CProbeAddress(pVia->pI2CBus2, 0xEC)) - pBIOSInfo->TVI2CDev = ViaCH7xxxDetect(pScrn, pVia->pI2CBus2, 0xEC); + pVIADisplay->TVI2CDev = ViaCH7xxxDetect(pScrn, pVia->pI2CBus2, 0xEC); else if (pVia->pI2CBus2 && xf86I2CProbeAddress(pVia->pI2CBus2, 0x40)) - pBIOSInfo->TVI2CDev = ViaVT162xDetect(pScrn, pVia->pI2CBus2, 0x40); + pVIADisplay->TVI2CDev = ViaVT162xDetect(pScrn, pVia->pI2CBus2, 0x40); else if (pVia->pI2CBus3 && xf86I2CProbeAddress(pVia->pI2CBus3, 0x40)) - pBIOSInfo->TVI2CDev = ViaVT162xDetect(pScrn, pVia->pI2CBus3, 0x40); + pVIADisplay->TVI2CDev = ViaVT162xDetect(pScrn, pVia->pI2CBus3, 0x40); else if (pVia->pI2CBus2 && xf86I2CProbeAddress(pVia->pI2CBus2, 0xEA)) - pBIOSInfo->TVI2CDev = ViaCH7xxxDetect(pScrn, pVia->pI2CBus2, 0xEA); + pVIADisplay->TVI2CDev = ViaCH7xxxDetect(pScrn, pVia->pI2CBus2, 0xEA); else if (pVia->pI2CBus3 && xf86I2CProbeAddress(pVia->pI2CBus3, 0xEA)) - pBIOSInfo->TVI2CDev = ViaCH7xxxDetect(pScrn, pVia->pI2CBus3, 0xEA); + pVIADisplay->TVI2CDev = ViaCH7xxxDetect(pScrn, pVia->pI2CBus3, 0xEA); - if (!pBIOSInfo->TVI2CDev) { + if (!pVIADisplay->TVI2CDev) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Did not detect a TV encoder.\n"); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, @@ -821,7 +821,7 @@ via_tv_init(ScrnInfoPtr pScrn) return FALSE; } - switch (pBIOSInfo->TVEncoder) { + switch (pVIADisplay->TVEncoder) { case VIA_VT1621: case VIA_VT1622: case VIA_VT1623: @@ -842,28 +842,28 @@ via_tv_init(ScrnInfoPtr pScrn) break; } - if (!pBIOSInfo->TVSave || !pBIOSInfo->TVRestore - || !pBIOSInfo->TVDACSense || !pBIOSInfo->TVModeValid - || !pBIOSInfo->TVModeI2C || !pBIOSInfo->TVModeCrtc - || !pBIOSInfo->TVPower || !pBIOSInfo->TVModes - || !pBIOSInfo->TVPrintRegs) { - - xf86DestroyI2CDevRec(pBIOSInfo->TVI2CDev, TRUE); - - pBIOSInfo->TVI2CDev = NULL; - pBIOSInfo->TVOutput = TVOUTPUT_NONE; - pBIOSInfo->TVEncoder = VIA_NONETV; - pBIOSInfo->TVI2CDev = NULL; - pBIOSInfo->TVSave = NULL; - pBIOSInfo->TVRestore = NULL; - pBIOSInfo->TVDACSense = NULL; - pBIOSInfo->TVModeValid = NULL; - pBIOSInfo->TVModeI2C = NULL; - pBIOSInfo->TVModeCrtc = NULL; - pBIOSInfo->TVPower = NULL; - pBIOSInfo->TVModes = NULL; - pBIOSInfo->TVPrintRegs = NULL; - pBIOSInfo->TVNumRegs = 0; + if (!pVIADisplay->TVSave || !pVIADisplay->TVRestore + || !pVIADisplay->TVDACSense || !pVIADisplay->TVModeValid + || !pVIADisplay->TVModeI2C || !pVIADisplay->TVModeCrtc + || !pVIADisplay->TVPower || !pVIADisplay->TVModes + || !pVIADisplay->TVPrintRegs) { + + xf86DestroyI2CDevRec(pVIADisplay->TVI2CDev, TRUE); + + pVIADisplay->TVI2CDev = NULL; + pVIADisplay->TVOutput = TVOUTPUT_NONE; + pVIADisplay->TVEncoder = VIA_NONETV; + pVIADisplay->TVI2CDev = NULL; + pVIADisplay->TVSave = NULL; + pVIADisplay->TVRestore = NULL; + pVIADisplay->TVDACSense = NULL; + pVIADisplay->TVModeValid = NULL; + pVIADisplay->TVModeI2C = NULL; + pVIADisplay->TVModeCrtc = NULL; + pVIADisplay->TVPower = NULL; + pVIADisplay->TVModes = NULL; + pVIADisplay->TVPrintRegs = NULL; + pVIADisplay->TVNumRegs = 0; xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "TV encoder was not properly initialized.\n"); @@ -883,13 +883,13 @@ via_tv_init(ScrnInfoPtr pScrn) "Failed to register TV-1.\n"); } - pBIOSInfo->tv = output; + pVIADisplay->tv = output; /* Save now */ - pBIOSInfo->TVSave(pScrn); + pVIADisplay->TVSave(pScrn); #ifdef HAVE_DEBUG if (VIAPTR(pScrn)->PrintTVRegs) - pBIOSInfo->TVPrintRegs(pScrn); + pVIADisplay->TVPrintRegs(pScrn); #endif DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, diff --git a/src/via_ums.c b/src/via_ums.c index 7933e0b..4158f9a 100644 --- a/src/via_ums.c +++ b/src/via_ums.c @@ -918,7 +918,7 @@ umsCrtcInit(ScrnInfoPtr pScrn) ClockRangesPtr clockRanges; #endif int max_pitch, max_height; - VIABIOSInfoPtr pBIOSInfo; + VIADisplayPtr pVIADisplay; xf86CrtcPtr iga1, iga2; /* 3X5.3B through 3X5.3F are scratch pad registers. */ @@ -937,17 +937,17 @@ umsCrtcInit(ScrnInfoPtr pScrn) "Unknown Memory clock: %d\n", pVia->MemClk); pVia->MemClk = VIA_MEM_END - 1; } - pBIOSInfo = pVia->pBIOSInfo; - pBIOSInfo->Bandwidth = ViaGetMemoryBandwidth(pScrn); + pVIADisplay = pVia->pVIADisplay; + pVIADisplay->Bandwidth = ViaGetMemoryBandwidth(pScrn); - if (pBIOSInfo->TVType == TVTYPE_NONE) { + if (pVIADisplay->TVType == TVTYPE_NONE) { /* Use jumper to determine TV type. */ if (hwp->readCrtc(hwp, 0x3B) & 0x02) { - pBIOSInfo->TVType = TVTYPE_PAL; + pVIADisplay->TVType = TVTYPE_PAL; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Detected TV standard: PAL.\n")); } else { - pBIOSInfo->TVType = TVTYPE_NTSC; + pVIADisplay->TVType = TVTYPE_NTSC; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Detected TV standard: NTSC.\n")); } diff --git a/src/via_ums.h b/src/via_ums.h index 8d38d4d..ba93992 100644 --- a/src/via_ums.h +++ b/src/via_ums.h @@ -144,7 +144,7 @@ typedef struct ViaPanelMode { Bool useDithering; } ViaPanelModeRec, *ViaPanelModePtr ; -typedef struct _VIABIOSINFO { +typedef struct _VIADISPLAY { xf86OutputPtr analog; xf86OutputPtr tv; @@ -175,7 +175,7 @@ typedef struct _VIABIOSINFO { int TVNumModes; void (*TVPrintRegs) (ScrnInfoPtr pScrn); -} VIABIOSInfoRec, *VIABIOSInfoPtr; +} VIADisplayRec, *VIADisplayPtr; /* diff --git a/src/via_vt162x.c b/src/via_vt162x.c index 3bcfe18..41f7d78 100644 --- a/src/via_vt162x.c +++ b/src/via_vt162x.c @@ -36,12 +36,12 @@ ViaSetTVClockSource(xf86CrtcPtr crtc) drmmode_crtc_private_ptr iga = crtc->driver_private; ScrnInfoPtr pScrn = crtc->scrn; VIAPtr pVia = VIAPTR(pScrn); - VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; + VIADisplayPtr pVIADisplay = pVia->pVIADisplay; vgaHWPtr hwp = VGAHWPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaSetTVClockSource\n")); - switch(pBIOSInfo->TVEncoder) { + switch(pVIADisplay->TVEncoder) { case VIA_VT1625: /* External TV: */ switch(pVia->Chipset) { @@ -80,15 +80,15 @@ ViaSetTVClockSource(xf86CrtcPtr crtc) static void VT162xPrintRegs(ScrnInfoPtr pScrn) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; CARD8 i, buf; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Printing registers for %s\n", - pBIOSInfo->TVI2CDev->DevName); + pVIADisplay->TVI2CDev->DevName); - for (i = 0; i < pBIOSInfo->TVNumRegs; i++) { - xf86I2CReadByte(pBIOSInfo->TVI2CDev, i, &buf); + for (i = 0; i < pVIADisplay->TVNumRegs; i++) { + xf86I2CReadByte(pVIADisplay->TVI2CDev, i, &buf); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV%02X: 0x%02X\n", i, buf); } @@ -99,7 +99,7 @@ VT162xPrintRegs(ScrnInfoPtr pScrn) I2CDevPtr ViaVT162xDetect(ScrnInfoPtr pScrn, I2CBusPtr pBus, CARD8 Address) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; I2CDevPtr pDev = xf86CreateI2CDevRec(); CARD8 buf; @@ -126,29 +126,29 @@ ViaVT162xDetect(ScrnInfoPtr pScrn, I2CBusPtr pBus, CARD8 Address) case 0x02: xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected VIA Technologies VT1621 TV Encoder\n"); - pBIOSInfo->TVEncoder = VIA_VT1621; + pVIADisplay->TVEncoder = VIA_VT1621; pDev->DevName = "VT1621"; break; case 0x03: xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected VIA Technologies VT1622 TV Encoder\n"); - pBIOSInfo->TVEncoder = VIA_VT1622; + pVIADisplay->TVEncoder = VIA_VT1622; pDev->DevName = "VT1622"; break; case 0x10: xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected VIA Technologies VT1622A/VT1623 TV Encoder\n"); - pBIOSInfo->TVEncoder = VIA_VT1623; + pVIADisplay->TVEncoder = VIA_VT1623; pDev->DevName = "VT1623"; break; case 0x50: xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected VIA Technologies VT1625 TV Encoder\n"); - pBIOSInfo->TVEncoder = VIA_VT1625; + pVIADisplay->TVEncoder = VIA_VT1625; pDev->DevName = "VT1625"; break; default: - pBIOSInfo->TVEncoder = VIA_NONETV; + pVIADisplay->TVEncoder = VIA_NONETV; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Unknown TV Encoder found at %s %X.\n", pBus->BusName, Address); @@ -165,25 +165,25 @@ static void VT162xSave(ScrnInfoPtr pScrn) { int i; - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT162xSave\n")); - for (i = 0; i < pBIOSInfo->TVNumRegs; i++) - xf86I2CReadByte(pBIOSInfo->TVI2CDev, i, &(pBIOSInfo->TVRegs[i])); + for (i = 0; i < pVIADisplay->TVNumRegs; i++) + xf86I2CReadByte(pVIADisplay->TVI2CDev, i, &(pVIADisplay->TVRegs[i])); } static void VT162xRestore(ScrnInfoPtr pScrn) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; int i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT162xRestore\n")); - for (i = 0; i < pBIOSInfo->TVNumRegs; i++) - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, i, pBIOSInfo->TVRegs[i]); + for (i = 0; i < pVIADisplay->TVNumRegs; i++) + xf86I2CWriteByte(pVIADisplay->TVI2CDev, i, pVIADisplay->TVRegs[i]); } @@ -252,35 +252,35 @@ VT1625DACSenseI2C(I2CDevPtr pDev) static Bool VT1621DACSense(ScrnInfoPtr pScrn) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; CARD8 sense; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1621DACSense\n")); - sense = VT162xDACSenseI2C(pBIOSInfo->TVI2CDev); + sense = VT162xDACSenseI2C(pVIADisplay->TVI2CDev); switch (sense) { case 0x00: - pBIOSInfo->TVOutput = TVOUTPUT_SC; + pVIADisplay->TVOutput = TVOUTPUT_SC; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1621: S-Video & Composite connected.\n"); return TRUE; case 0x01: - pBIOSInfo->TVOutput = TVOUTPUT_COMPOSITE; + pVIADisplay->TVOutput = TVOUTPUT_COMPOSITE; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1621: Composite connected.\n"); return TRUE; case 0x02: - pBIOSInfo->TVOutput = TVOUTPUT_SVIDEO; + pVIADisplay->TVOutput = TVOUTPUT_SVIDEO; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1621: S-Video connected.\n"); return TRUE; case 0x03: - pBIOSInfo->TVOutput = TVOUTPUT_NONE; + pVIADisplay->TVOutput = TVOUTPUT_NONE; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1621: Nothing connected.\n"); return FALSE; default: - pBIOSInfo->TVOutput = TVOUTPUT_NONE; + pVIADisplay->TVOutput = TVOUTPUT_NONE; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "VT1621: Unknown cable combination: 0x0%2X.\n", sense); return FALSE; @@ -293,45 +293,45 @@ VT1621DACSense(ScrnInfoPtr pScrn) static Bool VT1622DACSense(ScrnInfoPtr pScrn) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; CARD8 sense; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1622DACSense\n")); - sense = VT162xDACSenseI2C(pBIOSInfo->TVI2CDev); + sense = VT162xDACSenseI2C(pVIADisplay->TVI2CDev); switch (sense) { case 0x00: /* DAC A,B,C,D */ - pBIOSInfo->TVOutput = TVOUTPUT_RGB; + pVIADisplay->TVOutput = TVOUTPUT_RGB; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT162x: RGB connected.\n"); return TRUE; case 0x01: /* DAC A,B,C */ - pBIOSInfo->TVOutput = TVOUTPUT_SC; + pVIADisplay->TVOutput = TVOUTPUT_SC; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT162x: S-Video & Composite connected.\n"); return TRUE; case 0x07: /* DAC A */ - pBIOSInfo->TVOutput = TVOUTPUT_COMPOSITE; + pVIADisplay->TVOutput = TVOUTPUT_COMPOSITE; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT162x: Composite connected.\n"); return TRUE; case 0x08: /* DAC B,C,D */ - pBIOSInfo->TVOutput = TVOUTPUT_YCBCR; + pVIADisplay->TVOutput = TVOUTPUT_YCBCR; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT162x: YcBcR connected.\n"); return TRUE; case 0x09: /* DAC B,C */ - pBIOSInfo->TVOutput = TVOUTPUT_SVIDEO; + pVIADisplay->TVOutput = TVOUTPUT_SVIDEO; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT162x: S-Video connected.\n"); return TRUE; case 0x0F: - pBIOSInfo->TVOutput = TVOUTPUT_NONE; + pVIADisplay->TVOutput = TVOUTPUT_NONE; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT162x: Nothing connected.\n"); return FALSE; default: - pBIOSInfo->TVOutput = TVOUTPUT_NONE; + pVIADisplay->TVOutput = TVOUTPUT_NONE; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "VT162x: Unknown cable combination: 0x0%2X.\n", sense); return FALSE; @@ -344,45 +344,45 @@ VT1622DACSense(ScrnInfoPtr pScrn) static Bool VT1625DACSense(ScrnInfoPtr pScrn) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; CARD8 sense; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1625DACSense\n")); - sense = VT1625DACSenseI2C(pBIOSInfo->TVI2CDev); + sense = VT1625DACSenseI2C(pVIADisplay->TVI2CDev); switch (sense) { case 0x00: /* DAC A,B,C,D,E,F */ - pBIOSInfo->TVOutput = TVOUTPUT_RGB; + pVIADisplay->TVOutput = TVOUTPUT_RGB; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1625: RGB connected.\n"); return TRUE; case 0x07: /* DAC A,B,C */ - pBIOSInfo->TVOutput = TVOUTPUT_SC; + pVIADisplay->TVOutput = TVOUTPUT_SC; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1625: S-Video & Composite connected.\n"); return TRUE; case 0x37: /* DAC C */ - pBIOSInfo->TVOutput = TVOUTPUT_COMPOSITE; + pVIADisplay->TVOutput = TVOUTPUT_COMPOSITE; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1625: Composite connected.\n"); return TRUE; case 0x38: /* DAC D,E,F */ - pBIOSInfo->TVOutput = TVOUTPUT_YCBCR; + pVIADisplay->TVOutput = TVOUTPUT_YCBCR; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1625: YCbCr connected.\n"); return TRUE; case 0x0F: /* DAC A,B */ - pBIOSInfo->TVOutput = TVOUTPUT_SVIDEO; + pVIADisplay->TVOutput = TVOUTPUT_SVIDEO; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1625: S-Video connected.\n"); return TRUE; case 0x3F: - pBIOSInfo->TVOutput = TVOUTPUT_NONE; + pVIADisplay->TVOutput = TVOUTPUT_NONE; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VT1625: Nothing connected.\n"); return FALSE; default: - pBIOSInfo->TVOutput = TVOUTPUT_NONE; + pVIADisplay->TVOutput = TVOUTPUT_NONE; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "VT1625: Unknown cable combination: 0x0%2X.\n", sense); return FALSE; @@ -392,7 +392,7 @@ VT1625DACSense(ScrnInfoPtr pScrn) static CARD8 VT1621ModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; int i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1621ModeIndex\n")); @@ -400,7 +400,7 @@ VT1621ModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode) for (i = 0; VT1621Table[i].Width; i++) { if ((VT1621Table[i].Width == mode->CrtcHDisplay) && (VT1621Table[i].Height == mode->CrtcVDisplay) && - (VT1621Table[i].Standard == pBIOSInfo->TVType) && + (VT1621Table[i].Standard == pVIADisplay->TVType) && !(strcmp(VT1621Table[i].name, mode->name))) return i; } @@ -412,7 +412,7 @@ VT1621ModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode) static ModeStatus VT1621ModeValid(ScrnInfoPtr pScrn, DisplayModePtr mode) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1621ModeValid\n")); @@ -424,12 +424,12 @@ VT1621ModeValid(ScrnInfoPtr pScrn, DisplayModePtr mode) return MODE_BAD; } - if ((pBIOSInfo->TVType == TVTYPE_NTSC) && + if ((pVIADisplay->TVType == TVTYPE_NTSC) && (mode->Private != (void *)&VT162xModePrivateNTSC)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is NTSC. This is a PAL mode.\n"); return MODE_BAD; - } else if ((pBIOSInfo->TVType == TVTYPE_PAL) && + } else if ((pVIADisplay->TVType == TVTYPE_PAL) && (mode->Private != (void *)&VT162xModePrivatePAL)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is PAL. This is a NTSC mode.\n"); @@ -444,15 +444,15 @@ VT1621ModeValid(ScrnInfoPtr pScrn, DisplayModePtr mode) static CARD8 VT1622ModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; struct VT162XTableRec *Table; int i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1622ModeIndex\n")); - if (pBIOSInfo->TVEncoder == VIA_VT1622) + if (pVIADisplay->TVEncoder == VIA_VT1622) Table = VT1622Table; - else if (pBIOSInfo->TVEncoder == VIA_VT1625) + else if (pVIADisplay->TVEncoder == VIA_VT1625) Table = VT1625Table; else Table = VT1623Table; @@ -462,12 +462,12 @@ VT1622ModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode) "width=%d:%d, height=%d:%d, std=%d:%d, name=%s:%s.\n", Table[i].Width, mode->CrtcHDisplay, Table[i].Height, mode->CrtcVDisplay, - Table[i].Standard, pBIOSInfo->TVType, + Table[i].Standard, pVIADisplay->TVType, Table[i].name, mode->name); if ((Table[i].Width == mode->CrtcHDisplay) && (Table[i].Height == mode->CrtcVDisplay) && - (Table[i].Standard == pBIOSInfo->TVType) && + (Table[i].Standard == pVIADisplay->TVType) && !strcmp(Table[i].name, mode->name)) return i; } @@ -479,7 +479,7 @@ VT1622ModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode) static ModeStatus VT1622ModeValid(ScrnInfoPtr pScrn, DisplayModePtr mode) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1622ModeValid\n")); @@ -491,12 +491,12 @@ VT1622ModeValid(ScrnInfoPtr pScrn, DisplayModePtr mode) return MODE_BAD; } - if ((pBIOSInfo->TVType == TVTYPE_NTSC) && + if ((pVIADisplay->TVType == TVTYPE_NTSC) && (mode->Private != (void *)&VT162xModePrivateNTSC)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is NTSC. This is a PAL mode.\n"); return MODE_BAD; - } else if ((pBIOSInfo->TVType == TVTYPE_PAL) && + } else if ((pVIADisplay->TVType == TVTYPE_PAL) && (mode->Private != (void *)&VT162xModePrivatePAL)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is PAL. This is a NTSC mode.\n"); @@ -511,7 +511,7 @@ VT1622ModeValid(ScrnInfoPtr pScrn, DisplayModePtr mode) static ModeStatus VT1625ModeValid(ScrnInfoPtr pScrn, DisplayModePtr mode) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1625ModeValid\n")); @@ -527,32 +527,32 @@ VT1625ModeValid(ScrnInfoPtr pScrn, DisplayModePtr mode) return MODE_BAD; } - if ((pBIOSInfo->TVType == TVTYPE_NTSC) && + if ((pVIADisplay->TVType == TVTYPE_NTSC) && (mode->Private != (void *)&VT162xModePrivateNTSC)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is NTSC. This is an incompatible mode.\n"); return MODE_BAD; - } else if ((pBIOSInfo->TVType == TVTYPE_PAL) && + } else if ((pVIADisplay->TVType == TVTYPE_PAL) && (mode->Private != (void *)&VT162xModePrivatePAL)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is PAL. This is an incompatible mode.\n"); return MODE_BAD; - } else if ((pBIOSInfo->TVType == TVTYPE_480P) && + } else if ((pVIADisplay->TVType == TVTYPE_480P) && (mode->Private != (void *)&VT162xModePrivate480P)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is 480P. This is an incompatible mode.\n"); return MODE_BAD; - } else if ((pBIOSInfo->TVType == TVTYPE_576P) && + } else if ((pVIADisplay->TVType == TVTYPE_576P) && (mode->Private != (void *)&VT162xModePrivate576P)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is 576P. This is an incompatible mode.\n"); return MODE_BAD; - } else if ((pBIOSInfo->TVType == TVTYPE_720P) && + } else if ((pVIADisplay->TVType == TVTYPE_720P) && (mode->Private != (void *)&VT162xModePrivate720P)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is 720P. This is an incompatible mode.\n"); return MODE_BAD; - } else if ((pBIOSInfo->TVType == TVTYPE_1080I) && + } else if ((pVIADisplay->TVType == TVTYPE_1080I) && (mode->Private != (void *)&VT162xModePrivate1080I)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standard is 1080I. This is an incompatible mode.\n"); @@ -577,45 +577,45 @@ VT162xSetSubCarrier(I2CDevPtr pDev, CARD32 SubCarrier) static void VT1621ModeI2C(ScrnInfoPtr pScrn, DisplayModePtr mode) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; struct VT1621TableRec Table = VT1621Table[VT1621ModeIndex(pScrn, mode)]; CARD8 i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1621ModeI2C\n")); for (i = 0; i < 0x16; i++) - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, i, Table.TV[i]); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, i, Table.TV[i]); - VT162xSetSubCarrier(pBIOSInfo->TVI2CDev, Table.SubCarrier); + VT162xSetSubCarrier(pVIADisplay->TVI2CDev, Table.SubCarrier); /* Skip reserved (1A) and version ID (1B). */ - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x1C, Table.TV[0x1C]); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x1C, Table.TV[0x1C]); /* Skip software reset (1D). */ for (i = 0x1E; i < 0x24; i++) - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, i, Table.TV[i]); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, i, Table.TV[i]); /* Write some zeroes? */ - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x24, 0x00); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x24, 0x00); for (i = 0; i < 0x08; i++) - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x4A + i, 0x00); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x4A + i, 0x00); - if (pBIOSInfo->TVOutput == TVOUTPUT_COMPOSITE) + if (pVIADisplay->TVOutput == TVOUTPUT_COMPOSITE) for (i = 0; i < 0x10; i++) - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x52 + i, Table.TVC[i]); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x52 + i, Table.TVC[i]); else for (i = 0; i < 0x10; i++) - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x52 + i, Table.TVS[i]); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x52 + i, Table.TVS[i]); /* Turn on all Composite and S-Video output. */ - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x0E, 0x00); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x0E, 0x00); - if (pBIOSInfo->TVDotCrawl) { + if (pVIADisplay->TVDotCrawl) { if (Table.DotCrawlSubCarrier) { - xf86I2CReadByte(pBIOSInfo->TVI2CDev, 0x11, &i); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x11, i | 0x08); + xf86I2CReadByte(pVIADisplay->TVI2CDev, 0x11, &i); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x11, i | 0x08); - VT162xSetSubCarrier(pBIOSInfo->TVI2CDev, Table.DotCrawlSubCarrier); + VT162xSetSubCarrier(pVIADisplay->TVI2CDev, Table.DotCrawlSubCarrier); } else xf86DrvMsg(pScrn->scrnIndex, X_INFO, "This mode does not currently " "support DotCrawl suppression.\n"); @@ -628,7 +628,7 @@ VT1621ModeCrtc(xf86CrtcPtr crtc, DisplayModePtr mode) ScrnInfoPtr pScrn = crtc->scrn; vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); - VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; + VIADisplayPtr pVIADisplay = pVia->pVIADisplay; struct VT1621TableRec Table = VT1621Table[VT1621ModeIndex(pScrn, mode)]; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1621ModeCrtc\n")); @@ -647,7 +647,7 @@ VT1621ModeCrtc(xf86CrtcPtr crtc, DisplayModePtr mode) hwp->writeCrtc(hwp, 0x6B, 0x80); hwp->writeCrtc(hwp, 0x6C, Table.PrimaryCR6C); } - pBIOSInfo->ClockExternal = TRUE; + pVIADisplay->ClockExternal = TRUE; ViaCrtcMask(hwp, 0x6A, 0x40, 0x40); ViaCrtcMask(hwp, 0x6C, 0x01, 0x01); } @@ -658,99 +658,99 @@ VT1621ModeCrtc(xf86CrtcPtr crtc, DisplayModePtr mode) static void VT1622ModeI2C(ScrnInfoPtr pScrn, DisplayModePtr mode) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; struct VT162XTableRec Table; CARD8 save, i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1622ModeI2C\n")); - if (pBIOSInfo->TVEncoder == VIA_VT1622) + if (pVIADisplay->TVEncoder == VIA_VT1622) Table = VT1622Table[VT1622ModeIndex(pScrn, mode)]; - else if (pBIOSInfo->TVEncoder == VIA_VT1625) + else if (pVIADisplay->TVEncoder == VIA_VT1625) Table = VT1625Table[VT1622ModeIndex(pScrn, mode)]; else /* VT1622A/VT1623 */ Table = VT1623Table[VT1622ModeIndex(pScrn, mode)]; /* TV reset. */ - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x1D, 0x00); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x1D, 0x80); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x1D, 0x00); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x1D, 0x80); for (i = 0; i < 0x16; i++) - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, i, Table.TV1[i]); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, i, Table.TV1[i]); - VT162xSetSubCarrier(pBIOSInfo->TVI2CDev, Table.SubCarrier); + VT162xSetSubCarrier(pVIADisplay->TVI2CDev, Table.SubCarrier); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x1A, Table.TV1[0x1A]); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x1A, Table.TV1[0x1A]); /* Skip version ID. */ - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x1C, Table.TV1[0x1C]); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x1C, Table.TV1[0x1C]); /* Skip software reset. */ for (i = 0x1E; i < 0x30; i++) - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, i, Table.TV1[i]); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, i, Table.TV1[i]); for (i = 0; i < 0x1B; i++) - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x4A + i, Table.TV2[i]); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x4A + i, Table.TV2[i]); /* Turn on all Composite and S-Video output. */ - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x0E, 0x00); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x0E, 0x00); - if (pBIOSInfo->TVDotCrawl) { + if (pVIADisplay->TVDotCrawl) { if (Table.DotCrawlSubCarrier) { - xf86I2CReadByte(pBIOSInfo->TVI2CDev, 0x11, &save); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x11, save | 0x08); + xf86I2CReadByte(pVIADisplay->TVI2CDev, 0x11, &save); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x11, save | 0x08); - VT162xSetSubCarrier(pBIOSInfo->TVI2CDev, Table.DotCrawlSubCarrier); + VT162xSetSubCarrier(pVIADisplay->TVI2CDev, Table.DotCrawlSubCarrier); } else xf86DrvMsg(pScrn->scrnIndex, X_INFO, "This mode does not currently " "support DotCrawl suppression.\n"); } - if (pBIOSInfo->TVOutput == TVOUTPUT_RGB) { - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x02, 0x2A); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x65, Table.RGB[0]); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x66, Table.RGB[1]); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x67, Table.RGB[2]); + if (pVIADisplay->TVOutput == TVOUTPUT_RGB) { + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x02, 0x2A); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x65, Table.RGB[0]); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x66, Table.RGB[1]); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x67, Table.RGB[2]); if (Table.RGB[3]) - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x27, Table.RGB[3]); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x27, Table.RGB[3]); if (Table.RGB[4]) - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x2B, Table.RGB[4]); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x2B, Table.RGB[4]); if (Table.RGB[5]) - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x2C, Table.RGB[5]); - if (pBIOSInfo->TVEncoder == VIA_VT1625) { - if (pBIOSInfo->TVType < TVTYPE_480P) { - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x02, 0x12); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x23, 0x7E); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x4A, 0x85); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x4B, 0x0A); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x4E, 0x00); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x2C, Table.RGB[5]); + if (pVIADisplay->TVEncoder == VIA_VT1625) { + if (pVIADisplay->TVType < TVTYPE_480P) { + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x02, 0x12); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x23, 0x7E); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x4A, 0x85); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x4B, 0x0A); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x4E, 0x00); } else { - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x02, 0x12); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x4A, 0x85); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x4B, 0x0A); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x02, 0x12); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x4A, 0x85); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x4B, 0x0A); } } - } else if (pBIOSInfo->TVOutput == TVOUTPUT_YCBCR) { - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x02, 0x03); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x65, Table.YCbCr[0]); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x66, Table.YCbCr[1]); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x67, Table.YCbCr[2]); - if (pBIOSInfo->TVEncoder == VIA_VT1625) { - if (pBIOSInfo->TVType < TVTYPE_480P) { - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x23, 0x7E); - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x4E, 0x00); + } else if (pVIADisplay->TVOutput == TVOUTPUT_YCBCR) { + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x02, 0x03); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x65, Table.YCbCr[0]); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x66, Table.YCbCr[1]); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x67, Table.YCbCr[2]); + if (pVIADisplay->TVEncoder == VIA_VT1625) { + if (pVIADisplay->TVType < TVTYPE_480P) { + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x23, 0x7E); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x4E, 0x00); } } } /* Configure flicker filter. */ - xf86I2CReadByte(pBIOSInfo->TVI2CDev, 0x03, &save); + xf86I2CReadByte(pVIADisplay->TVI2CDev, 0x03, &save); save &= 0xFC; - if (pBIOSInfo->TVDeflicker == 1) + if (pVIADisplay->TVDeflicker == 1) save |= 0x01; - else if (pBIOSInfo->TVDeflicker == 2) + else if (pVIADisplay->TVDeflicker == 2) save |= 0x02; - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x03, save); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x03, save); } /* @@ -762,14 +762,14 @@ VT1622ModeCrtc(xf86CrtcPtr crtc, DisplayModePtr mode) ScrnInfoPtr pScrn = crtc->scrn; vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); - VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; + VIADisplayPtr pVIADisplay = pVia->pVIADisplay; struct VT162XTableRec Table; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1622ModeCrtc\n")); - if (pBIOSInfo->TVEncoder == VIA_VT1622) + if (pVIADisplay->TVEncoder == VIA_VT1622) Table = VT1622Table[VT1622ModeIndex(pScrn, mode)]; - else if (pBIOSInfo->TVEncoder == VIA_VT1625) + else if (pVIADisplay->TVEncoder == VIA_VT1625) Table = VT1625Table[VT1622ModeIndex(pScrn, mode)]; else /* VT1622A/VT1623 */ Table = VT1623Table[VT1622ModeIndex(pScrn, mode)]; @@ -806,7 +806,7 @@ VT1622ModeCrtc(xf86CrtcPtr crtc, DisplayModePtr mode) hwp->writeCrtc(hwp, 0x6C, Table.PrimaryCR6C); } } - pBIOSInfo->ClockExternal = TRUE; + pVIADisplay->ClockExternal = TRUE; ViaCrtcMask(hwp, 0x6A, 0x40, 0x40); ViaSetTVClockSource(crtc); } @@ -815,102 +815,102 @@ VT1622ModeCrtc(xf86CrtcPtr crtc, DisplayModePtr mode) static void VT1621Power(ScrnInfoPtr pScrn, Bool On) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1621Power\n")); if (On) - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x0E, 0x00); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x0E, 0x00); else - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x0E, 0x03); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x0E, 0x03); } static void VT1622Power(ScrnInfoPtr pScrn, Bool On) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1622Power\n")); if (On) - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x0E, 0x00); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x0E, 0x00); else - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x0E, 0x0F); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x0E, 0x0F); } static void VT1625Power(ScrnInfoPtr pScrn, Bool On) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1625Power\n")); if (On) - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x0E, 0x00); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x0E, 0x00); else - xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x0E, 0x3F); + xf86I2CWriteByte(pVIADisplay->TVI2CDev, 0x0E, 0x3F); } void ViaVT162xInit(ScrnInfoPtr pScrn) { - VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo; + VIADisplayPtr pVIADisplay = VIAPTR(pScrn)->pVIADisplay; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaVT162xInit\n")); - switch (pBIOSInfo->TVEncoder) { + switch (pVIADisplay->TVEncoder) { case VIA_VT1621: - pBIOSInfo->TVSave = VT162xSave; - pBIOSInfo->TVRestore = VT162xRestore; - pBIOSInfo->TVDACSense = VT1621DACSense; - pBIOSInfo->TVModeValid = VT1621ModeValid; - pBIOSInfo->TVModeI2C = VT1621ModeI2C; - pBIOSInfo->TVModeCrtc = VT1621ModeCrtc; - pBIOSInfo->TVPower = VT1621Power; - pBIOSInfo->TVModes = VT1621Modes; - pBIOSInfo->TVNumModes = sizeof(VT1621Modes) / sizeof(DisplayModeRec); - pBIOSInfo->TVPrintRegs = VT162xPrintRegs; - pBIOSInfo->TVNumRegs = 0x68; + pVIADisplay->TVSave = VT162xSave; + pVIADisplay->TVRestore = VT162xRestore; + pVIADisplay->TVDACSense = VT1621DACSense; + pVIADisplay->TVModeValid = VT1621ModeValid; + pVIADisplay->TVModeI2C = VT1621ModeI2C; + pVIADisplay->TVModeCrtc = VT1621ModeCrtc; + pVIADisplay->TVPower = VT1621Power; + pVIADisplay->TVModes = VT1621Modes; + pVIADisplay->TVNumModes = sizeof(VT1621Modes) / sizeof(DisplayModeRec); + pVIADisplay->TVPrintRegs = VT162xPrintRegs; + pVIADisplay->TVNumRegs = 0x68; break; case VIA_VT1622: - pBIOSInfo->TVSave = VT162xSave; - pBIOSInfo->TVRestore = VT162xRestore; - pBIOSInfo->TVDACSense = VT1622DACSense; - pBIOSInfo->TVModeValid = VT1622ModeValid; - pBIOSInfo->TVModeI2C = VT1622ModeI2C; - pBIOSInfo->TVModeCrtc = VT1622ModeCrtc; - pBIOSInfo->TVPower = VT1622Power; - pBIOSInfo->TVModes = VT1622Modes; - pBIOSInfo->TVNumModes = sizeof(VT1622Modes) / sizeof(DisplayModeRec); - pBIOSInfo->TVPrintRegs = VT162xPrintRegs; - pBIOSInfo->TVNumRegs = 0x68; + pVIADisplay->TVSave = VT162xSave; + pVIADisplay->TVRestore = VT162xRestore; + pVIADisplay->TVDACSense = VT1622DACSense; + pVIADisplay->TVModeValid = VT1622ModeValid; + pVIADisplay->TVModeI2C = VT1622ModeI2C; + pVIADisplay->TVModeCrtc = VT1622ModeCrtc; + pVIADisplay->TVPower = VT1622Power; + pVIADisplay->TVModes = VT1622Modes; + pVIADisplay->TVNumModes = sizeof(VT1622Modes) / sizeof(DisplayModeRec); + pVIADisplay->TVPrintRegs = VT162xPrintRegs; + pVIADisplay->TVNumRegs = 0x68; break; case VIA_VT1623: - pBIOSInfo->TVSave = VT162xSave; - pBIOSInfo->TVRestore = VT162xRestore; - pBIOSInfo->TVDACSense = VT1622DACSense; - pBIOSInfo->TVModeValid = VT1622ModeValid; - pBIOSInfo->TVModeI2C = VT1622ModeI2C; - pBIOSInfo->TVModeCrtc = VT1622ModeCrtc; - pBIOSInfo->TVPower = VT1622Power; - pBIOSInfo->TVModes = VT1623Modes; - pBIOSInfo->TVNumModes = sizeof(VT1623Modes) / sizeof(DisplayModeRec); - pBIOSInfo->TVPrintRegs = VT162xPrintRegs; - pBIOSInfo->TVNumRegs = 0x6C; + pVIADisplay->TVSave = VT162xSave; + pVIADisplay->TVRestore = VT162xRestore; + pVIADisplay->TVDACSense = VT1622DACSense; + pVIADisplay->TVModeValid = VT1622ModeValid; + pVIADisplay->TVModeI2C = VT1622ModeI2C; + pVIADisplay->TVModeCrtc = VT1622ModeCrtc; + pVIADisplay->TVPower = VT1622Power; + pVIADisplay->TVModes = VT1623Modes; + pVIADisplay->TVNumModes = sizeof(VT1623Modes) / sizeof(DisplayModeRec); + pVIADisplay->TVPrintRegs = VT162xPrintRegs; + pVIADisplay->TVNumRegs = 0x6C; break; case VIA_VT1625: - pBIOSInfo->TVSave = VT162xSave; - pBIOSInfo->TVRestore = VT162xRestore; - pBIOSInfo->TVDACSense = VT1625DACSense; - pBIOSInfo->TVModeValid = VT1625ModeValid; - pBIOSInfo->TVModeI2C = VT1622ModeI2C; - pBIOSInfo->TVModeCrtc = VT1622ModeCrtc; - pBIOSInfo->TVPower = VT1625Power; - pBIOSInfo->TVModes = VT1625Modes; - pBIOSInfo->TVNumModes = sizeof(VT1625Modes) / sizeof(DisplayModeRec); - pBIOSInfo->TVPrintRegs = VT162xPrintRegs; - pBIOSInfo->TVNumRegs = 0x82; + pVIADisplay->TVSave = VT162xSave; + pVIADisplay->TVRestore = VT162xRestore; + pVIADisplay->TVDACSense = VT1625DACSense; + pVIADisplay->TVModeValid = VT1625ModeValid; + pVIADisplay->TVModeI2C = VT1622ModeI2C; + pVIADisplay->TVModeCrtc = VT1622ModeCrtc; + pVIADisplay->TVPower = VT1625Power; + pVIADisplay->TVModes = VT1625Modes; + pVIADisplay->TVNumModes = sizeof(VT1625Modes) / sizeof(DisplayModeRec); + pVIADisplay->TVPrintRegs = VT162xPrintRegs; + pVIADisplay->TVNumRegs = 0x82; break; default: break; diff --git a/src/via_xv_overlay.c b/src/via_xv_overlay.c index b65a688..5d40074 100644 --- a/src/via_xv_overlay.c +++ b/src/via_xv_overlay.c @@ -683,7 +683,7 @@ viaOverlayHQVCalcZoomHeight(VIAPtr pVia, HQV_V_TAP8_12221, HQV_V_TAP8_12221 }; /* CARD32 HQVmini[5] = { 0, 0x0c000000, 0x0a000000, 0x09000000, 0x08800000 }; */ - /*if (pVia->pBIOSInfo->scaleY) + /*if (pVia->pVIADisplay->scaleY) * { * dstHeight = dstHeight + 1; * } */ @@ -1751,10 +1751,10 @@ SetVideoWindow(ScrnInfoPtr pScrn, unsigned long videoFlag, * So, we need to adjust the Y top and bottom position. * if (videoFlag & VIDEO_1_INUSE) { - if (pBIOSInfo->SetDVI && pBIOSInfo->scaleY) { - top = (pUpdate->DstTop * pBIOSInfo->Panel->NativeMode->Height + if (pVIADisplay->SetDVI && pVIADisplay->scaleY) { + top = (pUpdate->DstTop * pVIADisplay->Panel->NativeMode->Height / pScrn->currentMode->VDisplay); - bottom = (pUpdate->DstBottom * pBIOSInfo->Panel->NativeMode->Height + bottom = (pUpdate->DstBottom * pVIADisplay->Panel->NativeMode->Height / pScrn->currentMode->VDisplay); } }*/ @@ -1830,10 +1830,10 @@ Upd_Video(xf86CrtcPtr crtc, unsigned long videoFlag, pUpdate->DstTop, pUpdate->DstBottom)); dstWidth = pUpdate->DstRight - pUpdate->DstLeft; - /*if (pBIOSInfo->lvds && pBIOSInfo->lvds->status == XF86OutputStatusConnected && - pBIOSInfo->Panel->Scale) { + /*if (pVIADisplay->lvds && pVIADisplay->lvds->status == XF86OutputStatusConnected && + pVIADisplay->Panel->Scale) { * FIXME: We need to determine if the panel is using V1 or V3 * - float hfactor = (float)pBIOSInfo->Panel->NativeMode->Width + float hfactor = (float)pVIADisplay->Panel->NativeMode->Width / pScrn->currentMode->HDisplay; dstWidth *= hfactor; }*/ commit 82267cde7de3e1921cf40de65e4016a87b886564 Author: Kevin Brace <kevinbr...@gmx.com> Date: Thu May 18 01:09:06 2017 -0700 Changed viaAnalogInit to viaAnalogInitReg Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/src/via_analog.c b/src/via_analog.c index b2c9ddf..49c098c 100644 --- a/src/via_analog.c +++ b/src/via_analog.c @@ -114,13 +114,13 @@ viaAnalogDisplaySource(ScrnInfoPtr pScrn, int index) * Intializes analog VGA related registers. */ static void -viaAnalogInit(ScrnInfoPtr pScrn) +viaAnalogInitReg(ScrnInfoPtr pScrn) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Entered viaAnalogInit.\n")); + "Entered viaAnalogInitReg.\n")); /* 3X5.37[7] - DAC Power Save Control 1 * 0: Depend on Rx3X5.37[5:4] setting @@ -152,7 +152,7 @@ viaAnalogInit(ScrnInfoPtr pScrn) } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Exiting viaAnalogInit.\n")); + "Exiting viaAnalogInitReg.\n")); } @@ -236,7 +236,7 @@ via_analog_mode_set(xf86OutputPtr output, DisplayModePtr mode, "Entered via_analog_mode_set.\n")); if (output->crtc) { - viaAnalogInit(pScrn); + viaAnalogInitReg(pScrn); viaAnalogSyncPolarity(pScrn, adjusted_mode->Flags); viaAnalogDisplaySource(pScrn, iga->index); } commit 970746a8f3275a203a0af5fbe9e7124701c39de8 Author: Kevin Brace <kevinbr...@gmx.com> Date: Thu May 18 01:05:13 2017 -0700 Moving viaAnalogDisplaySource location Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/src/via_analog.c b/src/via_analog.c index 76567b4..b2c9ddf 100644 --- a/src/via_analog.c +++ b/src/via_analog.c @@ -60,26 +60,6 @@ viaAnalogOutput(ScrnInfoPtr pScrn, Bool outputState) } /* - * Specifies IGA1 or IGA2 for analog VGA DAC source. - */ -static void -viaAnalogDisplaySource(ScrnInfoPtr pScrn, int index) -{ - CARD8 displaySource = index; - - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Entered viaAnalogDisplaySource.\n")); - - viaAnalogSetDisplaySource(pScrn, displaySource & 0x01); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Analog (VGA) Display Source: IGA%d\n", - (displaySource & 0x01) + 1); - - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Exiting viaAnalogDisplaySource.\n")); -} - -/* * Set analog (VGA) sync polarity. */ static void @@ -111,6 +91,26 @@ viaAnalogSyncPolarity(ScrnInfoPtr pScrn, unsigned int flags) } /* + * Specifies IGA1 or IGA2 for analog VGA DAC source. + */ +static void +viaAnalogDisplaySource(ScrnInfoPtr pScrn, int index) +{ + CARD8 displaySource = index; + + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Entered viaAnalogDisplaySource.\n")); + + viaAnalogSetDisplaySource(pScrn, displaySource & 0x01); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Analog (VGA) Display Source: IGA%d\n", + (displaySource & 0x01) + 1); + + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Exiting viaAnalogDisplaySource.\n")); +} + +/* * Intializes analog VGA related registers. */ static void _______________________________________________ Openchrome-devel mailing list Openchrome-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/openchrome-devel