diff options
-rw-r--r-- | README.NV1 | 2 | ||||
-rw-r--r-- | man/nv.man | 4 | ||||
-rw-r--r-- | src/nv_const.h | 2 | ||||
-rw-r--r-- | src/nv_cursor.c | 2 | ||||
-rw-r--r-- | src/nv_dac.c | 3 | ||||
-rw-r--r-- | src/nv_dga.c | 2 | ||||
-rw-r--r-- | src/nv_dma.h | 2 | ||||
-rw-r--r-- | src/nv_driver.c | 51 | ||||
-rw-r--r-- | src/nv_hw.c | 11 | ||||
-rw-r--r-- | src/nv_include.h | 2 | ||||
-rw-r--r-- | src/nv_local.h | 2 | ||||
-rw-r--r-- | src/nv_proto.h | 2 | ||||
-rw-r--r-- | src/nv_setup.c | 2 | ||||
-rw-r--r-- | src/nv_shadow.c | 2 | ||||
-rw-r--r-- | src/nv_type.h | 2 | ||||
-rw-r--r-- | src/nv_video.c | 2 | ||||
-rw-r--r-- | src/nv_xaa.c | 2 | ||||
-rw-r--r-- | src/nvreg.h | 200 | ||||
-rw-r--r-- | src/nvvga.h | 82 | ||||
-rw-r--r-- | src/riva_const.h | 2 | ||||
-rw-r--r-- | src/riva_cursor.c | 2 | ||||
-rw-r--r-- | src/riva_dac.c | 2 | ||||
-rw-r--r-- | src/riva_dga.c | 2 | ||||
-rw-r--r-- | src/riva_driver.c | 3 | ||||
-rw-r--r-- | src/riva_hw.c | 2 | ||||
-rw-r--r-- | src/riva_hw.h | 2 | ||||
-rw-r--r-- | src/riva_include.h | 2 | ||||
-rw-r--r-- | src/riva_local.h | 2 | ||||
-rw-r--r-- | src/riva_proto.h | 2 | ||||
-rw-r--r-- | src/riva_setup.c | 2 | ||||
-rw-r--r-- | src/riva_shadow.c | 2 | ||||
-rw-r--r-- | src/riva_tbl.h | 2 | ||||
-rw-r--r-- | src/riva_type.h | 2 | ||||
-rw-r--r-- | src/riva_xaa.c | 2 |
34 files changed, 352 insertions, 56 deletions
@@ -39,4 +39,4 @@ support the audio functionality of the chip. Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/NV1.sgml,v 3.3 1997/03/22 09:35:30 hohndel Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.NV1,v 3.7 1999/04/15 03:34:51 dawes Exp $ +$XFree86$ @@ -108,8 +108,8 @@ Default: off. Rotate the display clockwise or counterclockwise. This mode is unaccelerated. Default: no rotation. -Note: Option Rotate does not work unless the Resize and Rotate extension has -been turned off. +Note: The Resize and Rotate extension will be disabled if the Rotate option +is used. .TP .BI "Option \*qShadowFB\*q \*q" boolean \*q Enable or disable use of the shadow framebuffer layer. Default: off. diff --git a/src/nv_const.h b/src/nv_const.h index f4ab437..bd01635 100644 --- a/src/nv_const.h +++ b/src/nv_const.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_const.h,v 1.7 2003/07/31 20:24:29 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_const.h,v 1.6 2001/12/07 00:09:55 mvojkovi Exp $ */ #ifndef __NV_CONST_H__ #define __NV_CONST_H__ diff --git a/src/nv_cursor.c b/src/nv_cursor.c index 85ac42a..577b44d 100644 --- a/src/nv_cursor.c +++ b/src/nv_cursor.c @@ -37,7 +37,7 @@ |* *| \***************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_cursor.c,v 1.12 2003/07/31 20:24:29 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_cursor.c,v 1.11 2002/11/26 23:41:58 mvojkovi Exp $ */ #include "nv_include.h" diff --git a/src/nv_dac.c b/src/nv_dac.c index c1e093e..4b3f528 100644 --- a/src/nv_dac.c +++ b/src/nv_dac.c @@ -236,6 +236,9 @@ NVDACInit(ScrnInfoPtr pScrn, DisplayModePtr mode) } else nvReg->cursorConfig |= 0x02000000; + nvReg->timingH = 0; + nvReg->timingV = 0; + return (TRUE); } diff --git a/src/nv_dga.c b/src/nv_dga.c index d4bf3ff..baafbfe 100644 --- a/src/nv_dga.c +++ b/src/nv_dga.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_dga.c,v 1.12 2003/07/31 20:24:29 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_dga.c,v 1.11 2002/01/25 21:56:06 tsi Exp $ */ #include "nv_local.h" #include "nv_include.h" diff --git a/src/nv_dma.h b/src/nv_dma.h index 6506068..15b222f 100644 --- a/src/nv_dma.h +++ b/src/nv_dma.h @@ -38,7 +38,7 @@ |* *| \***************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_dma.h,v 1.2 2003/07/31 21:41:26 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_dma.h,v 1.1 2003/07/31 20:24:29 mvojkovi Exp $ */ #define SURFACE_FORMAT 0x00000300 #define SURFACE_FORMAT_DEPTH8 0x00000001 diff --git a/src/nv_driver.c b/src/nv_driver.c index c8c2278..11a71e7 100644 --- a/src/nv_driver.c +++ b/src/nv_driver.c @@ -1,3 +1,4 @@ +/* $XdotOrg: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c,v 1.1.4.3.2.1 2004/03/04 17:47:49 eich Exp $ */ /* $XConsortium: nv_driver.c /main/3 1996/10/28 05:13:37 kaleb $ */ /* * Copyright 1996-1997 David J. McKay @@ -24,7 +25,7 @@ /* Hacked together from mga driver and 3.3.4 NVIDIA driver by Jarno Paananen <jpaana@s2.org> */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c,v 1.119 2003/11/07 23:56:28 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c,v 1.122 2004/01/10 22:31:53 mvojkovi Exp $ */ #include "nv_include.h" @@ -167,6 +168,7 @@ static SymTabRec NVKnownChipsets[] = { 0x10DE031D, "0x031D" }, { 0x10DE031E, "0x031E" }, { 0x10DE031F, "0x031F" }, + { 0x10DE0320, "GeForce FX 5200" }, { 0x10DE0321, "GeForce FX 5200 Ultra" }, { 0x10DE0322, "GeForce FX 5200" }, { 0x10DE0323, "GeForce FX 5200SE" }, @@ -191,12 +193,14 @@ static SymTabRec NVKnownChipsets[] = { 0x10DE0338, "Quadro FX 3000" }, { 0x10DE0341, "GeForce FX 5700 Ultra" }, { 0x10DE0342, "GeForce FX 5700" }, - { 0x10DE0343, "0x0343" }, - { 0x10DE0347, "0x0347" }, - { 0x10DE0348, "0x0348" }, + { 0x10DE0343, "GeForce FX 5700LE" }, + { 0x10DE0344, "GeForce FX 5700VE" }, + { 0x10DE0345, "0x0345" }, + { 0x10DE0347, "GeForce FX Go5700" }, + { 0x10DE0348, "GeForce FX Go5700" }, { 0x10DE0349, "0x0349" }, { 0x10DE034B, "0x034B" }, - { 0x10DE034C, "0x034C" }, + { 0x10DE034C, "Quadro FX Go1000" }, { 0x10DE034E, "Quadro FX 1100" }, { 0x10DE034F, "0x034F" }, {-1, NULL} @@ -1183,22 +1187,12 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) NVCommonSetup(pScrn); - /* - * If the user has specified the amount of memory in the XF86Config - * file, we respect that setting. - */ - if (pNv->pEnt->device->videoRam != 0) { - pScrn->videoRam = pNv->pEnt->device->videoRam; - from = X_CONFIG; + if (pNv->FBDev) { + pScrn->videoRam = fbdevHWGetVidmem(pScrn)/1024; } else { - if (pNv->FBDev) { - pScrn->videoRam = fbdevHWGetVidmem(pScrn)/1024; - } else { - pScrn->videoRam = pNv->RamAmountKBytes; - } - from = X_PROBED; + pScrn->videoRam = pNv->RamAmountKBytes; } - xf86DrvMsg(pScrn->scrnIndex, from, "VideoRAM: %d kBytes\n", + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VideoRAM: %d kBytes\n", pScrn->videoRam); pNv->FbMapSize = pScrn->videoRam * 1024; @@ -1519,13 +1513,15 @@ static void NVBacklightEnable(NVPtr pNv, Bool on) (pNv->Chipset == 0x10DE0329)) { /* NV17,18,34 Apple iMac, iBook, PowerBook */ - CARD32 tmp; - tmp = pNv->PMC[0x10F0/4] & 0x7FFFFFFF; - pNv->PMC[0x10F0/4] = tmp; - tmp = pNv->PCRTC0[0x081C/4] & 0xFFFFFFFC; - if(on) - tmp |= 0x1; - pNv->PCRTC0[0x081C/4] = tmp; + CARD32 tmp_pmc, tmp_pcrt; + tmp_pmc = pNv->PMC[0x10F0/4] & 0x7FFFFFFF; + tmp_pcrt = pNv->PCRTC0[0x081C/4] & 0xFFFFFFFC; + if(on) { + tmp_pmc |= (1 << 31); + tmp_pcrt |= 0x1; + } + pNv->PMC[0x10F0/4] = tmp_pmc; + pNv->PCRTC0[0x081C/4] = tmp_pcrt; } #endif } @@ -1785,6 +1781,9 @@ NVScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) case 16: refreshArea = NVRefreshArea16; break; case 32: refreshArea = NVRefreshArea32; break; } + xf86DisableRandR(); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Driver rotation enabled, RandR disabled\n"); } ShadowFBInit(pScreen, refreshArea); diff --git a/src/nv_hw.c b/src/nv_hw.c index b5bb015..67e3b5b 100644 --- a/src/nv_hw.c +++ b/src/nv_hw.c @@ -1132,9 +1132,9 @@ void NVLoadStateExt ( } VGA_WR08(pNv->PCIO, 0x03D4, 0x53); - VGA_WR08(pNv->PCIO, 0x03D5, 0); + VGA_WR08(pNv->PCIO, 0x03D5, state->timingH); VGA_WR08(pNv->PCIO, 0x03D4, 0x54); - VGA_WR08(pNv->PCIO, 0x03D5, 0); + VGA_WR08(pNv->PCIO, 0x03D5, state->timingV); VGA_WR08(pNv->PCIO, 0x03D4, 0x21); VGA_WR08(pNv->PCIO, 0x03D5, 0xfa); } @@ -1243,6 +1243,13 @@ void NVUnloadStateExt if((pNv->Chipset & 0x0ff0) >= 0x0170) { state->dither = pNv->PRAMDAC[0x083C/4]; } + + if(pNv->FlatPanel) { + VGA_WR08(pNv->PCIO, 0x03D4, 0x53); + state->timingH = VGA_RD08(pNv->PCIO, 0x03D5); + VGA_WR08(pNv->PCIO, 0x03D4, 0x54); + state->timingV = VGA_RD08(pNv->PCIO, 0x03D5); + } } } diff --git a/src/nv_include.h b/src/nv_include.h index 2d4465b..acd3543 100644 --- a/src/nv_include.h +++ b/src/nv_include.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_include.h,v 1.11 2001/12/07 00:09:56 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_include.h,v 1.9 2000/10/06 12:31:03 eich Exp $ */ #ifndef __NV_INCLUDE_H__ #define __NV_INCLUDE_H__ diff --git a/src/nv_local.h b/src/nv_local.h index f9a8668..ed58ef4 100644 --- a/src/nv_local.h +++ b/src/nv_local.h @@ -36,7 +36,7 @@ |* those rights set forth herein. *| |* *| \***************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_local.h,v 1.9 2003/11/03 05:11:25 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_local.h,v 1.8tsi Exp $ */ #ifndef __NV_LOCAL_H__ #define __NV_LOCAL_H__ diff --git a/src/nv_proto.h b/src/nv_proto.h index f526a71..a074346 100644 --- a/src/nv_proto.h +++ b/src/nv_proto.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_proto.h,v 1.10 2003/07/31 20:24:29 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_proto.h,v 1.9 2003/05/04 01:20:52 mvojkovi Exp $ */ #ifndef __NV_PROTO_H__ #define __NV_PROTO_H__ diff --git a/src/nv_setup.c b/src/nv_setup.c index 8f84f8e..e399904 100644 --- a/src/nv_setup.c +++ b/src/nv_setup.c @@ -292,7 +292,7 @@ static void nv10GetConfig (NVPtr pNv) } #endif - if((pNv->Chipset && 0xffff) == 0x01a0) { + if((pNv->Chipset & 0xffff) == 0x01a0) { int amt = pciReadLong(pciTag(0, 0, 1), 0x7C); pNv->RamAmountKBytes = (((amt >> 6) & 31) + 1) * 1024; } else if((pNv->Chipset & 0xffff) == 0x01f0) { diff --git a/src/nv_shadow.c b/src/nv_shadow.c index 5effc79..564220a 100644 --- a/src/nv_shadow.c +++ b/src/nv_shadow.c @@ -2,7 +2,7 @@ Copyright (c) 1999, The XFree86 Project Inc. Written by Mark Vojkovich <markv@valinux.com> */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_shadow.c,v 1.6 2001/01/22 21:32:36 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_shadow.c,v 1.5 2000/03/13 18:49:29 mvojkovi Exp $ */ #include "nv_local.h" #include "nv_include.h" diff --git a/src/nv_type.h b/src/nv_type.h index 5730cb5..5cae38d 100644 --- a/src/nv_type.h +++ b/src/nv_type.h @@ -63,6 +63,8 @@ typedef struct _riva_hw_state U032 cursor0; U032 cursor1; U032 cursor2; + U032 timingH; + U032 timingV; } RIVA_HW_STATE, *NVRegPtr; diff --git a/src/nv_video.c b/src/nv_video.c index 3b2eb5b..66f49c0 100644 --- a/src/nv_video.c +++ b/src/nv_video.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_video.c,v 1.21 2003/11/10 18:22:24 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_video.c,v 1.20tsi Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" diff --git a/src/nv_xaa.c b/src/nv_xaa.c index e237abb..3bf6b16 100644 --- a/src/nv_xaa.c +++ b/src/nv_xaa.c @@ -37,7 +37,7 @@ |* *| \***************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_xaa.c,v 1.34 2003/10/15 20:28:31 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_xaa.c,v 1.33 2003/09/21 00:17:34 mvojkovi Exp $ */ #include "nv_include.h" #include "xaalocal.h" diff --git a/src/nvreg.h b/src/nvreg.h new file mode 100644 index 0000000..c7bd6ba --- /dev/null +++ b/src/nvreg.h @@ -0,0 +1,200 @@ +/* $XConsortium: nvreg.h /main/2 1996/10/28 05:13:41 kaleb $ */ +/* + * Copyright 1996-1997 David J. McKay + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * DAVID J. MCKAY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nvreg.h,v 1.6 2002/01/25 21:56:06 tsi Exp $ */ + +#ifndef __NVREG_H_ +#define __NVREG_H_ + +/* Little macro to construct bitmask for contiguous ranges of bits */ +#define BITMASK(t,b) (((unsigned)(1U << (((t)-(b)+1)))-1) << (b)) +#define MASKEXPAND(mask) BITMASK(1?mask,0?mask) + +/* Macro to set specific bitfields (mask has to be a macro x:y) ! */ +#define SetBF(mask,value) ((value) << (0?mask)) +#define GetBF(var,mask) (((unsigned)((var) & MASKEXPAND(mask))) >> (0?mask) ) + +#define MaskAndSetBF(var,mask,value) (var)=(((var)&(~MASKEXPAND(mask)) \ + | SetBF(mask,value))) + +#define DEVICE_BASE(device) (0?NV##_##device) +#define DEVICE_SIZE(device) ((1?NV##_##device) - DEVICE_BASE(device)+1) + +/* This is where we will have to have conditional compilation */ +#define DEVICE_ACCESS(device,reg) \ + nv##device##Port[((NV_##device##_##reg)-DEVICE_BASE(device))/4] + +#define DEVICE_WRITE(device,reg,value) DEVICE_ACCESS(device,reg)=(value) +#define DEVICE_READ(device,reg) DEVICE_ACCESS(device,reg) +#define DEVICE_PRINT(device,reg) \ + ErrorF("NV_"#device"_"#reg"=#%08lx\n",DEVICE_ACCESS(device,reg)) +#define DEVICE_DEF(device,mask,value) \ + SetBF(NV_##device##_##mask,NV_##device##_##mask##_##value) +#define DEVICE_VALUE(device,mask,value) SetBF(NV_##device##_##mask,value) +#define DEVICE_MASK(device,mask) MASKEXPAND(NV_##device##_##mask) + +#define PDAC_Write(reg,value) DEVICE_WRITE(PDAC,reg,value) +#define PDAC_Read(reg) DEVICE_READ(PDAC,reg) +#define PDAC_Print(reg) DEVICE_PRINT(PDAC,reg) +#define PDAC_Def(mask,value) DEVICE_DEF(PDAC,mask,value) +#define PDAC_Val(mask,value) DEVICE_VALUE(PDAC,mask,value) +#define PDAC_Mask(mask) DEVICE_MASK(PDAC,mask) + +#define PFB_Write(reg,value) DEVICE_WRITE(PFB,reg,value) +#define PFB_Read(reg) DEVICE_READ(PFB,reg) +#define PFB_Print(reg) DEVICE_PRINT(PFB,reg) +#define PFB_Def(mask,value) DEVICE_DEF(PFB,mask,value) +#define PFB_Val(mask,value) DEVICE_VALUE(PFB,mask,value) +#define PFB_Mask(mask) DEVICE_MASK(PFB,mask) + +#define PRM_Write(reg,value) DEVICE_WRITE(PRM,reg,value) +#define PRM_Read(reg) DEVICE_READ(PRM,reg) +#define PRM_Print(reg) DEVICE_PRINT(PRM,reg) +#define PRM_Def(mask,value) DEVICE_DEF(PRM,mask,value) +#define PRM_Val(mask,value) DEVICE_VALUE(PRM,mask,value) +#define PRM_Mask(mask) DEVICE_MASK(PRM,mask) + +#define PGRAPH_Write(reg,value) DEVICE_WRITE(PGRAPH,reg,value) +#define PGRAPH_Read(reg) DEVICE_READ(PGRAPH,reg) +#define PGRAPH_Print(reg) DEVICE_PRINT(PGRAPH,reg) +#define PGRAPH_Def(mask,value) DEVICE_DEF(PGRAPH,mask,value) +#define PGRAPH_Val(mask,value) DEVICE_VALUE(PGRAPH,mask,value) +#define PGRAPH_Mask(mask) DEVICE_MASK(PGRAPH,mask) + +#define PDMA_Write(reg,value) DEVICE_WRITE(PDMA,reg,value) +#define PDMA_Read(reg) DEVICE_READ(PDMA,reg) +#define PDMA_Print(reg) DEVICE_PRINT(PDMA,reg) +#define PDMA_Def(mask,value) DEVICE_DEF(PDMA,mask,value) +#define PDMA_Val(mask,value) DEVICE_VALUE(PDMA,mask,value) +#define PDMA_Mask(mask) DEVICE_MASK(PDMA,mask) + +#define PTIMER_Write(reg,value) DEVICE_WRITE(PTIMER,reg,value) +#define PTIMER_Read(reg) DEVICE_READ(PTIMER,reg) +#define PTIMER_Print(reg) DEVICE_PRINT(PTIMER,reg) +#define PTIMER_Def(mask,value) DEVICE_DEF(PTIMER,mask,value) +#define PTIMER_Val(mask,value) DEVICE_VALUE(PTIEMR,mask,value) +#define PTIMER_Mask(mask) DEVICE_MASK(PTIMER,mask) + +#define PEXTDEV_Write(reg,value) DEVICE_WRITE(PEXTDEV,reg,value) +#define PEXTDEV_Read(reg) DEVICE_READ(PEXTDEV,reg) +#define PEXTDEV_Print(reg) DEVICE_PRINT(PEXTDEV,reg) +#define PEXTDEV_Def(mask,value) DEVICE_DEF(PEXTDEV,mask,value) +#define PEXTDEV_Val(mask,value) DEVICE_VALUE(PEXTDEV,mask,value) +#define PEXTDEV_Mask(mask) DEVICE_MASK(PEXTDEV,mask) + +#define PFIFO_Write(reg,value) DEVICE_WRITE(PFIFO,reg,value) +#define PFIFO_Read(reg) DEVICE_READ(PFIFO,reg) +#define PFIFO_Print(reg) DEVICE_PRINT(PFIFO,reg) +#define PFIFO_Def(mask,value) DEVICE_DEF(PFIFO,mask,value) +#define PFIFO_Val(mask,value) DEVICE_VALUE(PFIFO,mask,value) +#define PFIFO_Mask(mask) DEVICE_MASK(PFIFO,mask) + +#define PRAM_Write(reg,value) DEVICE_WRITE(PRAM,reg,value) +#define PRAM_Read(reg) DEVICE_READ(PRAM,reg) +#define PRAM_Print(reg) DEVICE_PRINT(PRAM,reg) +#define PRAM_Def(mask,value) DEVICE_DEF(PRAM,mask,value) +#define PRAM_Val(mask,value) DEVICE_VALUE(PRAM,mask,value) +#define PRAM_Mask(mask) DEVICE_MASK(PRAM,mask) + +#define PRAMFC_Write(reg,value) DEVICE_WRITE(PRAMFC,reg,value) +#define PRAMFC_Read(reg) DEVICE_READ(PRAMFC,reg) +#define PRAMFC_Print(reg) DEVICE_PRINT(PRAMFC,reg) +#define PRAMFC_Def(mask,value) DEVICE_DEF(PRAMFC,mask,value) +#define PRAMFC_Val(mask,value) DEVICE_VALUE(PRAMFC,mask,value) +#define PRAMFC_Mask(mask) DEVICE_MASK(PRAMFC,mask) + +#define PMC_Write(reg,value) DEVICE_WRITE(PMC,reg,value) +#define PMC_Read(reg) DEVICE_READ(PMC,reg) +#define PMC_Print(reg) DEVICE_PRINT(PMC,reg) +#define PMC_Def(mask,value) DEVICE_DEF(PMC,mask,value) +#define PMC_Val(mask,value) DEVICE_VALUE(PMC,mask,value) +#define PMC_Mask(mask) DEVICE_MASK(PMC,mask) + +#define PMC_Write(reg,value) DEVICE_WRITE(PMC,reg,value) +#define PMC_Read(reg) DEVICE_READ(PMC,reg) +#define PMC_Print(reg) DEVICE_PRINT(PMC,reg) +#define PMC_Def(mask,value) DEVICE_DEF(PMC,mask,value) +#define PMC_Val(mask,value) DEVICE_VALUE(PMC,mask,value) +#define PMC_Mask(mask) DEVICE_MASK(PMC,mask) + + +#define PBUS_Write(reg,value) DEVICE_WRITE(PBUS,reg,value) +#define PBUS_Read(reg) DEVICE_READ(PBUS,reg) +#define PBUS_Print(reg) DEVICE_PRINT(PBUS,reg) +#define PBUS_Def(mask,value) DEVICE_DEF(PBUS,mask,value) +#define PBUS_Val(mask,value) DEVICE_VALUE(PBUS,mask,value) +#define PBUS_Mask(mask) DEVICE_MASK(PBUS,mask) + + +#define PRAMDAC_Write(reg,value) DEVICE_WRITE(PRAMDAC,reg,value) +#define PRAMDAC_Read(reg) DEVICE_READ(PRAMDAC,reg) +#define PRAMDAC_Print(reg) DEVICE_PRINT(PRAMDAC,reg) +#define PRAMDAC_Def(mask,value) DEVICE_DEF(PRAMDAC,mask,value) +#define PRAMDAC_Val(mask,value) DEVICE_VALUE(PRAMDAC,mask,value) +#define PRAMDAC_Mask(mask) DEVICE_MASK(PRAMDAC,mask) + + +#define PDAC_ReadExt(reg) \ + ((PDAC_Write(INDEX_LO,(NV_PDAC_EXT_##reg) & 0xff)),\ + (PDAC_Write(INDEX_HI,((NV_PDAC_EXT_##reg) >> 8) & 0xff)),\ + (PDAC_Read(INDEX_DATA))) + +#define PDAC_WriteExt(reg,value)\ + ((PDAC_Write(INDEX_LO,(NV_PDAC_EXT_##reg) & 0xff)),\ + (PDAC_Write(INDEX_HI,((NV_PDAC_EXT_##reg) >> 8) & 0xff)),\ + (PDAC_Write(INDEX_DATA,(value)))) + +#define PCRTC_Def(mask,value) DEVICE_DEF(PCRTC,mask,value) +#define PCRTC_Val(mask,value) DEVICE_VALUE(PCRTC,mask,value) +#define PCRTC_Mask(mask) DEVICE_MASK(PCRTC,mask) + + +/* These are the variables which actually point at the register blocks */ +extern volatile unsigned *nvPDACPort; /* Points to the DAC */ +extern volatile unsigned *nvPFBPort; /* Points to the Frame buffer */ +extern volatile unsigned *nvPRMPort; /* Points to real mode stuff */ +extern volatile unsigned *nvPGRAPHPort; /* Graphics unit */ +extern volatile unsigned *nvPDMAPort; /* DMA engine */ +extern volatile unsigned *nvPFIFOPort; /* FIFO registers */ +extern volatile unsigned *nvPTIMERPort; /* TIMER registers */ +extern volatile unsigned *nvPEXTDEVPort; /* EXTDEV registers */ +extern volatile unsigned *nvPRAMPort; /* Priviliged RAM registers */ +extern volatile unsigned *nvPRAMFCPort; /* Priviliged RAM (Fifo) */ +extern volatile unsigned *nvPRAMHTPort; /* Priviliged RAM (hash) */ +extern volatile unsigned *nvPMCPort; /* Priviliged RAM (hash) */ +extern volatile unsigned *nvCHAN0Port; /* User channel 0 */ +extern volatile unsigned *nvPRAMDACPort; /* Points to the RAMDAC */ +extern volatile unsigned *nvPRAMINPort; /* Privileges instance memory */ +extern volatile unsigned *nvPBUSPort; /* Priviled Bus */ +extern volatile unsigned *nvPNVMPort; /* Priviled Bus */ +extern volatile unsigned *dumb; /* FrameBuffer - hack!!!! */ + + +typedef enum {NV1,NV3,NV4,NV10,NumNVChips} NVChipType; + +NVChipType GetChipType(void); + + +#endif + + diff --git a/src/nvvga.h b/src/nvvga.h new file mode 100644 index 0000000..e194792 --- /dev/null +++ b/src/nvvga.h @@ -0,0 +1,82 @@ +/* + * Copyright 1996-1997 David J. McKay + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * DAVID J. MCKAY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nvvga.h,v 1.2 2001/11/19 15:33:41 tsi Exp $ */ + +#ifndef __NVVGA_H__ +#define __NVVGA_H__ + +#include "riva_hw.h" + +#define PALETTE_SIZE 256 + +#define NV_PDAC_CURSOR_SIZE 32 +#define NV_PDAC_CURSOR_PLANE_SIZE (NV_PDAC_CURSOR_SIZE*4) + +/* This is the structure for the NV1. It is not a VGA based core */ + +typedef struct { + unsigned char Nparam, Mparam, Oparam, Pparam; + unsigned char NparamMPLL, MparamMPLL, OparamMPLL, PparamMPLL; + unsigned char dacConfReg0; + unsigned char dacConfReg1; + unsigned char dacRgbPalCtrl; + unsigned long confReg0; + unsigned long green0; /* DPMS and sync polarity control */ + unsigned long memoryTrace; + unsigned long startAddr; /* Where to start reading out from the buffer */ + /* All the following registers control the display */ + unsigned long prmConfig0; /* Controls if text mode on or off */ + unsigned long horFrontPorch; /* Front porch in pixels */ + unsigned long horSyncWidth; /* Sync Width in pixels */ + unsigned long horBackPorch; /* horizontal back porch in in pixels */ + unsigned long horDispWidth; /* Horizontal display width in pixels */ + unsigned long verFrontPorch; /* Vertical front porch in lines */ + unsigned long verSyncWidth; /* Vertical sync width in lines */ + unsigned long verBackPorch; /* Vertical back porch in lines */ + unsigned long verDispWidth; /* Vertical display width in lines */ + /* Hardware cursor registers */ + unsigned char cursorCtrl; + unsigned char xHi,xLo,yHi,yLo; + unsigned char colour1[3]; /* RGB values for cursor planes */ + unsigned char colour2[3]; + unsigned char colour3[3]; + unsigned char plane0[NV_PDAC_CURSOR_PLANE_SIZE]; + unsigned char plane1[NV_PDAC_CURSOR_PLANE_SIZE]; + unsigned char palette[PALETTE_SIZE][3]; +}NV1Registers; + +/* + * Driver data structures. + */ +typedef struct { +/* vgaHWRec std; good old IBM VGA */ + int vgaValid; /* is the above state valid?? */ + NVChipType type; /* What the union holds */ + + union { + NV1Registers nv1; + RIVA_HW_STATE RivaState; + }regs; +} vgaNVRec, *vgaNVPtr; + +#endif diff --git a/src/riva_const.h b/src/riva_const.h index 31dc8d5..c3b9794 100644 --- a/src/riva_const.h +++ b/src/riva_const.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_const.h,v 1.1 2003/07/31 20:24:29 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_const.h $ */ #ifndef __RIVA_CONST_H__ #define __RIVA_CONST_H__ diff --git a/src/riva_cursor.c b/src/riva_cursor.c index 7dcaed9..835a4d7 100644 --- a/src/riva_cursor.c +++ b/src/riva_cursor.c @@ -23,7 +23,7 @@ /* Rewritten with reference from mga driver and 3.3.4 NVIDIA driver by Jarno Paananen <jpaana@s2.org> */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_cursor.c,v 1.1 2003/07/31 20:24:29 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_cursor.c $ */ #include "riva_include.h" diff --git a/src/riva_dac.c b/src/riva_dac.c index 348e526..7118ae1 100644 --- a/src/riva_dac.c +++ b/src/riva_dac.c @@ -23,7 +23,7 @@ /* Hacked together from mga driver and 3.3.4 NVIDIA driver by Jarno Paananen <jpaana@s2.org> */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_dac.c,v 1.2 2003/09/16 00:17:46 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_dac.c,v 1.1 2003/07/31 20:24:29 mvojkovi Exp $ */ #include "riva_include.h" diff --git a/src/riva_dga.c b/src/riva_dga.c index cbe4224..6e5afd8 100644 --- a/src/riva_dga.c +++ b/src/riva_dga.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_dga.c,v 1.1 2003/07/31 20:24:29 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/riva/riva_dga.c $ */ #include "riva_local.h" #include "riva_include.h" diff --git a/src/riva_driver.c b/src/riva_driver.c index 1b4ca07..daf7b9c 100644 --- a/src/riva_driver.c +++ b/src/riva_driver.c @@ -1334,6 +1334,9 @@ RivaScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) case 16: refreshArea = RivaRefreshArea16; break; case 32: refreshArea = RivaRefreshArea32; break; } + xf86DisableRandR(); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Driver rotation enabled, RandR disabled\n"); } ShadowFBInit(pScreen, refreshArea); diff --git a/src/riva_hw.c b/src/riva_hw.c index bf6885d..fbd9858 100644 --- a/src/riva_hw.c +++ b/src/riva_hw.c @@ -36,7 +36,7 @@ |* those rights set forth herein. *| |* *| \***************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_hw.c,v 1.52 2003/11/03 05:11:26 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_hw.c,v 1.51tsi Exp $ */ #include "riva_local.h" #include "compiler.h" diff --git a/src/riva_hw.h b/src/riva_hw.h index ec2b90b..0680d7d 100644 --- a/src/riva_hw.h +++ b/src/riva_hw.h @@ -36,7 +36,7 @@ |* those rights set forth herein. *| |* *| \***************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_hw.h,v 1.26 2003/07/31 20:24:31 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_hw.h,v 1.25 2003/05/04 01:20:52 mvojkovi Exp $ */ #ifndef __RIVA_HW_H__ #define __RIVA_HW_H__ diff --git a/src/riva_include.h b/src/riva_include.h index e64d78f..d5994d2 100644 --- a/src/riva_include.h +++ b/src/riva_include.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_include.h,v 1.1 2003/07/31 20:24:31 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_include.h $ */ #ifndef __RIVA_INCLUDE_H__ #define __RIVA_INCLUDE_H__ diff --git a/src/riva_local.h b/src/riva_local.h index efe0c7e..b060acc 100644 --- a/src/riva_local.h +++ b/src/riva_local.h @@ -36,7 +36,7 @@ |* those rights set forth herein. *| |* *| \***************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_local.h,v 1.2 2003/11/03 05:11:26 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_local.h,v 1.1tsi Exp $ */ #ifndef __RIVA_LOCAL_H__ #define __RIVA_LOCAL_H__ diff --git a/src/riva_proto.h b/src/riva_proto.h index 75f5d01..bff07a2 100644 --- a/src/riva_proto.h +++ b/src/riva_proto.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_proto.h,v 1.1 2003/07/31 20:24:31 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_proto.h $ */ #ifndef __RIVA_PROTO_H__ #define __RIVA_PROTO_H__ diff --git a/src/riva_setup.c b/src/riva_setup.c index 6a0d32e..7e8b874 100644 --- a/src/riva_setup.c +++ b/src/riva_setup.c @@ -23,7 +23,7 @@ /* Hacked together from mga driver and 3.3.4 NVIDIA driver by Jarno Paananen <jpaana@s2.org> */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_setup.c,v 1.1 2003/07/31 20:24:31 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_setup.c $ */ #include "riva_include.h" diff --git a/src/riva_shadow.c b/src/riva_shadow.c index 90f1f12..a858f7c 100644 --- a/src/riva_shadow.c +++ b/src/riva_shadow.c @@ -2,7 +2,7 @@ Copyright (c) 1999, The XFree86 Project Inc. Written by Mark Vojkovich <markv@valinux.com> */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_shadow.c,v 1.1 2003/07/31 20:24:31 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_shadow.c $ */ #include "riva_local.h" #include "riva_include.h" diff --git a/src/riva_tbl.h b/src/riva_tbl.h index bb2a329..4156c80 100644 --- a/src/riva_tbl.h +++ b/src/riva_tbl.h @@ -36,7 +36,7 @@ |* those rights set forth herein. *| |* *| \***************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_tbl.h,v 1.10 2003/07/31 20:24:31 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_tbl.h,v 1.9 2002/01/30 01:35:03 mvojkovi Exp $ */ /* diff --git a/src/riva_type.h b/src/riva_type.h index 7913128..204c758 100644 --- a/src/riva_type.h +++ b/src/riva_type.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_type.h,v 1.1 2003/07/31 20:24:31 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_type.h $ */ #ifndef __Riva_STRUCT_H__ #define __Riva_STRUCT_H__ diff --git a/src/riva_xaa.c b/src/riva_xaa.c index 240e9ec..a7d30a0 100644 --- a/src/riva_xaa.c +++ b/src/riva_xaa.c @@ -40,7 +40,7 @@ /* Hacked together from mga driver and 3.3.4 NVIDIA driver by Jarno Paananen <jpaana@s2.org> */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_xaa.c,v 1.1 2003/07/31 20:24:31 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_xaa.c $ */ #include "riva_include.h" #include "xaalocal.h" |